padrino-gen 0.11.3 → 0.11.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +1 -1
- data/lib/padrino-gen.rb +14 -22
- data/lib/padrino-gen/command.rb +4 -5
- data/lib/padrino-gen/generators/actions.rb +63 -48
- data/lib/padrino-gen/generators/app.rb +15 -17
- data/lib/padrino-gen/generators/app/app.rb.tt +2 -2
- data/lib/padrino-gen/generators/cli.rb +9 -9
- data/lib/padrino-gen/generators/component.rb +62 -0
- data/lib/padrino-gen/generators/components/actions.rb +48 -57
- data/lib/padrino-gen/generators/components/mocks/mocha.rb +2 -1
- data/lib/padrino-gen/generators/components/mocks/rr.rb +1 -1
- data/lib/padrino-gen/generators/components/orms/minirecord.rb +2 -2
- data/lib/padrino-gen/generators/components/orms/mongoid.rb +7 -7
- data/lib/padrino-gen/generators/components/orms/ohm.rb +3 -3
- data/lib/padrino-gen/generators/components/stylesheets/compass.rb +1 -1
- data/lib/padrino-gen/generators/components/stylesheets/compass/partials/_base.scss +5 -3
- data/lib/padrino-gen/generators/components/stylesheets/less.rb +1 -1
- data/lib/padrino-gen/generators/components/stylesheets/sass.rb +1 -1
- data/lib/padrino-gen/generators/components/stylesheets/scss.rb +1 -1
- data/lib/padrino-gen/generators/controller.rb +6 -10
- data/lib/padrino-gen/generators/mailer.rb +7 -11
- data/lib/padrino-gen/generators/migration.rb +4 -9
- data/lib/padrino-gen/generators/model.rb +6 -12
- data/lib/padrino-gen/generators/plugin.rb +9 -12
- data/lib/padrino-gen/generators/project.rb +18 -28
- data/lib/padrino-gen/generators/runner.rb +25 -25
- data/lib/padrino-gen/padrino-tasks/activerecord.rb +11 -12
- data/lib/padrino-gen/padrino-tasks/datamapper.rb +3 -3
- data/lib/padrino-gen/padrino-tasks/mongoid.rb +9 -9
- data/lib/padrino-gen/padrino-tasks/mongomapper.rb +4 -5
- data/lib/padrino-gen/padrino-tasks/sequel.rb +1 -2
- data/test/helper.rb +1 -1
- data/test/test_component_generator.rb +85 -0
- data/test/test_generator.rb +1 -1
- data/test/test_plugin_generator.rb +1 -1
- data/test/test_project_generator.rb +11 -4
- metadata +12 -15
data/test/test_generator.rb
CHANGED
@@ -4,7 +4,7 @@ describe "Generator" do
|
|
4
4
|
|
5
5
|
context "the generator" do
|
6
6
|
should "have default generators" do
|
7
|
-
%w{controller mailer migration model app plugin}.each do |gen|
|
7
|
+
%w{controller mailer migration model app plugin component}.each do |gen|
|
8
8
|
assert Padrino::Generators.mappings.has_key?(gen.to_sym)
|
9
9
|
assert_equal "Padrino::Generators::#{gen.camelize}", Padrino::Generators.mappings[gen.to_sym].name
|
10
10
|
assert Padrino::Generators.mappings[gen.to_sym].respond_to?(:start)
|
@@ -25,7 +25,7 @@ describe "PluginGenerator" do
|
|
25
25
|
capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}") }
|
26
26
|
capture_io { generate(:plugin, path, "--root=#{@apptmp}/sample_project") }
|
27
27
|
capture_io { generate(:plugin, path, "--root=#{@apptmp}/sample_project", '-d') }
|
28
|
-
assert_no_file_exists("#{@apptmp}/sample_project/lib/
|
28
|
+
assert_no_file_exists("#{@apptmp}/sample_project/lib/hoptoad_initializer.rb")
|
29
29
|
assert_no_match_in_file(/enable \:raise_errors/,"#{@apptmp}/sample_project/app/app.rb")
|
30
30
|
assert_no_match_in_file(/rack\_hoptoad/, "#{@apptmp}/sample_project/Gemfile")
|
31
31
|
end
|
@@ -221,6 +221,13 @@ describe "ProjectGenerator" do
|
|
221
221
|
assert_match_in_file(/gem 'mocha'/, "#{@apptmp}/sample_project/Gemfile")
|
222
222
|
assert_match_in_file(/conf.mock_with :mocha/m, "#{@apptmp}/sample_project/spec/spec_helper.rb")
|
223
223
|
end
|
224
|
+
|
225
|
+
should "properly generate for mocha and riot" do
|
226
|
+
out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--test=riot', '--mock=mocha', '--script=none') }
|
227
|
+
assert_match(/applying.*?mocha.*?mock/, out)
|
228
|
+
assert_match_in_file(/gem 'mocha'.*require => false/, "#{@apptmp}/sample_project/Gemfile")
|
229
|
+
assert_match_in_file(/require 'mocha\/api'/, "#{@apptmp}/sample_project/test/test_config.rb")
|
230
|
+
end
|
224
231
|
end
|
225
232
|
|
226
233
|
context "the generator for orm components" do
|
@@ -608,7 +615,7 @@ describe "ProjectGenerator" do
|
|
608
615
|
should "properly generate for sass" do
|
609
616
|
capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--renderer=haml','--script=none','--stylesheet=sass') }
|
610
617
|
assert_match_in_file(/gem 'sass'/, "#{@apptmp}/sample_project/Gemfile")
|
611
|
-
assert_match_in_file(/module SassInitializer.*Sass::Plugin::Rack/m, "#{@apptmp}/sample_project/lib/
|
618
|
+
assert_match_in_file(/module SassInitializer.*Sass::Plugin::Rack/m, "#{@apptmp}/sample_project/lib/sass_initializer.rb")
|
612
619
|
assert_match_in_file(/register SassInitializer/m, "#{@apptmp}/sample_project/app/app.rb")
|
613
620
|
assert_dir_exists("#{@apptmp}/sample_project/app/stylesheets")
|
614
621
|
end
|
@@ -616,7 +623,7 @@ describe "ProjectGenerator" do
|
|
616
623
|
should "properly generate for less" do
|
617
624
|
capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--renderer=haml','--script=none','--stylesheet=less') }
|
618
625
|
assert_match_in_file(/gem 'rack-less'/, "#{@apptmp}/sample_project/Gemfile")
|
619
|
-
assert_match_in_file(/module LessInitializer.*Rack::Less/m, "#{@apptmp}/sample_project/lib/
|
626
|
+
assert_match_in_file(/module LessInitializer.*Rack::Less/m, "#{@apptmp}/sample_project/lib/less_initializer.rb")
|
620
627
|
assert_match_in_file(/register LessInitializer/m, "#{@apptmp}/sample_project/app/app.rb")
|
621
628
|
assert_dir_exists("#{@apptmp}/sample_project/app/stylesheets")
|
622
629
|
end
|
@@ -635,8 +642,8 @@ describe "ProjectGenerator" do
|
|
635
642
|
should "properly generate for scss" do
|
636
643
|
capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--renderer=haml','--script=none','--stylesheet=scss') }
|
637
644
|
assert_match_in_file(/gem 'haml'/, "#{@apptmp}/sample_project/Gemfile")
|
638
|
-
assert_match_in_file(/module ScssInitializer.*Sass::Plugin::Rack/m, "#{@apptmp}/sample_project/lib/
|
639
|
-
assert_match_in_file(/Sass::Plugin.options\[:syntax\] = :scss/m, "#{@apptmp}/sample_project/lib/
|
645
|
+
assert_match_in_file(/module ScssInitializer.*Sass::Plugin::Rack/m, "#{@apptmp}/sample_project/lib/scss_initializer.rb")
|
646
|
+
assert_match_in_file(/Sass::Plugin.options\[:syntax\] = :scss/m, "#{@apptmp}/sample_project/lib/scss_initializer.rb")
|
640
647
|
assert_match_in_file(/register ScssInitializer/m, "#{@apptmp}/sample_project/app/app.rb")
|
641
648
|
assert_dir_exists("#{@apptmp}/sample_project/app/stylesheets")
|
642
649
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
5
|
-
prerelease:
|
4
|
+
version: 0.11.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Padrino Team
|
@@ -12,28 +11,25 @@ authors:
|
|
12
11
|
autorequire:
|
13
12
|
bindir: bin
|
14
13
|
cert_chain: []
|
15
|
-
date: 2013-
|
14
|
+
date: 2013-09-24 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: padrino-core
|
19
18
|
requirement: !ruby/object:Gem::Requirement
|
20
|
-
none: false
|
21
19
|
requirements:
|
22
20
|
- - '='
|
23
21
|
- !ruby/object:Gem::Version
|
24
|
-
version: 0.11.
|
22
|
+
version: 0.11.4
|
25
23
|
type: :runtime
|
26
24
|
prerelease: false
|
27
25
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
26
|
requirements:
|
30
27
|
- - '='
|
31
28
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.11.
|
29
|
+
version: 0.11.4
|
33
30
|
- !ruby/object:Gem::Dependency
|
34
31
|
name: bundler
|
35
32
|
requirement: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
33
|
requirements:
|
38
34
|
- - ~>
|
39
35
|
- !ruby/object:Gem::Version
|
@@ -41,7 +37,6 @@ dependencies:
|
|
41
37
|
type: :runtime
|
42
38
|
prerelease: false
|
43
39
|
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
40
|
requirements:
|
46
41
|
- - ~>
|
47
42
|
- !ruby/object:Gem::Version
|
@@ -68,6 +63,7 @@ files:
|
|
68
63
|
- lib/padrino-gen/generators/app.rb
|
69
64
|
- lib/padrino-gen/generators/app/app.rb.tt
|
70
65
|
- lib/padrino-gen/generators/cli.rb
|
66
|
+
- lib/padrino-gen/generators/component.rb
|
71
67
|
- lib/padrino-gen/generators/components/actions.rb
|
72
68
|
- lib/padrino-gen/generators/components/mocks/mocha.rb
|
73
69
|
- lib/padrino-gen/generators/components/mocks/rr.rb
|
@@ -143,6 +139,7 @@ files:
|
|
143
139
|
- test/helper.rb
|
144
140
|
- test/test_app_generator.rb
|
145
141
|
- test/test_cli.rb
|
142
|
+
- test/test_component_generator.rb
|
146
143
|
- test/test_controller_generator.rb
|
147
144
|
- test/test_generator.rb
|
148
145
|
- test/test_mailer_generator.rb
|
@@ -166,28 +163,27 @@ files:
|
|
166
163
|
- lib/padrino-gen/generators/templates/static/ujs/right.js
|
167
164
|
homepage: http://www.padrinorb.com
|
168
165
|
licenses: []
|
166
|
+
metadata: {}
|
169
167
|
post_install_message:
|
170
168
|
rdoc_options:
|
171
169
|
- --charset=UTF-8
|
172
170
|
require_paths:
|
173
171
|
- lib
|
174
172
|
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
-
none: false
|
176
173
|
requirements:
|
177
|
-
- -
|
174
|
+
- - '>='
|
178
175
|
- !ruby/object:Gem::Version
|
179
176
|
version: '0'
|
180
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
-
none: false
|
182
178
|
requirements:
|
183
|
-
- -
|
179
|
+
- - '>='
|
184
180
|
- !ruby/object:Gem::Version
|
185
181
|
version: 1.3.6
|
186
182
|
requirements: []
|
187
183
|
rubyforge_project: padrino-gen
|
188
|
-
rubygems_version:
|
184
|
+
rubygems_version: 2.0.6
|
189
185
|
signing_key:
|
190
|
-
specification_version:
|
186
|
+
specification_version: 4
|
191
187
|
summary: Generators for easily creating and building padrino applications
|
192
188
|
test_files:
|
193
189
|
- test/fixtures/admin_template.rb
|
@@ -198,6 +194,7 @@ test_files:
|
|
198
194
|
- test/helper.rb
|
199
195
|
- test/test_app_generator.rb
|
200
196
|
- test/test_cli.rb
|
197
|
+
- test/test_component_generator.rb
|
201
198
|
- test/test_controller_generator.rb
|
202
199
|
- test/test_generator.rb
|
203
200
|
- test/test_mailer_generator.rb
|