padrino-gen 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/README.rdoc +29 -28
  2. data/VERSION +1 -1
  3. data/lib/padrino-gen/generators/actions.rb +3 -3
  4. data/lib/padrino-gen/generators/app/app.rb.tt +5 -6
  5. data/lib/padrino-gen/generators/app.rb +6 -8
  6. data/lib/padrino-gen/generators/cli.rb +2 -2
  7. data/lib/padrino-gen/generators/components/actions.rb +6 -6
  8. data/lib/padrino-gen/generators/components/mocks/mocha_gen.rb +1 -1
  9. data/lib/padrino-gen/generators/components/mocks/rr_gen.rb +2 -2
  10. data/lib/padrino-gen/generators/components/orms/activerecord_gen.rb +6 -7
  11. data/lib/padrino-gen/generators/components/orms/couchrest_gen.rb +6 -6
  12. data/lib/padrino-gen/generators/components/orms/datamapper_gen.rb +5 -6
  13. data/lib/padrino-gen/generators/components/orms/mongoid_gen.rb +7 -8
  14. data/lib/padrino-gen/generators/components/orms/mongomapper_gen.rb +5 -6
  15. data/lib/padrino-gen/generators/components/orms/sequel_gen.rb +5 -6
  16. data/lib/padrino-gen/generators/components/renderers/erb_gen.rb +5 -5
  17. data/lib/padrino-gen/generators/components/renderers/haml_gen.rb +5 -28
  18. data/lib/padrino-gen/generators/components/scripts/jquery_gen.rb +6 -7
  19. data/lib/padrino-gen/generators/components/scripts/mootools_gen.rb +6 -7
  20. data/lib/padrino-gen/generators/components/scripts/prototype_gen.rb +6 -7
  21. data/lib/padrino-gen/generators/components/scripts/rightjs_gen.rb +6 -6
  22. data/lib/padrino-gen/generators/components/stylesheets/less_gen.rb +43 -0
  23. data/lib/padrino-gen/generators/components/stylesheets/sass_gen.rb +35 -0
  24. data/lib/padrino-gen/generators/components/tests/bacon_test_gen.rb +6 -8
  25. data/lib/padrino-gen/generators/components/tests/cucumber_test_gen.rb +9 -8
  26. data/lib/padrino-gen/generators/components/tests/riot_test_gen.rb +7 -9
  27. data/lib/padrino-gen/generators/components/tests/rspec_test_gen.rb +6 -7
  28. data/lib/padrino-gen/generators/components/tests/shoulda_test_gen.rb +6 -8
  29. data/lib/padrino-gen/generators/components/tests/testspec_test_gen.rb +6 -8
  30. data/lib/padrino-gen/generators/controller.rb +3 -4
  31. data/lib/padrino-gen/generators/mailer.rb +4 -4
  32. data/lib/padrino-gen/generators/migration.rb +3 -4
  33. data/lib/padrino-gen/generators/model.rb +3 -3
  34. data/lib/padrino-gen/generators/project/config/apps.rb.tt +1 -1
  35. data/lib/padrino-gen/generators/project.rb +11 -9
  36. data/lib/padrino-gen/generators/templates/Gemfile.tt +2 -1
  37. data/lib/padrino-gen/generators/templates/controller.rb.tt +1 -1
  38. data/lib/padrino-gen/generators/templates/mailer_initializer.rb.tt +1 -1
  39. data/lib/padrino-gen/padrino-tasks/activerecord.rb +8 -8
  40. data/lib/padrino-gen/padrino-tasks/datamapper.rb +1 -1
  41. data/lib/padrino-gen.rb +12 -12
  42. data/padrino-gen.gemspec +7 -11
  43. data/test/helper.rb +3 -3
  44. data/test/test_app_generator.rb +1 -1
  45. data/test/test_mailer_generator.rb +3 -1
  46. data/test/test_migration_generator.rb +5 -5
  47. data/test/test_model_generator.rb +7 -7
  48. data/test/test_project_generator.rb +27 -8
  49. metadata +7 -11
  50. data/lib/padrino-gen/generators/project/app/.empty_directory +0 -0
  51. data/lib/padrino-gen/generators/project/app/app.rb.tt +0 -37
  52. data/lib/padrino-gen/generators/project/app/controllers/.empty_directory +0 -0
  53. data/lib/padrino-gen/generators/project/app/helpers/.empty_directory +0 -0
  54. data/lib/padrino-gen/generators/project/app/views/.empty_directory +0 -0
  55. data/lib/padrino-gen/generators/project/app/views/layouts/.emptydirectory +0 -0
@@ -46,7 +46,7 @@ class TestProjectGenerator < Test::Unit::TestCase
46
46
  end
47
47
 
48
48
  should "create components file containing options chosen" do
49
- component_options = ['--orm=datamapper', '--test=riot', '--mock=mocha', '--script=prototype', '--renderer=erb']
49
+ component_options = ['--orm=datamapper', '--test=riot', '--mock=mocha', '--script=prototype', '--renderer=erb', '--stylesheet=less']
50
50
  silence_logger { @project.start(['sample_project', '--root=/tmp', *component_options]) }
51
51
  components_chosen = YAML.load_file('/tmp/sample_project/.components')
52
52
  assert_equal 'datamapper', components_chosen[:orm]
@@ -54,16 +54,18 @@ class TestProjectGenerator < Test::Unit::TestCase
54
54
  assert_equal 'mocha', components_chosen[:mock]
55
55
  assert_equal 'prototype', components_chosen[:script]
56
56
  assert_equal 'erb', components_chosen[:renderer]
57
+ assert_equal 'less', components_chosen[:stylesheet]
57
58
  end
58
59
 
59
60
  should "output to log components being applied" do
60
- component_options = ['--orm=datamapper', '--test=riot', '--mock=mocha', '--script=prototype', '--renderer=erb']
61
+ component_options = ['--orm=datamapper', '--test=riot', '--mock=mocha', '--script=prototype', '--renderer=erb','--stylesheet=less']
61
62
  buffer = silence_logger { @project.start(['sample_project', '--root=/tmp', *component_options]) }
62
63
  assert_match /Applying.*?datamapper.*?orm/, buffer
63
64
  assert_match /Applying.*?riot.*?test/, buffer
64
65
  assert_match /Applying.*?mocha.*?mock/, buffer
65
66
  assert_match /Applying.*?prototype.*?script/, buffer
66
67
  assert_match /Applying.*?erb.*?renderer/, buffer
68
+ assert_match /Applying.*?less.*?stylesheet/, buffer
67
69
  end
68
70
 
69
71
  should "output gem files for base app" do
@@ -75,11 +77,11 @@ class TestProjectGenerator < Test::Unit::TestCase
75
77
  end
76
78
 
77
79
  context "a generator for mock component" do
78
- should "properly generate for rr" do
80
+ should "properly generate for rr and riot" do
79
81
  buffer = silence_logger { @project.start(['sample_project', '--root=/tmp', '--mock=rr', '--test=riot', '--script=none']) }
80
82
  assert_match /Applying.*?rr.*?mock/, buffer
81
83
  assert_match_in_file(/gem 'rr'/, '/tmp/sample_project/Gemfile')
82
- assert_match_in_file(/Riot.rr/m, '/tmp/sample_project/test/test_config.rb')
84
+ assert_match_in_file(/require 'riot\/rr'/m, '/tmp/sample_project/test/test_config.rb')
83
85
  end
84
86
 
85
87
  should "properly generater for rr and bacon" do
@@ -159,9 +161,6 @@ class TestProjectGenerator < Test::Unit::TestCase
159
161
  buffer = silence_logger { @project.start(['sample_project', '--root=/tmp', '--renderer=haml','--script=none']) }
160
162
  assert_match /Applying.*?haml.*?renderer/, buffer
161
163
  assert_match_in_file(/gem 'haml'/, '/tmp/sample_project/Gemfile')
162
- assert_match_in_file(/module SassInitializer.*Sass::Plugin::Rack/m, '/tmp/sample_project/lib/sass.rb')
163
- assert_match_in_file(/register SassInitializer/m, '/tmp/sample_project/app/app.rb')
164
- assert_dir_exists('/tmp/sample_project/app/stylesheets')
165
164
  end
166
165
  end
167
166
 
@@ -172,7 +171,7 @@ class TestProjectGenerator < Test::Unit::TestCase
172
171
  assert_file_exists('/tmp/sample_project/public/javascripts/jquery.js')
173
172
  assert_file_exists('/tmp/sample_project/public/javascripts/application.js')
174
173
  end
175
-
174
+
176
175
  should "properly generate for mootools" do
177
176
  buffer = silence_logger { @project.start(['sample_project', '--root=/tmp', '--script=mootools']) }
178
177
  assert_match /Applying.*?mootools.*?script/, buffer
@@ -258,4 +257,24 @@ class TestProjectGenerator < Test::Unit::TestCase
258
257
  assert_file_exists('/tmp/sample_project/features/step_definitions/add_steps.rb')
259
258
  end
260
259
  end
260
+
261
+ context "the generator for stylesheet component" do
262
+ should "properly generate for sass" do
263
+ buffer = silence_logger { @project.start(['sample_project', '--root=/tmp', '--renderer=haml','--script=none','--stylesheet=sass']) }
264
+ assert_match_in_file(/gem 'haml'/, '/tmp/sample_project/Gemfile')
265
+ assert_match_in_file(/module SassInitializer.*Sass::Plugin::Rack/m, '/tmp/sample_project/lib/sass.rb')
266
+ assert_match_in_file(/register SassInitializer/m, '/tmp/sample_project/app/app.rb')
267
+ assert_dir_exists('/tmp/sample_project/app/stylesheets')
268
+ end
269
+
270
+ should "properly generate for less" do
271
+ buffer = silence_logger { @project.start(['sample_project', '--root=/tmp', '--renderer=haml','--script=none','--stylesheet=less']) }
272
+ assert_match_in_file(/gem 'less'/, '/tmp/sample_project/Gemfile')
273
+ assert_match_in_file(/gem 'rack-less'/, '/tmp/sample_project/Gemfile')
274
+ assert_match_in_file(/module LessInitializer.*Rack::Less/m, '/tmp/sample_project/lib/less.rb')
275
+ assert_match_in_file(/register LessInitializer/m, '/tmp/sample_project/app/app.rb')
276
+ assert_dir_exists('/tmp/sample_project/app/stylesheets')
277
+ end
278
+ end
279
+
261
280
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 6
9
- version: 0.9.6
8
+ - 7
9
+ version: 0.9.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Padrino Team
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-03-15 00:00:00 -07:00
20
+ date: 2010-03-22 00:00:00 -07:00
21
21
  default_executable: padrino-gen
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -30,8 +30,8 @@ dependencies:
30
30
  segments:
31
31
  - 0
32
32
  - 9
33
- - 6
34
- version: 0.9.6
33
+ - 7
34
+ version: 0.9.7
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -157,6 +157,8 @@ files:
157
157
  - lib/padrino-gen/generators/components/scripts/mootools_gen.rb
158
158
  - lib/padrino-gen/generators/components/scripts/prototype_gen.rb
159
159
  - lib/padrino-gen/generators/components/scripts/rightjs_gen.rb
160
+ - lib/padrino-gen/generators/components/stylesheets/less_gen.rb
161
+ - lib/padrino-gen/generators/components/stylesheets/sass_gen.rb
160
162
  - lib/padrino-gen/generators/components/tests/bacon_test_gen.rb
161
163
  - lib/padrino-gen/generators/components/tests/cucumber_test_gen.rb
162
164
  - lib/padrino-gen/generators/components/tests/riot_test_gen.rb
@@ -169,12 +171,6 @@ files:
169
171
  - lib/padrino-gen/generators/model.rb
170
172
  - lib/padrino-gen/generators/project.rb
171
173
  - lib/padrino-gen/generators/project/.gitignore
172
- - lib/padrino-gen/generators/project/app/.empty_directory
173
- - lib/padrino-gen/generators/project/app/app.rb.tt
174
- - lib/padrino-gen/generators/project/app/controllers/.empty_directory
175
- - lib/padrino-gen/generators/project/app/helpers/.empty_directory
176
- - lib/padrino-gen/generators/project/app/views/.empty_directory
177
- - lib/padrino-gen/generators/project/app/views/layouts/.emptydirectory
178
174
  - lib/padrino-gen/generators/project/config.ru
179
175
  - lib/padrino-gen/generators/project/config/apps.rb.tt
180
176
  - lib/padrino-gen/generators/project/config/boot.rb
@@ -1,37 +0,0 @@
1
- class <%= @class_name %> < Padrino::Application
2
- configure do
3
- ##
4
- # Application-specific configuration options
5
- #
6
- register MailerInitializer if defined?(MailerInitializer) # Remove this if your not using mailer
7
- # set :raise_errors, true # Show exceptions (default for development)
8
- # set :public, "foo/bar" # Location for static assets (default root/public)
9
- # set :sessions, false # Enabled by default
10
- # set :reload, false # Reload application files (default in development)
11
- # set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder')
12
- # set :locale_path, "bar" # Set path for I18n translations (default your_app/locales)
13
- # disable :padrino_helpers # Disables padrino markup helpers (enabled by default if present)
14
- # disable :padrino_mailer # Disables padrino mailer (enabled by default if present)
15
- # disable :flash # Disables rack-flash (enabled by default)
16
- # enable :authentication # Enable padrino-admin authentication (disabled by default)
17
- # layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
18
- #
19
- end
20
-
21
- ##
22
- # You can configure for a specified environment like:
23
- #
24
- # configure :development do
25
- # set :foo, :bar
26
- # end
27
- #
28
-
29
- ##
30
- # You can manage errors like:
31
- #
32
- # errors 404 do
33
- # render 'errors/404'
34
- # end
35
- #
36
-
37
- end