merb-gen 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README +6 -3
- data/Rakefile +6 -4
- data/bin/merb-gen +1 -23
- data/lib/generators/controller.rb +4 -2
- data/lib/generators/helper.rb +0 -5
- data/lib/generators/merb/merb_core.rb +95 -0
- data/lib/generators/merb/merb_flat.rb +70 -69
- data/lib/generators/merb/merb_stack.rb +110 -0
- data/lib/generators/merb/merb_very_flat.rb +61 -64
- data/lib/generators/merb_plugin.rb +5 -0
- data/lib/generators/model.rb +5 -2
- data/lib/generators/resource.rb +7 -2
- data/lib/generators/resource_controller.rb +4 -4
- data/lib/generators/templates/application/common/Rakefile +2 -6
- data/lib/generators/templates/application/common/doc.thor +149 -0
- data/lib/generators/templates/application/common/dothtaccess +17 -0
- data/lib/generators/templates/application/common/jquery.js +32 -0
- data/lib/generators/templates/application/common/merb.thor +1550 -861
- data/lib/generators/templates/application/{merb → merb_core}/app/controllers/application.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/app/controllers/exceptions.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/app/helpers/global_helpers.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/app/views/exceptions/internal_server_error.html.erb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/app/views/exceptions/not_acceptable.html.erb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/app/views/exceptions/not_found.html.erb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/autotest/discover.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/autotest/merb.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/autotest/merb_rspec.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/config/environments/development.rb +7 -2
- data/lib/generators/templates/application/{merb → merb_core}/config/environments/production.rb +5 -2
- data/lib/generators/templates/application/{merb → merb_core}/config/environments/rake.rb +6 -2
- data/lib/generators/templates/application/merb_core/config/environments/staging.rb +10 -0
- data/lib/generators/templates/application/merb_core/config/environments/test.rb +12 -0
- data/lib/generators/templates/application/{merb → merb_core}/config/init.rb +6 -6
- data/lib/generators/templates/application/{merb → merb_core}/config/rack.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/config/router.rb +0 -0
- data/lib/generators/templates/application/merb_core/doc/rdoc/generators/merb_generator.rb +1362 -0
- data/lib/generators/templates/application/merb_core/doc/rdoc/generators/template/merb/api_grease.js +640 -0
- data/lib/generators/templates/application/merb_core/doc/rdoc/generators/template/merb/index.html.erb +37 -0
- data/lib/generators/templates/application/merb_core/doc/rdoc/generators/template/merb/merb.css +252 -0
- data/lib/generators/templates/application/merb_core/doc/rdoc/generators/template/merb/merb.rb +351 -0
- data/lib/generators/templates/application/merb_core/doc/rdoc/generators/template/merb/merb_doc_styles.css +492 -0
- data/lib/generators/templates/application/merb_core/doc/rdoc/generators/template/merb/prototype.js +2515 -0
- data/lib/generators/templates/application/{merb/app/models → merb_core/lib}/merb/session.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/public/favicon.ico +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/public/images/merb.jpg +0 -0
- data/lib/generators/templates/application/merb_core/public/javascripts/application.js +1 -0
- data/lib/generators/templates/application/{merb → merb_core}/public/merb.fcgi +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/public/robots.txt +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/public/stylesheets/master.css +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/spec/spec.opts +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/spec/spec_helper.rb +0 -0
- data/lib/generators/templates/application/{merb → merb_core}/test/test_helper.rb +0 -0
- data/lib/generators/templates/application/merb_flat/application.rbt +1 -1
- data/lib/generators/templates/application/merb_flat/config/init.rb +8 -3
- data/lib/generators/templates/application/merb_plugin/LICENSE +1 -1
- data/lib/generators/templates/application/merb_stack/app/controllers/application.rb +2 -0
- data/lib/generators/templates/application/merb_stack/app/controllers/exceptions.rb +13 -0
- data/lib/generators/templates/application/merb_stack/app/helpers/global_helpers.rb +5 -0
- data/lib/generators/templates/application/merb_stack/app/models/user.rb +17 -0
- data/lib/generators/templates/application/merb_stack/app/views/exceptions/internal_server_error.html.erb +216 -0
- data/lib/generators/templates/application/merb_stack/app/views/exceptions/not_acceptable.html.erb +63 -0
- data/lib/generators/templates/application/merb_stack/app/views/exceptions/not_found.html.erb +47 -0
- data/lib/generators/templates/application/merb_stack/autotest/discover.rb +1 -0
- data/lib/generators/templates/application/merb_stack/autotest/merb.rb +149 -0
- data/lib/generators/templates/application/merb_stack/autotest/merb_rspec.rb +165 -0
- data/lib/generators/templates/application/merb_stack/config/database.yml +33 -0
- data/lib/generators/templates/application/merb_stack/config/dependencies.rb +15 -0
- data/lib/generators/templates/application/merb_stack/config/environments/development.rb +15 -0
- data/lib/generators/templates/application/merb_stack/config/environments/production.rb +10 -0
- data/lib/generators/templates/application/merb_stack/config/environments/rake.rb +11 -0
- data/lib/generators/templates/application/merb_stack/config/environments/staging.rb +10 -0
- data/lib/generators/templates/application/merb_stack/config/environments/test.rb +12 -0
- data/lib/generators/templates/application/merb_stack/config/init.rb +24 -0
- data/lib/generators/templates/application/merb_stack/config/rack.rb +12 -0
- data/lib/generators/templates/application/merb_stack/config/router.rb +44 -0
- data/lib/generators/templates/application/merb_stack/doc/rdoc/generators/merb_generator.rb +1362 -0
- data/lib/generators/templates/application/merb_stack/doc/rdoc/generators/template/merb/api_grease.js +640 -0
- data/lib/generators/templates/application/merb_stack/doc/rdoc/generators/template/merb/index.html.erb +37 -0
- data/lib/generators/templates/application/merb_stack/doc/rdoc/generators/template/merb/merb.css +252 -0
- data/lib/generators/templates/application/merb_stack/doc/rdoc/generators/template/merb/merb.rb +351 -0
- data/lib/generators/templates/application/merb_stack/doc/rdoc/generators/template/merb/merb_doc_styles.css +492 -0
- data/lib/generators/templates/application/merb_stack/doc/rdoc/generators/template/merb/prototype.js +2515 -0
- data/lib/generators/templates/application/merb_stack/merb/merb-auth/setup.rb +44 -0
- data/lib/generators/templates/application/merb_stack/merb/merb-auth/strategies.rb +11 -0
- data/lib/generators/templates/application/merb_stack/merb/session/session.rb +9 -0
- data/lib/generators/templates/application/merb_stack/public/favicon.ico +0 -0
- data/lib/generators/templates/application/merb_stack/public/images/merb.jpg +0 -0
- data/lib/generators/templates/application/merb_stack/public/javascripts/application.js +1 -0
- data/lib/generators/templates/application/merb_stack/public/merb.fcgi +22 -0
- data/lib/generators/templates/application/merb_stack/public/robots.txt +5 -0
- data/lib/generators/templates/application/merb_stack/public/stylesheets/master.css +119 -0
- data/lib/generators/templates/application/merb_stack/spec/spec.opts +0 -0
- data/lib/generators/templates/application/merb_stack/spec/spec_helper.rb +20 -0
- data/lib/generators/templates/application/merb_stack/test/test_helper.rb +19 -0
- data/lib/generators/templates/application/merb_very_flat/application.rbt +11 -5
- data/lib/generators/templates/component/layout/app/views/layout/%file_name%.html.erb +1 -0
- data/lib/generators/templates/component/resource_controller/spec/requests/%file_name%_spec.rb +53 -0
- data/lib/merb-gen/app_generator.rb +13 -0
- data/lib/merb-gen/generator.rb +36 -1
- data/lib/merb-gen/named_generator.rb +5 -2
- data/lib/merb-gen.rb +6 -8
- data/spec/controller_spec.rb +0 -20
- data/spec/{merb_full_spec.rb → merb_core_spec.rb} +11 -3
- data/spec/merb_stack_spec.rb +47 -0
- data/spec/part_controller_spec.rb +0 -39
- data/spec/resource_controller_spec.rb +1 -35
- data/spec/spec_helper.rb +4 -2
- metadata +133 -111
- data/lib/generators/merb/merb_full.rb +0 -85
- data/lib/generators/merb.rb +0 -24
- data/lib/generators/templates/application/merb/config/environments/staging.rb +0 -7
- data/lib/generators/templates/application/merb/config/environments/test.rb +0 -7
- data/lib/generators/templates/component/helper/spec/helpers/%file_name%_helper_spec.rb +0 -5
- data/lib/generators/templates/component/resource_controller/spec/controllers/%file_name%_spec.rb +0 -7
- data/spec/helper_spec.rb +0 -43
- data/spec/merb_spec.rb +0 -20
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/generators/templates/application/{merb → merb_core}/app/views/exceptions/not_found.html.erb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/generators/templates/application/{merb → merb_core}/config/environments/development.rb
RENAMED
@@ -4,7 +4,12 @@ Merb::Config.use { |c|
|
|
4
4
|
c[:reload_templates] = true
|
5
5
|
c[:reload_classes] = true
|
6
6
|
c[:reload_time] = 0.5
|
7
|
-
c[:log_auto_flush ] = true
|
8
7
|
c[:ignore_tampered_cookies] = true
|
8
|
+
c[:log_auto_flush ] = true
|
9
9
|
c[:log_level] = :debug
|
10
|
-
|
10
|
+
|
11
|
+
c[:log_stream] = STDOUT
|
12
|
+
c[:log_file] = nil
|
13
|
+
# Or redirect logging into a file:
|
14
|
+
# c[:log_file] = Merb.root / "log" / "development.log"
|
15
|
+
}
|
data/lib/generators/templates/application/{merb → merb_core}/config/environments/production.rb
RENAMED
@@ -3,5 +3,8 @@ Merb::Config.use { |c|
|
|
3
3
|
c[:exception_details] = false
|
4
4
|
c[:reload_classes] = false
|
5
5
|
c[:log_level] = :error
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
c[:log_file] = Merb.root / "log" / "production.log"
|
8
|
+
# or redirect logger using IO handle
|
9
|
+
# c[:log_stream] = STDOUT
|
10
|
+
}
|
@@ -3,5 +3,9 @@ Merb::Config.use { |c|
|
|
3
3
|
c[:exception_details] = true
|
4
4
|
c[:reload_classes] = false
|
5
5
|
c[:log_auto_flush ] = true
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
c[:log_stream] = STDOUT
|
8
|
+
c[:log_file] = nil
|
9
|
+
# Or redirect logging into a file:
|
10
|
+
# c[:log_file] = Merb.root / "log" / "development.log"
|
11
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Merb.logger.info("Loaded STAGING Environment...")
|
2
|
+
Merb::Config.use { |c|
|
3
|
+
c[:exception_details] = false
|
4
|
+
c[:reload_classes] = false
|
5
|
+
c[:log_level] = :error
|
6
|
+
|
7
|
+
c[:log_file] = Merb.root / "log" / "staging.log"
|
8
|
+
# or redirect logger using IO handle
|
9
|
+
# c[:log_stream] = STDOUT
|
10
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Merb.logger.info("Loaded TEST Environment...")
|
2
|
+
Merb::Config.use { |c|
|
3
|
+
c[:testing] = true
|
4
|
+
c[:exception_details] = true
|
5
|
+
c[:log_auto_flush ] = true
|
6
|
+
# log less in testing environment
|
7
|
+
c[:log_level] = :error
|
8
|
+
|
9
|
+
c[:log_file] = Merb.root / "log" / "test.log"
|
10
|
+
# or redirect logger using IO handle
|
11
|
+
# c[:log_stream] = STDOUT
|
12
|
+
}
|
@@ -150,22 +150,22 @@ end
|
|
150
150
|
# ==== Tune your inflector
|
151
151
|
|
152
152
|
# To fine tune your inflector use the word, singular_word and plural_word
|
153
|
-
# methods of
|
153
|
+
# methods of Extlib::Inflection module metaclass.
|
154
154
|
#
|
155
155
|
# Here we define erratum/errata exception case:
|
156
156
|
#
|
157
|
-
#
|
157
|
+
# Extlib::Inflection.word "erratum", "errata"
|
158
158
|
#
|
159
159
|
# In case singular and plural forms are the same omit
|
160
160
|
# second argument on call:
|
161
161
|
#
|
162
|
-
#
|
162
|
+
# Extlib::Inflection.word 'information'
|
163
163
|
#
|
164
164
|
# You can also define general, singularization and pluralization
|
165
165
|
# rules:
|
166
166
|
#
|
167
167
|
# Once the following rule is defined:
|
168
|
-
#
|
168
|
+
# Extlib::Inflection.rule 'y', 'ies'
|
169
169
|
#
|
170
170
|
# You can see the following results:
|
171
171
|
# irb> "fly".plural
|
@@ -175,14 +175,14 @@ end
|
|
175
175
|
#
|
176
176
|
# Example for singularization rule:
|
177
177
|
#
|
178
|
-
#
|
178
|
+
# Extlib::Inflection.singular_rule 'o', 'oes'
|
179
179
|
#
|
180
180
|
# Works like this:
|
181
181
|
# irb> "heroes".singular
|
182
182
|
# => hero
|
183
183
|
#
|
184
184
|
# Example of pluralization rule:
|
185
|
-
#
|
185
|
+
# Extlib::Inflection.singular_rule 'fe', 'ves'
|
186
186
|
#
|
187
187
|
# And the result is:
|
188
188
|
# irb> "wife".plural
|
File without changes
|
File without changes
|