padrino-gen 0.10.7 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/lib/padrino-gen/generators/actions.rb +139 -102
  3. data/lib/padrino-gen/generators/app/app.rb.tt +55 -53
  4. data/lib/padrino-gen/generators/app.rb +16 -16
  5. data/lib/padrino-gen/generators/cli.rb +3 -3
  6. data/lib/padrino-gen/generators/components/actions.rb +1 -1
  7. data/lib/padrino-gen/generators/components/orms/activerecord.rb +22 -18
  8. data/lib/padrino-gen/generators/components/orms/couchrest.rb +1 -1
  9. data/lib/padrino-gen/generators/components/orms/datamapper.rb +2 -1
  10. data/lib/padrino-gen/generators/components/orms/{mini_record.rb → minirecord.rb} +9 -9
  11. data/lib/padrino-gen/generators/components/orms/mongoid.rb +60 -6
  12. data/lib/padrino-gen/generators/components/orms/mongomapper.rb +2 -2
  13. data/lib/padrino-gen/generators/components/orms/mongomatic.rb +2 -2
  14. data/lib/padrino-gen/generators/components/orms/ohm.rb +57 -10
  15. data/lib/padrino-gen/generators/components/orms/ripple.rb +1 -1
  16. data/lib/padrino-gen/generators/components/orms/sequel.rb +15 -6
  17. data/lib/padrino-gen/generators/components/stylesheets/compass.rb +1 -1
  18. data/lib/padrino-gen/generators/components/stylesheets/less.rb +1 -0
  19. data/lib/padrino-gen/generators/components/tests/bacon.rb +0 -2
  20. data/lib/padrino-gen/generators/components/tests/minitest.rb +0 -1
  21. data/lib/padrino-gen/generators/components/tests/riot.rb +0 -1
  22. data/lib/padrino-gen/generators/components/tests/rspec.rb +14 -15
  23. data/lib/padrino-gen/generators/components/tests/shoulda.rb +0 -1
  24. data/lib/padrino-gen/generators/components/tests/testspec.rb +0 -1
  25. data/lib/padrino-gen/generators/controller.rb +14 -11
  26. data/lib/padrino-gen/generators/mailer.rb +14 -11
  27. data/lib/padrino-gen/generators/migration.rb +5 -5
  28. data/lib/padrino-gen/generators/model.rb +8 -7
  29. data/lib/padrino-gen/generators/plugin.rb +15 -9
  30. data/lib/padrino-gen/generators/project/.gitignore +2 -1
  31. data/lib/padrino-gen/generators/project/config/apps.rb.tt +10 -8
  32. data/lib/padrino-gen/generators/project/config.ru +0 -0
  33. data/lib/padrino-gen/generators/project/public/favicon.ico +0 -0
  34. data/lib/padrino-gen/generators/project.rb +53 -25
  35. data/lib/padrino-gen/generators/runner.rb +1 -1
  36. data/lib/padrino-gen/generators/templates/Gemfile.tt +8 -3
  37. data/lib/padrino-gen/generators/templates/Rakefile.tt +8 -0
  38. data/lib/padrino-gen/generators/templates/controller.rb.tt +8 -9
  39. data/lib/padrino-gen/generators/templates/gem/README.md.tt +29 -0
  40. data/lib/padrino-gen/generators/templates/gem/gemspec.tt +19 -0
  41. data/lib/padrino-gen/generators/templates/gem/lib/libname/version.tt +3 -0
  42. data/lib/padrino-gen/generators/templates/gem/lib/libname.tt +6 -0
  43. data/lib/padrino-gen/generators/templates/helper.rb.tt +1 -1
  44. data/lib/padrino-gen/generators/templates/mailer.rb.tt +1 -1
  45. data/lib/padrino-gen/generators/templates/static/js/dojo.js +238 -1
  46. data/lib/padrino-gen/generators/templates/static/js/ext.js +38 -1
  47. data/lib/padrino-gen/generators/templates/static/js/jquery.js +4 -4
  48. data/lib/padrino-gen/generators/templates/static/js/mootools.js +335 -276
  49. data/lib/padrino-gen/generators/templates/static/js/protopak.js +1 -1
  50. data/lib/padrino-gen/generators/templates/static/js/right.js +7 -1
  51. data/lib/padrino-gen/generators/templates/static/ujs/jquery.js +76 -75
  52. data/lib/padrino-gen/padrino-tasks/activerecord.rb +8 -2
  53. data/lib/padrino-gen/padrino-tasks/database.rb +11 -0
  54. data/lib/padrino-gen/padrino-tasks/datamapper.rb +38 -12
  55. data/lib/padrino-gen/padrino-tasks/minirecord.rb +19 -0
  56. data/lib/padrino-gen/padrino-tasks/mongoid.rb +76 -18
  57. data/lib/padrino-gen/padrino-tasks/mongomapper.rb +9 -1
  58. data/lib/padrino-gen/padrino-tasks/sequel.rb +6 -1
  59. data/lib/padrino-gen.rb +2 -2
  60. data/padrino-gen.gemspec +0 -0
  61. data/test/helper.rb +1 -1
  62. data/test/test_app_generator.rb +23 -4
  63. data/test/test_controller_generator.rb +8 -8
  64. data/test/test_mailer_generator.rb +5 -5
  65. data/test/test_model_generator.rb +26 -23
  66. data/test/test_plugin_generator.rb +23 -0
  67. data/test/test_project_generator.rb +82 -47
  68. metadata +17 -17
  69. data/lib/padrino-gen/padrino-tasks/seed.rb +0 -5
@@ -15,9 +15,11 @@ describe "ProjectGenerator" do
15
15
  should "allow simple generator to run and create base_app with no options" do
16
16
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}") }
17
17
  assert_file_exists("#{@apptmp}/sample_project")
18
- assert_match_in_file(/class SampleProject < Padrino::Application/,"#{@apptmp}/sample_project/app/app.rb")
19
- assert_match_in_file(/Padrino.mount\("SampleProject"\).to\('\/'\)/,"#{@apptmp}/sample_project/config/apps.rb")
18
+ assert_match_in_file(/module SampleProject/,"#{@apptmp}/sample_project/app/app.rb")
19
+ assert_match_in_file(/class App < Padrino::Application/,"#{@apptmp}/sample_project/app/app.rb")
20
+ assert_match_in_file("Padrino.mount('SampleProject::App', :app_file => Padrino.root('app/app.rb')).to('/')", "#{@apptmp}/sample_project/config/apps.rb")
20
21
  assert_file_exists("#{@apptmp}/sample_project/config/boot.rb")
22
+ assert_file_exists("#{@apptmp}/sample_project/Rakefile")
21
23
  assert_file_exists("#{@apptmp}/sample_project/public/favicon.ico")
22
24
  assert_dir_exists("#{@apptmp}/sample_project/public/images")
23
25
  assert_dir_exists("#{@apptmp}/sample_project/public/javascripts")
@@ -29,12 +31,14 @@ describe "ProjectGenerator" do
29
31
  should "generate a valid name" do
30
32
  capture_io { generate(:project, 'project.com', "--root=#{@apptmp}") }
31
33
  assert_file_exists("#{@apptmp}/project.com")
32
- assert_match_in_file(/class ProjectCom < Padrino::Application/, "#{@apptmp}/project.com/app/app.rb")
33
- assert_match_in_file(/Padrino.mount\("ProjectCom"\).to\('\/'\)/, "#{@apptmp}/project.com/config/apps.rb")
34
+ assert_match_in_file(/module ProjectCom/, "#{@apptmp}/project.com/app/app.rb")
35
+ assert_match_in_file(/class App < Padrino::Application/, "#{@apptmp}/project.com/app/app.rb")
36
+ assert_match_in_file("Padrino.mount('ProjectCom::App', :app_file => Padrino.root('app/app.rb')).to('/')", "#{@apptmp}/project.com/config/apps.rb")
34
37
  capture_io { generate(:app, 'ws-dci-2011', "--root=#{@apptmp}/project.com") }
35
- assert_file_exists("#{@apptmp}/project.com/wsdci2011")
36
- assert_match_in_file(/class WsDci2011 < Padrino::Application/, "#{@apptmp}/project.com/wsdci2011/app.rb")
37
- assert_match_in_file(/Padrino.mount\("WsDci2011"\).to\("\/wsdci2011"\)/, "#{@apptmp}/project.com/config/apps.rb")
38
+ assert_file_exists("#{@apptmp}/project.com/ws_dci_2011")
39
+ assert_match_in_file(/module ProjectCom/, "#{@apptmp}/project.com/ws_dci_2011/app.rb")
40
+ assert_match_in_file(/class WsDci2011 < Padrino::Application/, "#{@apptmp}/project.com/ws_dci_2011/app.rb")
41
+ assert_match_in_file("Padrino.mount('ProjectCom::WsDci2011', :app_file => Padrino.root('ws_dci_2011/app.rb')).to('/ws_dci_2011')", "#{@apptmp}/project.com/config/apps.rb")
38
42
  end
39
43
 
40
44
  should "raise an Error when given invalid constant names" do
@@ -51,8 +55,9 @@ describe "ProjectGenerator" do
51
55
  should "allow specifying alternate application name" do
52
56
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--app=base_app') }
53
57
  assert_file_exists("#{@apptmp}/sample_project")
58
+ assert_match_in_file(/module SampleProject/,"#{@apptmp}/sample_project/app/app.rb")
54
59
  assert_match_in_file(/class BaseApp < Padrino::Application/,"#{@apptmp}/sample_project/app/app.rb")
55
- assert_match_in_file(/Padrino.mount\("BaseApp"\).to\('\/'\)/,"#{@apptmp}/sample_project/config/apps.rb")
60
+ assert_match_in_file("Padrino.mount('SampleProject::BaseApp', :app_file => Padrino.root('app/app.rb')).to('/')", "#{@apptmp}/sample_project/config/apps.rb")
56
61
  assert_file_exists("#{@apptmp}/sample_project/config/boot.rb")
57
62
  assert_file_exists("#{@apptmp}/sample_project/public/favicon.ico")
58
63
  end
@@ -67,12 +72,20 @@ describe "ProjectGenerator" do
67
72
  assert_dir_exists("#{@apptmp}/sample_project/public/images")
68
73
  assert_dir_exists("#{@apptmp}/sample_project/public/javascripts")
69
74
  assert_dir_exists("#{@apptmp}/sample_project/public/stylesheets")
70
- # assert_dir_exists("#{@apptmp}/sample_project/app/views/layouts")
71
75
  assert_match_in_file(/:notifier/,"#{@apptmp}/sample_project/app/mailers.rb")
72
76
  assert_no_file_exists("#{@apptmp}/sample_project/demo/helpers")
73
77
  assert_no_file_exists("#{@apptmp}/sample_project/demo/controllers")
74
78
  end
75
79
 
80
+ should "generate gemspec and special files if gem is expected" do
81
+ capture_io { generate(:project,'sample_gem', '--gem', "--root=#{@apptmp}") }
82
+ assert_file_exists("#{@apptmp}/sample_gem/sample_gem.gemspec")
83
+ assert_match_in_file(/^gemspec/,"#{@apptmp}/sample_gem/Gemfile")
84
+ assert_match_in_file(/^module SampleGem/,"#{@apptmp}/sample_gem/app/app.rb")
85
+ assert_match_in_file(/class App/,"#{@apptmp}/sample_gem/app/app.rb")
86
+ assert_file_exists("#{@apptmp}/sample_gem/README.md")
87
+ end
88
+
76
89
  should "not create models folder if no orm is chosen" do
77
90
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--script=none', '--orm=none') }
78
91
  assert_no_dir_exists("#{@apptmp}/sample_project/models")
@@ -85,8 +98,9 @@ describe "ProjectGenerator" do
85
98
 
86
99
  should "place app specific names into correct files" do
87
100
  capture_io { generate(:project, 'warepedia', "--root=#{@apptmp}", '--script=none') }
88
- assert_match_in_file(/class Warepedia < Padrino::Application/m, "#{@apptmp}/warepedia/app/app.rb")
89
- assert_match_in_file(/Padrino.mount\("Warepedia"\).to\('\/'\)/m, "#{@apptmp}/warepedia/config/apps.rb")
101
+ assert_match_in_file(/module Warepedia/m, "#{@apptmp}/warepedia/app/app.rb")
102
+ assert_match_in_file(/class App < Padrino::Application/m, "#{@apptmp}/warepedia/app/app.rb")
103
+ assert_match_in_file("Padrino.mount('Warepedia::App', :app_file => Padrino.root('app/app.rb')).to('/')", "#{@apptmp}/warepedia/config/apps.rb")
90
104
  end
91
105
 
92
106
  should "store and apply session_secret" do
@@ -101,7 +115,7 @@ describe "ProjectGenerator" do
101
115
  assert_equal 'none', components_chosen[:test]
102
116
  assert_equal 'none', components_chosen[:mock]
103
117
  assert_equal 'none', components_chosen[:script]
104
- assert_equal 'haml', components_chosen[:renderer]
118
+ assert_equal 'slim', components_chosen[:renderer]
105
119
  end
106
120
 
107
121
  should "create components file containing options chosen" do
@@ -109,11 +123,11 @@ describe "ProjectGenerator" do
109
123
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", *component_options) }
110
124
  components_chosen = YAML.load_file("#{@apptmp}/sample_project/.components")
111
125
  assert_equal 'datamapper', components_chosen[:orm]
112
- assert_equal 'riot', components_chosen[:test]
113
- assert_equal 'mocha', components_chosen[:mock]
114
- assert_equal 'prototype', components_chosen[:script]
115
- assert_equal 'erb', components_chosen[:renderer]
116
- assert_equal 'less', components_chosen[:stylesheet]
126
+ assert_equal 'riot', components_chosen[:test]
127
+ assert_equal 'mocha', components_chosen[:mock]
128
+ assert_equal 'prototype', components_chosen[:script]
129
+ assert_equal 'erb', components_chosen[:renderer]
130
+ assert_equal 'less', components_chosen[:stylesheet]
117
131
  end
118
132
 
119
133
  should "output to log components being applied" do
@@ -130,7 +144,6 @@ describe "ProjectGenerator" do
130
144
  should "output gem files for base app" do
131
145
  capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--script=none') }
132
146
  assert_match_in_file(/gem 'padrino'/, "#{@apptmp}/sample_project/Gemfile")
133
- assert_match_in_file(/gem 'sinatra-flash'/, "#{@apptmp}/sample_project/Gemfile")
134
147
  end
135
148
  end
136
149
 
@@ -185,8 +198,22 @@ describe "ProjectGenerator" do
185
198
  assert_match_in_file(%r{project_com}, "#{@apptmp}/project.com/config/database.rb")
186
199
  end
187
200
 
188
- should "properly generate mysql" do
201
+ should "properly generate mysql (default to mysql2)" do
189
202
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=sequel', '--adapter=mysql') }
203
+ assert_match_in_file(/gem 'mysql2'/, "#{@apptmp}/sample_project/Gemfile")
204
+ assert_match_in_file(%r{"mysql2://}, "#{@apptmp}/sample_project/config/database.rb")
205
+ assert_match_in_file(/sample_project_development/, "#{@apptmp}/sample_project/config/database.rb")
206
+ end
207
+
208
+ should "properly generate mysql2" do
209
+ out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=sequel', '--adapter=mysql2') }
210
+ assert_match_in_file(/gem 'mysql2'/, "#{@apptmp}/sample_project/Gemfile")
211
+ assert_match_in_file(%r{"mysql2://}, "#{@apptmp}/sample_project/config/database.rb")
212
+ assert_match_in_file(/sample_project_development/, "#{@apptmp}/sample_project/config/database.rb")
213
+ end
214
+
215
+ should "properly generate mysql-gem" do
216
+ out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=sequel', '--adapter=mysql-gem') }
190
217
  assert_match_in_file(/gem 'mysql'/, "#{@apptmp}/sample_project/Gemfile")
191
218
  assert_match_in_file(%r{"mysql://}, "#{@apptmp}/sample_project/config/database.rb")
192
219
  assert_match_in_file(/sample_project_development/, "#{@apptmp}/sample_project/config/database.rb")
@@ -211,17 +238,17 @@ describe "ProjectGenerator" do
211
238
  should "properly generate default" do
212
239
  out, err = capture_io { generate(:project, 'project.com', "--root=#{@apptmp}", '--orm=activerecord', '--script=none') }
213
240
  assert_match(/applying.*?activerecord.*?orm/, out)
214
- assert_match_in_file(/gem 'activerecord', :require => "active_record"/, "#{@apptmp}/project.com/Gemfile")
241
+ assert_match_in_file(/gem 'activerecord', '>= 3.1', :require => 'active_record'/, "#{@apptmp}/project.com/Gemfile")
215
242
  assert_match_in_file(/gem 'sqlite3'/, "#{@apptmp}/project.com/Gemfile")
216
243
  assert_match_in_file(/ActiveRecord::Base.establish_connection/, "#{@apptmp}/project.com/config/database.rb")
217
244
  assert_match_in_file(/project_com/, "#{@apptmp}/project.com/config/database.rb")
218
245
  end
219
246
 
220
- should "properly generate mysql" do
247
+ should "properly generate mysql (default to mysql2)" do
221
248
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=activerecord','--adapter=mysql') }
222
- assert_match_in_file(/gem 'mysql'/, "#{@apptmp}/sample_project/Gemfile")
249
+ assert_match_in_file(/gem 'mysql2'/, "#{@apptmp}/sample_project/Gemfile")
223
250
  assert_match_in_file(/sample_project_development/, "#{@apptmp}/sample_project/config/database.rb")
224
- assert_match_in_file(%r{:adapter => 'mysql'}, "#{@apptmp}/sample_project/config/database.rb")
251
+ assert_match_in_file(%r{:adapter => 'mysql2'}, "#{@apptmp}/sample_project/config/database.rb")
225
252
  end
226
253
 
227
254
  should "properly generate mysql2" do
@@ -231,6 +258,13 @@ describe "ProjectGenerator" do
231
258
  assert_match_in_file(%r{:adapter => 'mysql2'}, "#{@apptmp}/sample_project/config/database.rb")
232
259
  end
233
260
 
261
+ should "properly generate mysql-gem" do
262
+ out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=activerecord','--adapter=mysql-gem') }
263
+ assert_match_in_file(/gem 'mysql', '~> 2.8.1'/, "#{@apptmp}/sample_project/Gemfile")
264
+ assert_match_in_file(/sample_project_development/, "#{@apptmp}/sample_project/config/database.rb")
265
+ assert_match_in_file(%r{:adapter => 'mysql'}, "#{@apptmp}/sample_project/config/database.rb")
266
+ end
267
+
234
268
  should "properly generate sqlite3" do
235
269
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=activerecord', '--adapter=sqlite3') }
236
270
  assert_match_in_file(/gem 'sqlite3'/, "#{@apptmp}/sample_project/Gemfile")
@@ -297,10 +331,13 @@ describe "ProjectGenerator" do
297
331
  should "properly generate for mongoid" do
298
332
  out, err = capture_io { generate(:project, 'project.com', "--root=#{@apptmp}", '--orm=mongoid', '--script=none') }
299
333
  assert_match(/applying.*?mongoid.*?orm/, out)
300
- assert_match_in_file(/gem 'mongoid'/, "#{@apptmp}/project.com/Gemfile")
301
- assert_match_in_file(/gem 'bson_ext'/, "#{@apptmp}/project.com/Gemfile")
302
- assert_match_in_file(/Mongoid.database/, "#{@apptmp}/project.com/config/database.rb")
303
- assert_match_in_file(/project_com/, "#{@apptmp}/project.com/config/database.rb")
334
+ if RUBY_VERSION >= '1.9'
335
+ assert_match_in_file(/gem 'mongoid', '~>3.0.0'/, "#{@apptmp}/project.com/Gemfile")
336
+ assert_match_in_file(/Mongoid::Config.sessions =/, "#{@apptmp}/project.com/config/database.rb")
337
+ else
338
+ assert_match_in_file(/gem 'mongoid', '~>2.0'/, "#{@apptmp}/project.com/Gemfile")
339
+ assert_match_in_file(/Mongoid.database/, "#{@apptmp}/project.com/config/database.rb")
340
+ end
304
341
  end
305
342
 
306
343
 
@@ -315,9 +352,7 @@ describe "ProjectGenerator" do
315
352
  should "properly generate for ohm" do
316
353
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=ohm', '--script=none') }
317
354
  assert_match(/applying.*?ohm.*?orm/, out)
318
- assert_match_in_file(/gem 'json'/, "#{@apptmp}/sample_project/Gemfile")
319
355
  assert_match_in_file(/gem 'ohm'/, "#{@apptmp}/sample_project/Gemfile")
320
- assert_match_in_file(/gem 'ohm-contrib', :require => "ohm\/contrib"/, "#{@apptmp}/sample_project/Gemfile")
321
356
  assert_match_in_file(/Ohm.connect/, "#{@apptmp}/sample_project/config/database.rb")
322
357
  end
323
358
 
@@ -421,8 +456,8 @@ describe "ProjectGenerator" do
421
456
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--test=bacon', '--script=none') }
422
457
  assert_match(/applying.*?bacon.*?test/, out)
423
458
  assert_match_in_file(/gem 'rack-test'/, "#{@apptmp}/sample_project/Gemfile")
424
- assert_match_in_file(/:require => "rack\/test"/, "#{@apptmp}/sample_project/Gemfile")
425
- assert_match_in_file(/:group => "test"/, "#{@apptmp}/sample_project/Gemfile")
459
+ assert_match_in_file(/:require => 'rack\/test'/, "#{@apptmp}/sample_project/Gemfile")
460
+ assert_match_in_file(/:group => 'test'/, "#{@apptmp}/sample_project/Gemfile")
426
461
  assert_match_in_file(/gem 'bacon'/, "#{@apptmp}/sample_project/Gemfile")
427
462
  assert_match_in_file(/Bacon::Context/, "#{@apptmp}/sample_project/test/test_config.rb")
428
463
  assert_match_in_file(/PADRINO_ENV = 'test' unless defined\?\(PADRINO_ENV\)/, "#{@apptmp}/sample_project/test/test_config.rb")
@@ -435,14 +470,14 @@ describe "ProjectGenerator" do
435
470
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--test=riot', '--script=none') }
436
471
  assert_match(/applying.*?riot.*?test/, out)
437
472
  assert_match_in_file(/gem 'rack-test'/, "#{@apptmp}/sample_project/Gemfile")
438
- assert_match_in_file(/:require => "rack\/test"/, "#{@apptmp}/sample_project/Gemfile")
439
- assert_match_in_file(/:group => "test"/, "#{@apptmp}/sample_project/Gemfile")
473
+ assert_match_in_file(/:require => 'rack\/test'/, "#{@apptmp}/sample_project/Gemfile")
474
+ assert_match_in_file(/:group => 'test'/, "#{@apptmp}/sample_project/Gemfile")
440
475
  assert_match_in_file(/gem 'riot'/, "#{@apptmp}/sample_project/Gemfile")
441
476
  assert_match_in_file(/include Rack::Test::Methods/, "#{@apptmp}/sample_project/test/test_config.rb")
442
477
  assert_match_in_file(/PADRINO_ENV = 'test' unless defined\?\(PADRINO_ENV\)/, "#{@apptmp}/sample_project/test/test_config.rb")
443
478
  assert_match_in_file(/Riot::Situation/, "#{@apptmp}/sample_project/test/test_config.rb")
444
479
  assert_match_in_file(/Riot::Context/, "#{@apptmp}/sample_project/test/test_config.rb")
445
- assert_match_in_file(/SampleProject\.tap/, "#{@apptmp}/sample_project/test/test_config.rb")
480
+ assert_match_in_file(/SampleProject::App\.tap/, "#{@apptmp}/sample_project/test/test_config.rb")
446
481
  assert_file_exists("#{@apptmp}/sample_project/test/test.rake")
447
482
  assert_match_in_file(/Rake::TestTask\.new\("test:\#/,"#{@apptmp}/sample_project/test/test.rake")
448
483
  assert_match_in_file(/task 'test' => test_tasks/,"#{@apptmp}/sample_project/test/test.rake")
@@ -452,8 +487,8 @@ describe "ProjectGenerator" do
452
487
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--test=rspec', '--script=none') }
453
488
  assert_match(/applying.*?rspec.*?test/, out)
454
489
  assert_match_in_file(/gem 'rack-test'/, "#{@apptmp}/sample_project/Gemfile")
455
- assert_match_in_file(/:require => "rack\/test"/, "#{@apptmp}/sample_project/Gemfile")
456
- assert_match_in_file(/:group => "test"/, "#{@apptmp}/sample_project/Gemfile")
490
+ assert_match_in_file(/:require => 'rack\/test'/, "#{@apptmp}/sample_project/Gemfile")
491
+ assert_match_in_file(/:group => 'test'/, "#{@apptmp}/sample_project/Gemfile")
457
492
  assert_match_in_file(/gem 'rspec'/, "#{@apptmp}/sample_project/Gemfile")
458
493
  assert_match_in_file(/PADRINO_ENV = 'test' unless defined\?\(PADRINO_ENV\)/, "#{@apptmp}/sample_project/spec/spec_helper.rb")
459
494
  assert_match_in_file(/RSpec.configure/, "#{@apptmp}/sample_project/spec/spec_helper.rb")
@@ -466,8 +501,8 @@ describe "ProjectGenerator" do
466
501
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--test=shoulda', '--script=none') }
467
502
  assert_match(/applying.*?shoulda.*?test/, out)
468
503
  assert_match_in_file(/gem 'rack-test'/, "#{@apptmp}/sample_project/Gemfile")
469
- assert_match_in_file(/:require => "rack\/test"/, "#{@apptmp}/sample_project/Gemfile")
470
- assert_match_in_file(/:group => "test"/, "#{@apptmp}/sample_project/Gemfile")
504
+ assert_match_in_file(/:require => 'rack\/test'/, "#{@apptmp}/sample_project/Gemfile")
505
+ assert_match_in_file(/:group => 'test'/, "#{@apptmp}/sample_project/Gemfile")
471
506
  assert_match_in_file(/gem 'shoulda'/, "#{@apptmp}/sample_project/Gemfile")
472
507
  assert_match_in_file(/PADRINO_ENV = 'test' unless defined\?\(PADRINO_ENV\)/, "#{@apptmp}/sample_project/test/test_config.rb")
473
508
  assert_match_in_file(/Test::Unit::TestCase/, "#{@apptmp}/sample_project/test/test_config.rb")
@@ -480,13 +515,13 @@ describe "ProjectGenerator" do
480
515
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--test=minitest', '--script=none') }
481
516
  assert_match(/applying.*?minitest.*?test/, out)
482
517
  assert_match_in_file(/gem 'rack-test'/, "#{@apptmp}/sample_project/Gemfile")
483
- assert_match_in_file(/:require => "rack\/test"/, "#{@apptmp}/sample_project/Gemfile")
484
- assert_match_in_file(/:group => "test"/, "#{@apptmp}/sample_project/Gemfile")
518
+ assert_match_in_file(/:require => 'rack\/test'/, "#{@apptmp}/sample_project/Gemfile")
519
+ assert_match_in_file(/:group => 'test'/, "#{@apptmp}/sample_project/Gemfile")
485
520
  assert_match_in_file(/gem 'minitest'/, "#{@apptmp}/sample_project/Gemfile")
486
521
  assert_match_in_file(/include Rack::Test::Methods/, "#{@apptmp}/sample_project/test/test_config.rb")
487
522
  assert_match_in_file(/PADRINO_ENV = 'test' unless defined\?\(PADRINO_ENV\)/, "#{@apptmp}/sample_project/test/test_config.rb")
488
523
  assert_match_in_file(/MiniTest::Unit::TestCase/, "#{@apptmp}/sample_project/test/test_config.rb")
489
- assert_match_in_file(/SampleProject\.tap/, "#{@apptmp}/sample_project/test/test_config.rb")
524
+ assert_match_in_file(/SampleProject::App\.tap/, "#{@apptmp}/sample_project/test/test_config.rb")
490
525
  assert_file_exists("#{@apptmp}/sample_project/test/test.rake")
491
526
  assert_match_in_file(/Rake::TestTask\.new\("test:\#/,"#{@apptmp}/sample_project/test/test.rake")
492
527
  assert_match_in_file(/task 'test' => test_tasks/,"#{@apptmp}/sample_project/test/test.rake")
@@ -496,12 +531,12 @@ describe "ProjectGenerator" do
496
531
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--test=testspec', '--script=none') }
497
532
  assert_match(/applying.*?testspec.*?test/, out)
498
533
  assert_match_in_file(/gem 'rack-test'/, "#{@apptmp}/sample_project/Gemfile")
499
- assert_match_in_file(/:require => "rack\/test"/, "#{@apptmp}/sample_project/Gemfile")
500
- assert_match_in_file(/:group => "test"/, "#{@apptmp}/sample_project/Gemfile")
501
- assert_match_in_file(/gem 'test-spec'.*?:require => "test\/spec"/, "#{@apptmp}/sample_project/Gemfile")
534
+ assert_match_in_file(/:require => 'rack\/test'/, "#{@apptmp}/sample_project/Gemfile")
535
+ assert_match_in_file(/:group => 'test'/, "#{@apptmp}/sample_project/Gemfile")
536
+ assert_match_in_file(/gem 'test-spec'.*?:require => 'test\/spec'/, "#{@apptmp}/sample_project/Gemfile")
502
537
  assert_match_in_file(/PADRINO_ENV = 'test' unless defined\?\(PADRINO_ENV\)/, "#{@apptmp}/sample_project/test/test_config.rb")
503
538
  assert_match_in_file(/Test::Unit::TestCase/, "#{@apptmp}/sample_project/test/test_config.rb")
504
- assert_match_in_file(/gem 'test-spec'.*?:require => "test\/spec"/, "#{@apptmp}/sample_project/Gemfile")
539
+ assert_match_in_file(/gem 'test-spec'.*?:require => 'test\/spec'/, "#{@apptmp}/sample_project/Gemfile")
505
540
  assert_file_exists("#{@apptmp}/sample_project/test/test.rake")
506
541
  assert_match_in_file(/Rake::TestTask\.new\("test:\#/,"#{@apptmp}/sample_project/test/test.rake")
507
542
  assert_match_in_file(/task 'test' => test_tasks/,"#{@apptmp}/sample_project/test/test.rake")
@@ -511,8 +546,8 @@ describe "ProjectGenerator" do
511
546
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--test=cucumber', '--script=none') }
512
547
  assert_match(/applying.*?cucumber.*?test/, out)
513
548
  assert_match_in_file(/gem 'rack-test'/, "#{@apptmp}/sample_project/Gemfile")
514
- assert_match_in_file(/:require => "rack\/test"/, "#{@apptmp}/sample_project/Gemfile")
515
- assert_match_in_file(/:group => "test"/, "#{@apptmp}/sample_project/Gemfile")
549
+ assert_match_in_file(/:require => 'rack\/test'/, "#{@apptmp}/sample_project/Gemfile")
550
+ assert_match_in_file(/:group => 'test'/, "#{@apptmp}/sample_project/Gemfile")
516
551
  assert_match_in_file(/gem 'rspec'/, "#{@apptmp}/sample_project/Gemfile")
517
552
  assert_match_in_file(/gem 'cucumber'/, "#{@apptmp}/sample_project/Gemfile")
518
553
  assert_match_in_file(/PADRINO_ENV = 'test' unless defined\?\(PADRINO_ENV\)/, "#{@apptmp}/sample_project/spec/spec_helper.rb")
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.10.7
5
- prerelease:
4
+ version: 0.11.0
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: 2012-06-20 00:00:00.000000000 Z
14
+ date: 2013-03-22 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.10.7
22
+ version: 0.11.0
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.10.7
29
+ version: 0.11.0
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
@@ -74,7 +69,7 @@ files:
74
69
  - lib/padrino-gen/generators/components/orms/activerecord.rb
75
70
  - lib/padrino-gen/generators/components/orms/couchrest.rb
76
71
  - lib/padrino-gen/generators/components/orms/datamapper.rb
77
- - lib/padrino-gen/generators/components/orms/mini_record.rb
72
+ - lib/padrino-gen/generators/components/orms/minirecord.rb
78
73
  - lib/padrino-gen/generators/components/orms/mongoid.rb
79
74
  - lib/padrino-gen/generators/components/orms/mongomapper.rb
80
75
  - lib/padrino-gen/generators/components/orms/mongomatic.rb
@@ -117,15 +112,21 @@ files:
117
112
  - lib/padrino-gen/generators/project/public/favicon.ico
118
113
  - lib/padrino-gen/generators/runner.rb
119
114
  - lib/padrino-gen/generators/templates/Gemfile.tt
115
+ - lib/padrino-gen/generators/templates/Rakefile.tt
120
116
  - lib/padrino-gen/generators/templates/controller.rb.tt
117
+ - lib/padrino-gen/generators/templates/gem/README.md.tt
118
+ - lib/padrino-gen/generators/templates/gem/gemspec.tt
119
+ - lib/padrino-gen/generators/templates/gem/lib/libname.tt
120
+ - lib/padrino-gen/generators/templates/gem/lib/libname/version.tt
121
121
  - lib/padrino-gen/generators/templates/helper.rb.tt
122
122
  - lib/padrino-gen/generators/templates/initializer.rb.tt
123
123
  - lib/padrino-gen/generators/templates/mailer.rb.tt
124
124
  - lib/padrino-gen/padrino-tasks/activerecord.rb
125
+ - lib/padrino-gen/padrino-tasks/database.rb
125
126
  - lib/padrino-gen/padrino-tasks/datamapper.rb
127
+ - lib/padrino-gen/padrino-tasks/minirecord.rb
126
128
  - lib/padrino-gen/padrino-tasks/mongoid.rb
127
129
  - lib/padrino-gen/padrino-tasks/mongomapper.rb
128
- - lib/padrino-gen/padrino-tasks/seed.rb
129
130
  - lib/padrino-gen/padrino-tasks/sequel.rb
130
131
  - padrino-gen.gemspec
131
132
  - test/fixtures/admin_template.rb
@@ -159,28 +160,27 @@ files:
159
160
  - lib/padrino-gen/generators/templates/static/ujs/right.js
160
161
  homepage: http://www.padrinorb.com
161
162
  licenses: []
163
+ metadata: {}
162
164
  post_install_message:
163
165
  rdoc_options:
164
166
  - --charset=UTF-8
165
167
  require_paths:
166
168
  - lib
167
169
  required_ruby_version: !ruby/object:Gem::Requirement
168
- none: false
169
170
  requirements:
170
- - - ! '>='
171
+ - - '>='
171
172
  - !ruby/object:Gem::Version
172
173
  version: '0'
173
174
  required_rubygems_version: !ruby/object:Gem::Requirement
174
- none: false
175
175
  requirements:
176
- - - ! '>='
176
+ - - '>='
177
177
  - !ruby/object:Gem::Version
178
178
  version: 1.3.6
179
179
  requirements: []
180
180
  rubyforge_project: padrino-gen
181
- rubygems_version: 1.8.21
181
+ rubygems_version: 2.0.3
182
182
  signing_key:
183
- specification_version: 3
183
+ specification_version: 4
184
184
  summary: Generators for easily creating and building padrino applications
185
185
  test_files:
186
186
  - test/fixtures/admin_template.rb
@@ -1,5 +0,0 @@
1
- desc 'Load the seed data from db/seeds.rb'
2
- task :seed => :environment do
3
- seed_file = Padrino.root('db', 'seeds.rb')
4
- load(seed_file) if File.exist?(seed_file)
5
- end