merb 0.5.3 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +0 -20
- data/README +0 -277
- data/Rakefile +80 -199
- data/TODO +0 -3
- metadata +19 -438
- data/SVN_REVISION +0 -1
- data/app_generators/merb/USAGE +0 -5
- data/app_generators/merb/merb_generator.rb +0 -108
- data/app_generators/merb/templates/Rakefile +0 -124
- data/app_generators/merb/templates/app/controllers/application.rb +0 -3
- data/app_generators/merb/templates/app/controllers/exceptions.rb +0 -13
- data/app_generators/merb/templates/app/helpers/global_helper.rb +0 -5
- data/app_generators/merb/templates/app/mailers/views/layout/application.html.erb +0 -1
- data/app_generators/merb/templates/app/mailers/views/layout/application.text.erb +0 -1
- data/app_generators/merb/templates/app/parts/views/layout/application.html.erb +0 -1
- data/app_generators/merb/templates/app/views/exceptions/internal_server_error.html.erb +0 -216
- data/app_generators/merb/templates/app/views/exceptions/not_acceptable.html.erb +0 -38
- data/app_generators/merb/templates/app/views/exceptions/not_found.html.erb +0 -40
- data/app_generators/merb/templates/app/views/layout/application.html.erb +0 -11
- data/app_generators/merb/templates/config/boot.rb +0 -11
- data/app_generators/merb/templates/config/dependencies.rb +0 -41
- data/app_generators/merb/templates/config/environments/development.rb +0 -1
- data/app_generators/merb/templates/config/environments/production.rb +0 -1
- data/app_generators/merb/templates/config/environments/test.rb +0 -1
- data/app_generators/merb/templates/config/merb.yml +0 -82
- data/app_generators/merb/templates/config/merb_init.rb +0 -17
- data/app_generators/merb/templates/config/plugins.yml +0 -1
- data/app_generators/merb/templates/config/router.rb +0 -35
- data/app_generators/merb/templates/config/upload.conf +0 -0
- data/app_generators/merb/templates/public/images/merb.jpg +0 -0
- data/app_generators/merb/templates/public/merb.fcgi +0 -6
- data/app_generators/merb/templates/public/stylesheets/master.css +0 -119
- data/app_generators/merb/templates/script/destroy +0 -32
- data/app_generators/merb/templates/script/generate +0 -32
- data/app_generators/merb/templates/script/stop_merb +0 -13
- data/app_generators/merb/templates/script/win_script.cmd +0 -1
- data/app_generators/merb/templates/spec/spec.opts +0 -6
- data/app_generators/merb/templates/spec/spec_helper.rb +0 -15
- data/app_generators/merb/templates/test/test_helper.rb +0 -14
- data/app_generators/merb_plugin/USAGE +0 -5
- data/app_generators/merb_plugin/merb_plugin_generator.rb +0 -68
- data/app_generators/merb_plugin/templates/LICENSE +0 -20
- data/app_generators/merb_plugin/templates/README +0 -4
- data/app_generators/merb_plugin/templates/Rakefile +0 -35
- data/app_generators/merb_plugin/templates/TODO +0 -5
- data/app_generators/merb_plugin/templates/merbtasks.rb +0 -6
- data/app_generators/merb_plugin/templates/sampleplugin.rb +0 -10
- data/app_generators/merb_plugin/templates/sampleplugin_spec.rb +0 -7
- data/app_generators/merb_plugin/templates/spec_helper.rb +0 -2
- data/bin/merb +0 -4
- data/lib/autotest/discover.rb +0 -3
- data/lib/autotest/merb_rspec.rb +0 -80
- data/lib/merb.rb +0 -188
- data/lib/merb/abstract_controller.rb +0 -399
- data/lib/merb/assets.rb +0 -160
- data/lib/merb/assets.rb.orig +0 -119
- data/lib/merb/boot_loader.rb +0 -286
- data/lib/merb/boot_loader.rb.orig +0 -235
- data/lib/merb/caching.rb +0 -5
- data/lib/merb/caching/action_cache.rb +0 -92
- data/lib/merb/caching/fragment_cache.rb +0 -39
- data/lib/merb/caching/store/file_cache.rb +0 -90
- data/lib/merb/caching/store/memory_cache.rb +0 -85
- data/lib/merb/config.rb +0 -290
- data/lib/merb/constants.rb +0 -50
- data/lib/merb/controller.rb +0 -220
- data/lib/merb/cookies.rb +0 -95
- data/lib/merb/core_ext.rb +0 -15
- data/lib/merb/core_ext/array.rb +0 -0
- data/lib/merb/core_ext/class.rb +0 -180
- data/lib/merb/core_ext/enumerable.rb +0 -49
- data/lib/merb/core_ext/get_args.rb +0 -76
- data/lib/merb/core_ext/hash.rb +0 -306
- data/lib/merb/core_ext/inflections.rb +0 -112
- data/lib/merb/core_ext/inflector.rb +0 -275
- data/lib/merb/core_ext/kernel.rb +0 -242
- data/lib/merb/core_ext/mash.rb +0 -88
- data/lib/merb/core_ext/module.rb +0 -67
- data/lib/merb/core_ext/numeric.rb +0 -72
- data/lib/merb/core_ext/object.rb +0 -183
- data/lib/merb/core_ext/string.rb +0 -53
- data/lib/merb/core_ext/symbol.rb +0 -6
- data/lib/merb/dispatcher.rb +0 -109
- data/lib/merb/drb_server.rb +0 -19
- data/lib/merb/erubis_ext.rb +0 -10
- data/lib/merb/exceptions.rb +0 -192
- data/lib/merb/generators/merb_app/merb_app.rb +0 -22
- data/lib/merb/generators/merb_generator_helpers.rb +0 -318
- data/lib/merb/generators/merb_plugin.rb +0 -22
- data/lib/merb/logger.rb +0 -78
- data/lib/merb/mail_controller.rb +0 -268
- data/lib/merb/mailer.rb +0 -87
- data/lib/merb/mixins/basic_authentication.rb +0 -35
- data/lib/merb/mixins/controller.rb +0 -160
- data/lib/merb/mixins/erubis_capture.rb +0 -68
- data/lib/merb/mixins/general_controller.rb +0 -253
- data/lib/merb/mixins/inline_partial.rb +0 -32
- data/lib/merb/mixins/render.rb +0 -465
- data/lib/merb/mixins/responder.rb +0 -449
- data/lib/merb/mixins/view_context.rb +0 -558
- data/lib/merb/mixins/web_controller.rb +0 -36
- data/lib/merb/mongrel_handler.rb +0 -168
- data/lib/merb/part_controller.rb +0 -29
- data/lib/merb/plugins.rb +0 -16
- data/lib/merb/rack_adapter.rb +0 -37
- data/lib/merb/request.rb +0 -465
- data/lib/merb/router.rb +0 -646
- data/lib/merb/server.rb +0 -169
- data/lib/merb/session.rb +0 -23
- data/lib/merb/session/cookie_store.rb +0 -118
- data/lib/merb/session/mem_cache_session.rb +0 -131
- data/lib/merb/session/memory_session.rb +0 -176
- data/lib/merb/template.rb +0 -37
- data/lib/merb/template/erubis.rb +0 -68
- data/lib/merb/template/haml.rb +0 -87
- data/lib/merb/template/markaby.rb +0 -59
- data/lib/merb/template/xml_builder.rb +0 -50
- data/lib/merb/test/fake_request.rb +0 -74
- data/lib/merb/test/helper.rb +0 -260
- data/lib/merb/test/hpricot.rb +0 -136
- data/lib/merb/test/multipart.rb +0 -66
- data/lib/merb/test/rspec.rb +0 -18
- data/lib/merb/test/rspec_matchers/controller_matchers.rb +0 -117
- data/lib/merb/test/rspec_matchers/markup_matchers.rb +0 -98
- data/lib/merb/upload_handler.rb +0 -80
- data/lib/merb/upload_progress.rb +0 -48
- data/lib/merb/version.rb +0 -49
- data/lib/merb/view_context.rb +0 -79
- data/lib/tasks.rb +0 -7
- data/lib/tasks/merb.rake +0 -54
- data/merb_default_generators/model/USAGE +0 -0
- data/merb_default_generators/model/model_generator.rb +0 -16
- data/merb_default_generators/model/templates/new_model_template.erb +0 -5
- data/merb_default_generators/resource_controller/USAGE +0 -0
- data/merb_default_generators/resource_controller/resource_controller_generator.rb +0 -26
- data/merb_default_generators/resource_controller/templates/controller.rb +0 -30
- data/merb_default_generators/resource_controller/templates/edit.html.erb +0 -1
- data/merb_default_generators/resource_controller/templates/helper.rb +0 -5
- data/merb_default_generators/resource_controller/templates/index.html.erb +0 -1
- data/merb_default_generators/resource_controller/templates/new.html.erb +0 -1
- data/merb_default_generators/resource_controller/templates/show.html.erb +0 -1
- data/merb_generators/controller/USAGE +0 -5
- data/merb_generators/controller/controller_generator.rb +0 -16
- data/merb_generators/controller/templates/controller.rb +0 -8
- data/merb_generators/controller/templates/helper.rb +0 -5
- data/merb_generators/controller/templates/index.html.erb +0 -3
- data/merb_generators/part_controller/USAGE +0 -5
- data/merb_generators/part_controller/part_controller_generator.rb +0 -27
- data/merb_generators/part_controller/templates/controller.rb +0 -8
- data/merb_generators/part_controller/templates/helper.rb +0 -5
- data/merb_generators/part_controller/templates/index.html.erb +0 -3
- data/merb_generators/resource/USAGE +0 -0
- data/merb_generators/resource/resource_generator.rb +0 -67
- data/rspec_generators/merb_controller_test/merb_controller_test_generator.rb +0 -67
- data/rspec_generators/merb_controller_test/templates/controller_spec.rb +0 -8
- data/rspec_generators/merb_controller_test/templates/edit_spec.rb +0 -12
- data/rspec_generators/merb_controller_test/templates/helper_spec.rb +0 -5
- data/rspec_generators/merb_controller_test/templates/index_spec.rb +0 -12
- data/rspec_generators/merb_controller_test/templates/new_spec.rb +0 -12
- data/rspec_generators/merb_controller_test/templates/show_spec.rb +0 -5
- data/rspec_generators/merb_model_test/merb_model_test_generator.rb +0 -26
- data/rspec_generators/merb_model_test/templates/model_spec_template.erb +0 -7
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/spec/fixtures/config/environments/environment_config_test.yml +0 -1
- data/spec/fixtures/config/merb.yml +0 -18
- data/spec/fixtures/controllers/dispatch_spec_controllers.rb +0 -235
- data/spec/fixtures/controllers/render_spec_controllers.rb +0 -184
- data/spec/fixtures/foo.rb +0 -3
- data/spec/fixtures/mailers/views/layout/application.html.erb +0 -3
- data/spec/fixtures/mailers/views/layout/application.text.erb +0 -3
- data/spec/fixtures/mailers/views/test_mail_controller/eighth.html.erb +0 -1
- data/spec/fixtures/mailers/views/test_mail_controller/eighth.text.erb +0 -1
- data/spec/fixtures/mailers/views/test_mail_controller/first.html.erb +0 -1
- data/spec/fixtures/mailers/views/test_mail_controller/first.text.erb +0 -1
- data/spec/fixtures/mailers/views/test_mail_controller/ninth.html.erb +0 -1
- data/spec/fixtures/mailers/views/test_mail_controller/ninth.text.erb +0 -1
- data/spec/fixtures/mailers/views/test_mail_controller/second.text.erb +0 -1
- data/spec/fixtures/mailers/views/test_mail_controller/third.html.erb +0 -1
- data/spec/fixtures/models/router_spec_models.rb +0 -30
- data/spec/fixtures/parts/views/layout/todo_part.html.erb +0 -3
- data/spec/fixtures/parts/views/layout/todo_part.xml.erb +0 -3
- data/spec/fixtures/parts/views/todo_part/formatted_output.html.erb +0 -1
- data/spec/fixtures/parts/views/todo_part/formatted_output.js.erb +0 -1
- data/spec/fixtures/parts/views/todo_part/formatted_output.xml.erb +0 -1
- data/spec/fixtures/parts/views/todo_part/list.html.erb +0 -3
- data/spec/fixtures/sample.txt +0 -1
- data/spec/fixtures/views/erubis.html.erb +0 -1
- data/spec/fixtures/views/examples/_erubis.html.erb +0 -1
- data/spec/fixtures/views/examples/_haml.html.haml +0 -1
- data/spec/fixtures/views/examples/_markaby.html.mab +0 -1
- data/spec/fixtures/views/examples/_throw_content.html.erb +0 -6
- data/spec/fixtures/views/examples/hello.xml.builder +0 -1
- data/spec/fixtures/views/examples/js.js.erb +0 -1
- data/spec/fixtures/views/examples/template_catch_content.html.erb +0 -15
- data/spec/fixtures/views/examples/template_catch_content_from_partial.html.erb +0 -6
- data/spec/fixtures/views/examples/template_throw_content.html.erb +0 -10
- data/spec/fixtures/views/examples/template_throw_content_without_block.html.erb +0 -3
- data/spec/fixtures/views/exceptions/admin_access_required.html.erb +0 -1
- data/spec/fixtures/views/extension_template_controller/_nested_js.js.erb +0 -1
- data/spec/fixtures/views/extension_template_controller/_nested_xml.xml.erb +0 -1
- data/spec/fixtures/views/extension_template_controller/_render_partial_multiple_times.html.erb +0 -1
- data/spec/fixtures/views/extension_template_controller/erubis_templates.html.erb +0 -1
- data/spec/fixtures/views/extension_template_controller/erubis_templates.js.erb +0 -1
- data/spec/fixtures/views/extension_template_controller/erubis_templates.rhtml +0 -1
- data/spec/fixtures/views/extension_template_controller/erubis_templates.xml.erb +0 -1
- data/spec/fixtures/views/extension_template_controller/haml_index.html.haml +0 -0
- data/spec/fixtures/views/extension_template_controller/haml_templates.html.haml +0 -1
- data/spec/fixtures/views/extension_template_controller/haml_templates.js.haml +0 -1
- data/spec/fixtures/views/extension_template_controller/haml_templates.xml.haml +0 -1
- data/spec/fixtures/views/extension_template_controller/index.html.erb +0 -0
- data/spec/fixtures/views/extension_template_controller/markaby_index.html.mab +0 -0
- data/spec/fixtures/views/extension_template_controller/markaby_templates.html.mab +0 -1
- data/spec/fixtures/views/extension_template_controller/markaby_templates.js.mab +0 -1
- data/spec/fixtures/views/extension_template_controller/markaby_templates.xml.mab +0 -1
- data/spec/fixtures/views/extension_template_controller/render_multiple_partials.html.erb +0 -4
- data/spec/fixtures/views/extension_template_controller/render_nested_js.js.erb +0 -1
- data/spec/fixtures/views/extension_template_controller/render_nested_xml.xml.erb +0 -1
- data/spec/fixtures/views/haml.html.haml +0 -1
- data/spec/fixtures/views/haml.xml.haml +0 -2
- data/spec/fixtures/views/layout/application.html.erb +0 -1
- data/spec/fixtures/views/layout/application.xml.erb +0 -1
- data/spec/fixtures/views/layout/nested/example.html.erb +0 -1
- data/spec/fixtures/views/markaby.html.mab +0 -1
- data/spec/fixtures/views/nested/example/test.html.erb +0 -1
- data/spec/fixtures/views/partials/_erubis.html.erb +0 -1
- data/spec/fixtures/views/partials/_erubis_collection.html.erb +0 -1
- data/spec/fixtures/views/partials/_erubis_collection_with_locals.html.erb +0 -1
- data/spec/fixtures/views/partials/_erubis_new.html.erb +0 -1
- data/spec/fixtures/views/partials/_haml.html.haml +0 -1
- data/spec/fixtures/views/partials/_haml_collection.html.haml +0 -1
- data/spec/fixtures/views/partials/_haml_collection_with_locals.html.haml +0 -1
- data/spec/fixtures/views/partials/_haml_new.html.haml +0 -1
- data/spec/fixtures/views/partials/_markaby.html.mab +0 -1
- data/spec/fixtures/views/partials/_markaby_collection.html.mab +0 -1
- data/spec/fixtures/views/partials/_markaby_collection_with_locals.html.mab +0 -1
- data/spec/fixtures/views/partials/_markaby_new.html.mab +0 -1
- data/spec/fixtures/views/render_object_controller/render_object_with_template.html.erb +0 -1
- data/spec/fixtures/views/render_object_controller/render_object_with_template.js.erb +0 -1
- data/spec/fixtures/views/render_object_controller/render_object_with_template.xml.erb +0 -1
- data/spec/fixtures/views/template_views/interface__buffer_erubis.html.erb +0 -4
- data/spec/fixtures/views/template_views/interface__buffer_haml.html.haml +0 -7
- data/spec/fixtures/views/template_views/interface__buffer_markaby.html.mab +0 -7
- data/spec/fixtures/views/template_views/interface_capture_erubis.html.erb +0 -15
- data/spec/fixtures/views/template_views/interface_capture_haml.html.haml +0 -15
- data/spec/fixtures/views/template_views/interface_capture_markaby.html.mab +0 -4
- data/spec/fixtures/views/template_views/interface_concat_erubis.html.erb +0 -12
- data/spec/fixtures/views/template_views/interface_concat_haml.html.haml +0 -11
- data/spec/fixtures/views/template_views/interface_concat_markaby.html.mab +0 -14
- data/spec/fixtures/views/test.dir/the_template.html.erb +0 -1
- data/spec/merb/abstract_controller_spec.rb +0 -38
- data/spec/merb/assets_spec.rb +0 -207
- data/spec/merb/caching_spec.rb +0 -102
- data/spec/merb/config_spec.rb +0 -29
- data/spec/merb/controller_filters_spec.rb +0 -253
- data/spec/merb/controller_spec.rb +0 -126
- data/spec/merb/cookie_store_spec.rb +0 -72
- data/spec/merb/cookies_spec.rb +0 -96
- data/spec/merb/core_ext/class_spec.rb +0 -97
- data/spec/merb/core_ext/enumerable_spec.rb +0 -27
- data/spec/merb/core_ext/hash_spec.rb +0 -251
- data/spec/merb/core_ext/inflector_spec.rb +0 -34
- data/spec/merb/core_ext/kernel_spec.rb +0 -25
- data/spec/merb/core_ext/numeric_spec.rb +0 -26
- data/spec/merb/core_ext/object_spec.rb +0 -47
- data/spec/merb/core_ext/string_spec.rb +0 -22
- data/spec/merb/core_ext/symbol_spec.rb +0 -7
- data/spec/merb/dependency_spec.rb +0 -22
- data/spec/merb/dispatch_spec.rb +0 -528
- data/spec/merb/fake_request_spec.rb +0 -80
- data/spec/merb/generator_spec.rb +0 -248
- data/spec/merb/handler_spec.rb +0 -169
- data/spec/merb/mail_controller_spec.rb +0 -177
- data/spec/merb/mailer_spec.rb +0 -87
- data/spec/merb/multipart_spec.rb +0 -50
- data/spec/merb/part_controller_spec.rb +0 -124
- data/spec/merb/plugins_spec.rb +0 -80
- data/spec/merb/render_spec.rb +0 -469
- data/spec/merb/request_spec.rb +0 -287
- data/spec/merb/responder_spec.rb +0 -562
- data/spec/merb/router_spec.rb +0 -900
- data/spec/merb/server_spec.rb +0 -19
- data/spec/merb/template_spec.rb +0 -41
- data/spec/merb/upload_handler_spec.rb +0 -108
- data/spec/merb/version_spec.rb +0 -33
- data/spec/merb/view_context_spec.rb +0 -366
- data/spec/spec_generator_helper.rb +0 -34
- data/spec/spec_helper.rb +0 -101
- data/spec/spec_helpers/url_shared_behaviour.rb +0 -112
- data/test_unit_generators/merb_controller_test/merb_controller_test_generator.rb +0 -53
- data/test_unit_generators/merb_controller_test/templates/functional_test.rb +0 -17
- data/test_unit_generators/merb_controller_test/templates/helper_test.rb +0 -9
- data/test_unit_generators/merb_model_test/merb_model_test_generator.rb +0 -29
- data/test_unit_generators/merb_model_test/templates/model_test_unit_template.erb +0 -9
File without changes
|
@@ -1,67 +0,0 @@
|
|
1
|
-
require 'merb'
|
2
|
-
class ResourceGenerator < RubiGen::Base
|
3
|
-
|
4
|
-
default_options :author => nil
|
5
|
-
|
6
|
-
attr_reader :name, :class_name, :file_name, :provided_args
|
7
|
-
|
8
|
-
def initialize(runtime_args, runtime_options = {})
|
9
|
-
super
|
10
|
-
usage if args.empty?
|
11
|
-
# @name = args.shift
|
12
|
-
@provided_args = runtime_args
|
13
|
-
# @class_name = args.first.camel_case
|
14
|
-
extract_options
|
15
|
-
end
|
16
|
-
|
17
|
-
def manifest
|
18
|
-
record do |m|
|
19
|
-
#singularize the model & pluralize the name of the controller
|
20
|
-
model_args = provided_args.dup
|
21
|
-
controller_args = provided_args.dup
|
22
|
-
|
23
|
-
model_args[0] = model_args.first.singularize
|
24
|
-
controller_args[0] = controller_args.first.pluralize
|
25
|
-
|
26
|
-
m.dependency "model", model_args, options.dup
|
27
|
-
m.dependency "resource_controller", controller_args, options.dup
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
protected
|
32
|
-
def banner
|
33
|
-
<<-EOS
|
34
|
-
Creates a full resource. This includes:
|
35
|
-
|
36
|
-
Model: A model class
|
37
|
-
Migration: if required
|
38
|
-
Model Test or Spec stub
|
39
|
-
Resource Controller and views
|
40
|
-
Controller Test of Spec stubs
|
41
|
-
|
42
|
-
Example
|
43
|
-
|
44
|
-
ruby script/generate resource post title:string content:text created_at:datetime
|
45
|
-
|
46
|
-
USAGE: #{$0} #{spec.name} name"
|
47
|
-
EOS
|
48
|
-
end
|
49
|
-
|
50
|
-
def add_options!(opts)
|
51
|
-
# opts.separator ''
|
52
|
-
# opts.separator 'Options:'
|
53
|
-
# For each option below, place the default
|
54
|
-
# at the top of the file next to "default_options"
|
55
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
56
|
-
# "Some comment about this option",
|
57
|
-
# "Default: none") { |options[:author]| }
|
58
|
-
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
59
|
-
end
|
60
|
-
|
61
|
-
def extract_options
|
62
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
63
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
64
|
-
# raw instance variable value.
|
65
|
-
# @author = options[:author]
|
66
|
-
end
|
67
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
require 'merb'
|
2
|
-
class MerbControllerTestGenerator < RubiGen::Base
|
3
|
-
|
4
|
-
default_options :author => nil
|
5
|
-
|
6
|
-
attr_reader :name, :class_name, :file_name, :template_actions
|
7
|
-
|
8
|
-
def initialize(runtime_args, runtime_options = {})
|
9
|
-
super
|
10
|
-
usage if args.empty?
|
11
|
-
@name = args.shift
|
12
|
-
@class_name = @name.camel_case
|
13
|
-
@file_name = @name.snake_case #.pluralize
|
14
|
-
@template_actions = runtime_options[:template_actions] || []
|
15
|
-
@engine = runtime_options[:engine] || "erb" # set by subclasses only
|
16
|
-
extract_options
|
17
|
-
end
|
18
|
-
|
19
|
-
def manifest
|
20
|
-
record do |m|
|
21
|
-
m.directory 'spec/controllers'
|
22
|
-
m.template "controller_spec.rb", "spec/controllers/#{file_name}_spec.rb"
|
23
|
-
|
24
|
-
m.directory "spec/views/#{file_name}"
|
25
|
-
|
26
|
-
|
27
|
-
# Setup the view stubs for each view
|
28
|
-
@template_actions.each do |the_action|
|
29
|
-
template_name = "#{the_action}.html.#{@engine}"
|
30
|
-
if File.exists?(File.join(Merb.root, "app", "views", file_name, template_name))
|
31
|
-
m.template "#{the_action}_spec.rb", "spec/views/#{file_name}/#{the_action}_html_spec.rb"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
m.directory 'spec/helpers'
|
37
|
-
m.template "helper_spec.rb", "spec/helpers/#{file_name}_helper_spec.rb"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
protected
|
42
|
-
def banner
|
43
|
-
<<-EOS
|
44
|
-
Creates a ...
|
45
|
-
|
46
|
-
USAGE: #{$0} #{spec.name} name"
|
47
|
-
EOS
|
48
|
-
end
|
49
|
-
|
50
|
-
def add_options!(opts)
|
51
|
-
# opts.separator ''
|
52
|
-
# opts.separator 'Options:'
|
53
|
-
# For each option below, place the default
|
54
|
-
# at the top of the file next to "default_options"
|
55
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
56
|
-
# "Some comment about this option",
|
57
|
-
# "Default: none") { |options[:author]| }
|
58
|
-
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
59
|
-
end
|
60
|
-
|
61
|
-
def extract_options
|
62
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
63
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
64
|
-
# raw instance variable value.
|
65
|
-
# @author = options[:author]
|
66
|
-
end
|
67
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__),'..','..','spec_helper')
|
2
|
-
|
3
|
-
describe "/<%= file_name %>/edit" do
|
4
|
-
before(:each) do
|
5
|
-
@controller,@action = get("/<%= file_name %>/edit")
|
6
|
-
@body = @controller.body
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should mention <%= class_name %>" do
|
10
|
-
@body.should match(/<%= class_name %>/)
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__),'..','..','spec_helper')
|
2
|
-
|
3
|
-
describe "/<%= file_name %>" do
|
4
|
-
before(:each) do
|
5
|
-
@controller,@action = get("/<%= file_name %>")
|
6
|
-
@body = @controller.body
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should mention <%= class_name %>" do
|
10
|
-
@body.should match(/<%= class_name %>/)
|
11
|
-
end
|
12
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__),'..','..','spec_helper')
|
2
|
-
|
3
|
-
describe "/<%= file_name %>/new" do
|
4
|
-
before(:each) do
|
5
|
-
@controller,@action = get("/<%= file_name %>/new")
|
6
|
-
@body = @controller.body
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should mention <%= class_name %>" do
|
10
|
-
@body.should match(/<%= class_name %>/)
|
11
|
-
end
|
12
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'merb/generators/merb_generator_helpers'
|
2
|
-
class MerbModelTestGenerator < Merb::GeneratorHelpers::MerbModelTestGenerator
|
3
|
-
|
4
|
-
def initialize( *args )
|
5
|
-
super( *args )
|
6
|
-
@model_test_template_name = "model_spec_template.erb"
|
7
|
-
@model_test_path_name = File.join("spec", "models")
|
8
|
-
@model_test_file_suffix = "spec"
|
9
|
-
end
|
10
|
-
|
11
|
-
def banner
|
12
|
-
<<-EOS
|
13
|
-
Creates a model spec stub for use in Merb
|
14
|
-
|
15
|
-
USAGE: #{$0} #{spec.name} NameOfModel
|
16
|
-
Example:
|
17
|
-
#{$0} #{spec.name} project
|
18
|
-
|
19
|
-
|
20
|
-
EOS
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.superclass
|
24
|
-
RubiGen::Base
|
25
|
-
end
|
26
|
-
end
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.join(File.dirname(__FILE__), '..')
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :rspec]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.join(File.dirname(__FILE__), '..')
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/generate'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :rspec]
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|
@@ -1 +0,0 @@
|
|
1
|
-
:loaded_config_for_environment_config_test: true
|
@@ -1,18 +0,0 @@
|
|
1
|
-
---
|
2
|
-
:host: 127.0.0.1
|
3
|
-
:port: "4000"
|
4
|
-
#:path_prefix: "/my_app"
|
5
|
-
|
6
|
-
### Test Erb in config
|
7
|
-
:environment: <%= "test" if true %>
|
8
|
-
|
9
|
-
:session_store: memory
|
10
|
-
#:config: config/upload.conf
|
11
|
-
#:cache_templates: true
|
12
|
-
#:drb_server_port: 32323
|
13
|
-
#:basic_auth:
|
14
|
-
# :username: ezra
|
15
|
-
# :password: test
|
16
|
-
# :domain: localhost
|
17
|
-
#:daemonize: true
|
18
|
-
#:cluster: 3
|
@@ -1,235 +0,0 @@
|
|
1
|
-
class Foo < Merb::Controller
|
2
|
-
|
3
|
-
def index
|
4
|
-
"index"
|
5
|
-
end
|
6
|
-
|
7
|
-
def bar
|
8
|
-
"bar"
|
9
|
-
end
|
10
|
-
|
11
|
-
def error
|
12
|
-
raise AdminAccessRequired
|
13
|
-
"Hello World!"
|
14
|
-
end
|
15
|
-
|
16
|
-
def raise404
|
17
|
-
raise NotFound
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
class Bar < Merb::Controller
|
22
|
-
|
23
|
-
def foo(id)
|
24
|
-
id
|
25
|
-
end
|
26
|
-
|
27
|
-
def bar(a, b = "2")
|
28
|
-
"#{a} #{b}"
|
29
|
-
end
|
30
|
-
|
31
|
-
def baz(a, b = "2", c = "3")
|
32
|
-
"#{a} #{b} #{c}"
|
33
|
-
end
|
34
|
-
|
35
|
-
def bat(a, b = false)
|
36
|
-
"#{a} #{b}"
|
37
|
-
end
|
38
|
-
|
39
|
-
def bam(a, b = nil)
|
40
|
-
"#{a} #{b.inspect}"
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
class Baz < Merb::Controller
|
46
|
-
|
47
|
-
def index
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
class Bat < Merb::Controller
|
53
|
-
end
|
54
|
-
|
55
|
-
class AdminAccessRequired < Merb::ControllerExceptions::Unauthorized; end
|
56
|
-
|
57
|
-
class Exceptions < Merb::Controller
|
58
|
-
def admin_access_required
|
59
|
-
"oh no!"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
class Posts < Merb::Controller
|
64
|
-
# GET /posts
|
65
|
-
# GET /posts.xml
|
66
|
-
def index() :index end
|
67
|
-
# GET /posts/1
|
68
|
-
# GET /posts/1.xml
|
69
|
-
def show() :show end
|
70
|
-
# GET /posts/new
|
71
|
-
def new() :new end
|
72
|
-
# GET /posts/1;edit
|
73
|
-
def edit() :edit end
|
74
|
-
# POST /posts
|
75
|
-
# POST /posts.xml
|
76
|
-
def create() :create end
|
77
|
-
# PUT /posts/1
|
78
|
-
# PUT /posts/1.xml
|
79
|
-
def update() :update end
|
80
|
-
# DELETE /posts/1
|
81
|
-
# DELETE /posts/1.xml
|
82
|
-
def destroy() :destroy end
|
83
|
-
# GET /posts/1;stats
|
84
|
-
# PUT /posts/1;stats
|
85
|
-
def stats() :stats end
|
86
|
-
# GET /posts;filter
|
87
|
-
def filter() :filter end
|
88
|
-
end
|
89
|
-
|
90
|
-
class As < Merb::Controller
|
91
|
-
# GET /as
|
92
|
-
# GET /as.xml
|
93
|
-
def index() :index end
|
94
|
-
# GET /as/1
|
95
|
-
# GET /as/1.xml
|
96
|
-
def show() :show end
|
97
|
-
# GET /as/new
|
98
|
-
def new() :new end
|
99
|
-
# GET /as/1;edit
|
100
|
-
def edit() :edit end
|
101
|
-
# POST /as
|
102
|
-
# POST /as.xml
|
103
|
-
def create() :create end
|
104
|
-
# PUT /as/1
|
105
|
-
# PUT /as/1.xml
|
106
|
-
def update() :update end
|
107
|
-
# DELETE /as/1
|
108
|
-
# DELETE /as/1.xml
|
109
|
-
def destroy() :destroy end
|
110
|
-
end
|
111
|
-
|
112
|
-
class Bs < Merb::Controller
|
113
|
-
# GET /as/1/bs
|
114
|
-
# GET /as/1/bs.xml
|
115
|
-
def index() :index end
|
116
|
-
# GET /as/1/bs/1
|
117
|
-
# GET /as/1/bs/1.xml
|
118
|
-
def show() :show end
|
119
|
-
# GET /as/1/bs/new
|
120
|
-
def new() :new end
|
121
|
-
# GET /as/1/bs/1;edit
|
122
|
-
def edit() :edit end
|
123
|
-
# POST /as/1/bs
|
124
|
-
# POST /as/1/bs.xml
|
125
|
-
def create() :create end
|
126
|
-
# PUT /as/1/bs/1
|
127
|
-
# PUT /as/1/bs/1.xml
|
128
|
-
def update() :update end
|
129
|
-
# DELETE /as/1/bs/1
|
130
|
-
# DELETE /as/1/bs/1.xml
|
131
|
-
def destroy() :destroy end
|
132
|
-
end
|
133
|
-
|
134
|
-
class Cs < Merb::Controller
|
135
|
-
# GET /as/1/bs/1/cs
|
136
|
-
# GET /as/1/bs/1/cs.xml
|
137
|
-
def index() :index end
|
138
|
-
# GET /as/1/bs/1/cs/1
|
139
|
-
# GET /as/1/bs/1/cs/1.xml
|
140
|
-
def show() :show end
|
141
|
-
# GET /as/1/bs/1/cs/new
|
142
|
-
def new() :new end
|
143
|
-
# GET /as/1/bs/1/cs/1;edit
|
144
|
-
def edit() :edit end
|
145
|
-
# POST /as/1/bs/1/cs
|
146
|
-
# POST /as/1/bs/1/cs.xml
|
147
|
-
def create() :create end
|
148
|
-
# PUT /as/1/bs/1/cs/1
|
149
|
-
# PUT /as/1/bs/1/cs/1.xml
|
150
|
-
def update() :update end
|
151
|
-
# DELETE /as/1/bs/1/cs/1
|
152
|
-
# DELETE /as/1/bs/1/cs/1.xml
|
153
|
-
def destroy() :destroy end
|
154
|
-
end
|
155
|
-
|
156
|
-
class Tags < Merb::Controller
|
157
|
-
# GET /tags
|
158
|
-
# GET /tags.xml
|
159
|
-
def index() :index end
|
160
|
-
# GET /tags/1
|
161
|
-
# GET /tags/1.xml
|
162
|
-
def show() :show end
|
163
|
-
# GET /tags/new
|
164
|
-
def new() :new end
|
165
|
-
# GET /tags/1;edit
|
166
|
-
def edit() :edit end
|
167
|
-
# POST /tags
|
168
|
-
# POST /tags.xml
|
169
|
-
def create() :create end
|
170
|
-
# PUT /tags/1
|
171
|
-
# PUT /tags/1.xml
|
172
|
-
def update() :update end
|
173
|
-
# DELETE /tags/1
|
174
|
-
# DELETE /tags/1.xml
|
175
|
-
def destroy() :destroy end
|
176
|
-
# GET /tags/1;stats
|
177
|
-
# PUT /tags/1;stats
|
178
|
-
def stats() :stats end
|
179
|
-
# GET /tags;filter
|
180
|
-
def filter() :filter end
|
181
|
-
end
|
182
|
-
|
183
|
-
class Comments < Merb::Controller
|
184
|
-
# GET /comments
|
185
|
-
# GET /comments.xml
|
186
|
-
def index() :index end
|
187
|
-
# GET /comments/1
|
188
|
-
# GET /comments/1.xml
|
189
|
-
def show() :show end
|
190
|
-
# GET /comments/new
|
191
|
-
def new() :new end
|
192
|
-
# GET /comments/1;edit
|
193
|
-
def edit() :edit end
|
194
|
-
# POST /comments
|
195
|
-
# POST /comments.xml
|
196
|
-
def create() :create end
|
197
|
-
# PUT /comments/1
|
198
|
-
# PUT /comments/1.xml
|
199
|
-
def update() :update end
|
200
|
-
# DELETE /comments/1
|
201
|
-
# DELETE /comments/1.xml
|
202
|
-
def destroy() :destroy end
|
203
|
-
# GET /comments/1;stats
|
204
|
-
# PUT /comments/1;stats
|
205
|
-
def stats() :stats end
|
206
|
-
end
|
207
|
-
|
208
|
-
class Icon < Merb::Controller
|
209
|
-
# GET /icon
|
210
|
-
# GET /icon.xml
|
211
|
-
def show() :show end
|
212
|
-
# GET /icon/new
|
213
|
-
def new() :new end
|
214
|
-
# GET /icon;edit
|
215
|
-
def edit() :edit end
|
216
|
-
# POST /icon
|
217
|
-
# POST /icon.xml
|
218
|
-
def create() :create end
|
219
|
-
# PUT /icon7
|
220
|
-
# PUT /icon.xml
|
221
|
-
def update() :update end
|
222
|
-
# DELETE /icon
|
223
|
-
# DELETE /icon.xml
|
224
|
-
def destroy() :destroy end
|
225
|
-
# GET /icon;stats
|
226
|
-
# PUT /icon;stats
|
227
|
-
def stats() :stats end
|
228
|
-
end
|
229
|
-
|
230
|
-
class Profile < Merb::Controller
|
231
|
-
def show() :show end
|
232
|
-
end
|
233
|
-
|
234
|
-
# If this throws an error, it's because parameterized args are somehow borked
|
235
|
-
Merb::BootLoader.load_application
|