Skip to content

Commit f5436a7

Browse files
committed
Converts ruby to v5 design
1 parent 1db855d commit f5436a7

File tree

18 files changed

+186
-217
lines changed

18 files changed

+186
-217
lines changed

src/Puphpet/Extension/RubyBundle/Configure.php

-16
This file was deleted.

src/Puphpet/Extension/RubyBundle/Controller/FrontController.php

-35
This file was deleted.

src/Puphpet/Extension/RubyBundle/DependencyInjection/PuphpetExtensionRubyExtension.php

-25
This file was deleted.

src/Puphpet/Extension/RubyBundle/PuphpetExtensionRubyBundle.php

-9
This file was deleted.

src/Puphpet/Extension/RubyBundle/Resources/config/routing.yml

-11
This file was deleted.

src/Puphpet/Extension/RubyBundle/Resources/views/form.html.twig

-40
This file was deleted.

src/Puphpet/Extension/RubyBundle/Resources/views/sections/Version.html.twig

-81
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace Puphpet\MainBundle\Controller;
4+
5+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6+
7+
class RubyController extends Controller
8+
{
9+
public function indexAction(array $data)
10+
{
11+
return $this->render('PuphpetMainBundle:ruby:form.html.twig', [
12+
'ruby' => $data,
13+
]);
14+
}
15+
16+
public function addVersionAction()
17+
{
18+
return $this->render('PuphpetMainBundle:ruby/sections:Version.html.twig', [
19+
'selected_version' => $this->getData()['empty_version'],
20+
'available_versions' => $this->getData()['available_versions'],
21+
]);
22+
}
23+
24+
/**
25+
* @return array
26+
*/
27+
private function getData()
28+
{
29+
$manager = $this->get('puphpet.extension.manager');
30+
return $manager->getExtensionData('ruby');
31+
}
32+
}

src/Puphpet/MainBundle/Resources/config/routing.yml

+3
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,6 @@ puphpet.apache:
7474
puphpet.php:
7575
resource: "@PuphpetMainBundle/Resources/config/php/routing.yml"
7676
prefix: /extension/php
77+
puphpet.ruby:
78+
resource: "@PuphpetMainBundle/Resources/config/ruby/routing.yml"
79+
prefix: /extension/ruby
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
puphpet.ruby.homepage:
2+
pattern: /
3+
defaults: { _controller: PuphpetMainBundle:Ruby:index }
4+
5+
puphpet.ruby.add_version:
6+
pattern: /add-version
7+
defaults: { _controller: PuphpetMainBundle:Ruby:addVersion }

src/Puphpet/MainBundle/Resources/config/services.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ services:
3333
- [ addExtension, [ 'xhprof' ] ]
3434
- [ addExtension, [ 'wpcli' ] ]
3535
- [ addExtension, [ 'drush' ] ]
36+
- [ addExtension, [ 'ruby' ] ]
3637

3738
puphpet.twig.base_extension:
3839
class: Puphpet\MainBundle\Twig\BaseExtension

src/Puphpet/MainBundle/Resources/views/front/sections/language.html.twig

+3
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
'drush': extensions.drush.data
88
} %}
99
</div>
10+
<div class="tab-pane" id="ruby">
11+
{% include 'PuphpetMainBundle:ruby:form.html.twig' with { 'ruby': extensions.ruby.data } %}
12+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<div class="section-header hidden">
2+
<h1>Ruby</h1>
3+
<p class="lead">Configure Ruby versions and gems.</p>
4+
</div>
5+
6+
<div class="form-group">
7+
<span class="help-text">
8+
Fedora and skinny jeans not included.
9+
</span>
10+
<div class="clearfix"><label>Install</label></div>
11+
12+
<label class="col-xs-12 radio-tile">
13+
<input type="checkbox" name="ruby[install]" value="1"
14+
class="invisible" checked />
15+
<span class="content">
16+
<span class="header large">
17+
<i class="icon"></i>
18+
<span class="title">Install Ruby</span>
19+
</span>
20+
<span class="footer">
21+
Ruby 1.9.3 comes preinstalled using RVM.
22+
</span>
23+
</span>
24+
</label>
25+
26+
<div class="clearfix"></div>
27+
</div>
28+
29+
<div class="clearfix"></div>
30+
31+
<div class="help-block">
32+
<p>Ruby 1.9.3 is already installed in PuPHPet boxes using RVM.
33+
It is set as the system default version.</p>
34+
<p>To add Gems to the installed 1.9.3, choose it from the list below.</p>
35+
<p>Choosing to install a lower version and setting it as default may
36+
break things, so proceed with caution.</p>
37+
</div>
38+
39+
{% for selected_version in ruby.versions %}
40+
{% include 'PuphpetMainBundle:ruby/sections:Version.html.twig' with {
41+
'available_versions': ruby.available_versions, 'selected_version': selected_version} %}
42+
{% endfor %}
43+
44+
<a href="#" data-source-url="{{ path('puphpet.ruby.add_version') }}"
45+
class="add-block"><i class="fa fa-level-up fa-rotate-90"></i> Add another Ruby version</a>
46+

0 commit comments

Comments
 (0)