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
@@ -1 +0,0 @@
|
|
1
|
-
<%= "Hello!" %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= respond_to?(:yo) && yo ? yo : "No Locals!" %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= erubis_collection %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= number %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= respond_to?(:yo) ? yo : "No Locals!" %>
|
@@ -1 +0,0 @@
|
|
1
|
-
= respond_to?(:yo) && yo ? yo : "No Locals!"
|
@@ -1 +0,0 @@
|
|
1
|
-
= haml_collection
|
@@ -1 +0,0 @@
|
|
1
|
-
= number
|
@@ -1 +0,0 @@
|
|
1
|
-
= respond_to?(:yo) && yo ? yo : "No Locals!"
|
@@ -1 +0,0 @@
|
|
1
|
-
"#{defined?(yo) && yo ? yo : "No Locals!"}"
|
@@ -1 +0,0 @@
|
|
1
|
-
"#{markaby_collection}\n"
|
@@ -1 +0,0 @@
|
|
1
|
-
"#{number}\n"
|
@@ -1 +0,0 @@
|
|
1
|
-
"#{defined?(yo) && yo ? yo : "No Locals!"}"
|
@@ -1 +0,0 @@
|
|
1
|
-
object with template html format
|
@@ -1 +0,0 @@
|
|
1
|
-
object with template js format
|
@@ -1 +0,0 @@
|
|
1
|
-
object with template xml format
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<% @foo = capture do %>
|
2
|
-
Capture Text Without Args
|
3
|
-
<% end %>
|
4
|
-
<%= @foo %>
|
5
|
-
|
6
|
-
<% @struct = Struct.new( :value ) -%>
|
7
|
-
<% @obj = @struct.new( "capture text from yielded object" )%>
|
8
|
-
|
9
|
-
<% @foo2 = capture( @obj ) do |obj| %>
|
10
|
-
BEFORE
|
11
|
-
<%= obj.value %>
|
12
|
-
AFTER
|
13
|
-
<% end %>
|
14
|
-
|
15
|
-
<%= @foo2 %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
Test the Concat Helper
|
2
|
-
<% concat( "Concat Text", binding ) -%>
|
3
|
-
|
4
|
-
<% def tester( &block ) -%>
|
5
|
-
<% concat( "Start Tester Block", block.binding ) %>
|
6
|
-
<% yield %>
|
7
|
-
<% concat( "Finish Tester Block", block.binding ) %>
|
8
|
-
<% end %>
|
9
|
-
|
10
|
-
<% tester do %>
|
11
|
-
In Tester Block
|
12
|
-
<% end %>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
p do
|
2
|
-
"Test the Concat Helper"
|
3
|
-
concat( "Concat Text", binding )
|
4
|
-
end
|
5
|
-
|
6
|
-
def tester_helper( &block )
|
7
|
-
concat( "Start Tester Block", block.binding )
|
8
|
-
yield
|
9
|
-
concat( "Finish Tester Block", block.binding )
|
10
|
-
end
|
11
|
-
|
12
|
-
tester_helper do
|
13
|
-
text "In Tester Block"
|
14
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe Merb::AbstractController do
|
4
|
-
|
5
|
-
before(:all) do
|
6
|
-
@abc = Merb::AbstractController
|
7
|
-
@template = "/my/template/path/file.html.erb"
|
8
|
-
@key = "/my/template/path/file.html"
|
9
|
-
end
|
10
|
-
|
11
|
-
before(:each) do
|
12
|
-
@abc.reset_template_path_cache!
|
13
|
-
end
|
14
|
-
|
15
|
-
after(:all) do
|
16
|
-
Merb::BootLoader.load_controller_template_path_cache
|
17
|
-
Merb::BootLoader.load_inline_helpers
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should add a template path" do
|
21
|
-
@abc.add_path_to_template_cache(@template)
|
22
|
-
@abc._template_path_cache.should include(@key)
|
23
|
-
@abc._template_path_cache[@key].should == @template
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should reset the template_path_cache" do
|
27
|
-
@abc.add_path_to_template_cache(@template)
|
28
|
-
@abc._template_path_cache.should_not be_empty
|
29
|
-
@abc.reset_template_path_cache!
|
30
|
-
@abc._template_path_cache.should be_empty
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should return false if the template is the wrong format when adding" do
|
34
|
-
@abc.add_path_to_template_cache("/my/path/to/template.rhtml").should == false
|
35
|
-
@abc._template_path_cache.should_not include( "/my/path/to/template.rhtml")
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
data/spec/merb/assets_spec.rb
DELETED
@@ -1,207 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
require "fileutils"
|
4
|
-
|
5
|
-
describe Merb::Assets, "in the production environment" do
|
6
|
-
|
7
|
-
before(:each) do
|
8
|
-
@old_env = Merb::Config[:environment]
|
9
|
-
Merb::Config[:environment] = :production
|
10
|
-
Merb::Config.delete(:bundle_assets)
|
11
|
-
end
|
12
|
-
|
13
|
-
after(:each) do
|
14
|
-
Merb::Config[:environment] = @old_env
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should bundle assets" do
|
18
|
-
Merb::Assets.bundle?.should == true
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
describe Merb::Assets, "in the development environment" do
|
24
|
-
|
25
|
-
before(:each) do
|
26
|
-
@old_env = Merb::Config[:environment]
|
27
|
-
Merb::Config[:environment] = :development
|
28
|
-
Merb::Config.delete(:bundle_assets)
|
29
|
-
end
|
30
|
-
|
31
|
-
after(:each) do
|
32
|
-
Merb::Config[:environment] = @old_env
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should not bundle assets" do
|
36
|
-
Merb::Assets.bundle?.should == false
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
describe Merb::Assets, "in the development environment with asset bundling enabled" do
|
42
|
-
|
43
|
-
before(:each) do
|
44
|
-
@old_env = Merb::Config[:environment]
|
45
|
-
Merb::Config[:environment] = :development
|
46
|
-
Merb::Config[:bundle_assets] = true
|
47
|
-
end
|
48
|
-
|
49
|
-
after(:each) do
|
50
|
-
Merb::Config[:environment] = @old_env
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should bundle assets" do
|
54
|
-
Merb::Assets.bundle?.should == true
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
58
|
-
|
59
|
-
describe Merb::Assets::AssetHelpers, "asset_path" do
|
60
|
-
|
61
|
-
include Merb::Assets::AssetHelpers
|
62
|
-
|
63
|
-
it "should turn a symbol shorthand for a javascript asset into a URI path" do
|
64
|
-
asset_path(:javascript, :dingo).should == "/javascripts/dingo.js"
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should turn a string shorthand for a javascript asset into a URI path" do
|
68
|
-
asset_path(:javascript, "dingo").should == "/javascripts/dingo.js"
|
69
|
-
asset_path(:javascript, "dingo.r7337").should == "/javascripts/dingo.r7337.js"
|
70
|
-
asset_path(:javascript, "dingo/wakka").should == "/javascripts/dingo/wakka.js"
|
71
|
-
end
|
72
|
-
|
73
|
-
it "should turn the filename of a javascript asset into a URI path" do
|
74
|
-
asset_path(:javascript, "dingo.js").should == "/javascripts/dingo.js"
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should turn a symbol shorthand for a stylesheet asset into a URI path" do
|
78
|
-
asset_path(:stylesheet, :dingo).should == "/stylesheets/dingo.css"
|
79
|
-
end
|
80
|
-
|
81
|
-
it "should turn a string shorthand for a stylesheet asset into a URI path" do
|
82
|
-
asset_path(:stylesheet, "dingo").should == "/stylesheets/dingo.css"
|
83
|
-
asset_path(:stylesheet, "dingo.r7337").should == "/stylesheets/dingo.r7337.css"
|
84
|
-
asset_path(:stylesheet, "dingo/wakka").should == "/stylesheets/dingo/wakka.css"
|
85
|
-
end
|
86
|
-
|
87
|
-
it "should turn the filename of a stylesheet asset into a URI path" do
|
88
|
-
asset_path(:stylesheet, "dingo.css").should == "/stylesheets/dingo.css"
|
89
|
-
end
|
90
|
-
|
91
|
-
it "should turn an asset name into a file path" do
|
92
|
-
asset_path(:stylesheet, :dingo, true).should == "public/stylesheets/dingo.css"
|
93
|
-
end
|
94
|
-
|
95
|
-
it "should prepend any path prefix to a URI path" do
|
96
|
-
begin
|
97
|
-
Merb::Config[:path_prefix] = '/inky'
|
98
|
-
asset_path(:stylesheet, "dingo.css").should == "/inky/stylesheets/dingo.css"
|
99
|
-
ensure
|
100
|
-
Merb::Config.delete(:path_prefix)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
it "should prepend any path prefix to a local path" do
|
105
|
-
begin
|
106
|
-
Merb::Config[:path_prefix] = '/inky'
|
107
|
-
asset_path(:stylesheet, "dingo.css", true).should == "public/stylesheets/dingo.css"
|
108
|
-
ensure
|
109
|
-
Merb::Config.delete(:path_prefix)
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
describe "an asset bundler with callbacks", :shared => true do
|
115
|
-
it "should collect callbacks for execution after bundling" do
|
116
|
-
@bundler_klass.add_callback { |filename| "yay #{filename}" }
|
117
|
-
@bundler_klass.callbacks.should have(1).procs
|
118
|
-
@bundler_klass.callbacks.first.call("me").should == "yay me"
|
119
|
-
@bundler_klass.callbacks.clear
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
describe "an asset bundler", :shared => true do
|
124
|
-
|
125
|
-
include Merb::Assets::AssetHelpers
|
126
|
-
|
127
|
-
before(:each) do
|
128
|
-
FileUtils.mkdir_p("./public/#{@bundler_klass.asset_type}s")
|
129
|
-
create_fixture_files
|
130
|
-
end
|
131
|
-
|
132
|
-
after(:each) do
|
133
|
-
FileUtils.rm_rf("./public")
|
134
|
-
end
|
135
|
-
|
136
|
-
def create_fixture_files
|
137
|
-
@asset1 = :asset1
|
138
|
-
@asset1filename = asset_path(@bundler_klass.asset_type, @asset1, true)
|
139
|
-
File.open(@asset1filename, "w") { |f| f << "one" }
|
140
|
-
|
141
|
-
@asset2 = :asset2
|
142
|
-
@asset2filename = asset_path(@bundler_klass.asset_type, @asset2, true)
|
143
|
-
File.open(@asset2filename, "w") { |f| f << "two" }
|
144
|
-
|
145
|
-
@asset3 = :asset3
|
146
|
-
@asset3filename = asset_path(@bundler_klass.asset_type, @asset3, true)
|
147
|
-
File.open(@asset3filename, "w") { |f| f << "three" }
|
148
|
-
end
|
149
|
-
|
150
|
-
it "should combine files into a single file" do
|
151
|
-
bundler = @bundler_klass.new(true, @asset1, @asset2, @asset3)
|
152
|
-
bundle_name = bundler.bundle!
|
153
|
-
File.read(asset_path(@bundler_klass.asset_type, bundle_name, true)).should == "one\ntwo\nthree\n"
|
154
|
-
end
|
155
|
-
|
156
|
-
it "should not overwrite bundles" do
|
157
|
-
File.open(asset_path(@bundler_klass.asset_type, :all, true), "w") { |f| f << "exists" }
|
158
|
-
bundler = @bundler_klass.new(true, @asset1, @asset2, @asset3)
|
159
|
-
bundle_name = bundler.bundle!
|
160
|
-
File.read(asset_path(@bundler_klass.asset_type, bundle_name, true)).should == "exists"
|
161
|
-
end
|
162
|
-
|
163
|
-
it "should execute all callbacks, passing them the bundled file's path" do
|
164
|
-
begin
|
165
|
-
@bundler_klass.add_callback do |filename|
|
166
|
-
File.open(filename, "a") do |f|
|
167
|
-
f.puts "yay"
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
bundler = @bundler_klass.new(true, @asset1, @asset2, @asset3)
|
172
|
-
bundle_name = bundler.bundle!
|
173
|
-
File.read(asset_path(@bundler_klass.asset_type, bundle_name, true)).should == "one\ntwo\nthree\nyay\n"
|
174
|
-
ensure
|
175
|
-
@bundler_klass.callbacks.clear
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
end
|
180
|
-
|
181
|
-
describe Merb::Assets::JavascriptAssetBundler do
|
182
|
-
|
183
|
-
before(:each) do
|
184
|
-
@bundler_klass = Merb::Assets::JavascriptAssetBundler
|
185
|
-
end
|
186
|
-
|
187
|
-
it "should handle javascript assets" do
|
188
|
-
@bundler_klass.asset_type.should == :javascript
|
189
|
-
end
|
190
|
-
|
191
|
-
it_should_behave_like "an asset bundler"
|
192
|
-
it_should_behave_like "an asset bundler with callbacks"
|
193
|
-
end
|
194
|
-
|
195
|
-
describe Merb::Assets::StylesheetAssetBundler do
|
196
|
-
|
197
|
-
before(:each) do
|
198
|
-
@bundler_klass = Merb::Assets::StylesheetAssetBundler
|
199
|
-
end
|
200
|
-
|
201
|
-
it "should handle stylesheet assets" do
|
202
|
-
@bundler_klass.asset_type.should == :stylesheet
|
203
|
-
end
|
204
|
-
|
205
|
-
it_should_behave_like "an asset bundler"
|
206
|
-
it_should_behave_like "an asset bundler with callbacks"
|
207
|
-
end
|
data/spec/merb/caching_spec.rb
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "all fragment caching", :shared => true do
|
4
|
-
|
5
|
-
it "should be able to store and retrieve a key" do
|
6
|
-
@c.put(:foo, "Bar")
|
7
|
-
@c.get(:foo).should == "Bar"
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should be able to expire a fragment" do
|
11
|
-
@c.put(:foo, "Bar")
|
12
|
-
@c.get(:foo).should == "Bar"
|
13
|
-
@c.expire_fragment(:foo)
|
14
|
-
@c.get(:foo).should == nil
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should clear the cache on reset" do
|
18
|
-
@c.put(:foo, "Bar")
|
19
|
-
@c.get(:foo).should == "Bar"
|
20
|
-
@c.clear
|
21
|
-
@c.get(:foo).should == nil
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should be ok to clear the cache twice" do
|
25
|
-
@c.clear
|
26
|
-
@c.clear
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should accept keys and subkeys" do
|
30
|
-
@c.put([:user, :joe], "Joe's data")
|
31
|
-
@c.get([:user, :joe]).should. == "Joe's data"
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should keep subkeys separate" do
|
35
|
-
@c.put([:user, :joe], "Joe's data")
|
36
|
-
@c.put([:user, :bill], "Bill's data")
|
37
|
-
@c.get([:user, :joe]).should == "Joe's data"
|
38
|
-
@c.get([:user, :bill]).should == "Bill's data"
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should expire a subkey" do
|
42
|
-
@c.put([:user, :joe], "Joe's data")
|
43
|
-
@c.put([:user, :bill], "Bill's data")
|
44
|
-
@c.expire_fragment([:user,:joe])
|
45
|
-
@c.get([:user, :joe]).should == nil
|
46
|
-
@c.get([:user, :bill]).should == "Bill's data"
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should expire a key and all its children when passed an array containing only the top key" do
|
50
|
-
@c.put([:user, :joe], "Joe's data")
|
51
|
-
@c.put([:user, :bill], "Bill's data")
|
52
|
-
@c.expire_fragment([:user])
|
53
|
-
@c.get([:user, :joe]).should == nil
|
54
|
-
@c.get([:user, :bill]).should == nil
|
55
|
-
end
|
56
|
-
|
57
|
-
it "should expire a key and all its children when passed only the top key" do
|
58
|
-
@c.put([:user, :joe], "Joe's data")
|
59
|
-
@c.put([:user, :bill], "Bill's data")
|
60
|
-
@c.expire_fragment(:user)
|
61
|
-
@c.get([:user, :joe]).should == nil
|
62
|
-
@c.get([:user, :bill]).should == nil
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should handle arbitrary levels of keys" do
|
66
|
-
@c.put([:users, :show, :bob], "Bob's data")
|
67
|
-
@c.put([:users, :show, :mary], "Mary's data")
|
68
|
-
@c.put([:users, :edit, :bob], "Bob's editable data")
|
69
|
-
@c.get([:users, :show, :bob]).should == "Bob's data"
|
70
|
-
@c.get([:users, :edit, :bob]).should == "Bob's editable data"
|
71
|
-
@c.expire_fragment([:users, :show, :mary])
|
72
|
-
@c.get([:users, :show, :mary]).should == nil
|
73
|
-
@c.get([:users, :show, :bob]).should == "Bob's data"
|
74
|
-
@c.expire_fragment([:users, :show])
|
75
|
-
@c.get([:users, :show, :bob]).should == nil
|
76
|
-
@c.expire_fragment([:users])
|
77
|
-
@c.get([:users, :edit, :bob]).should == nil
|
78
|
-
end
|
79
|
-
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
|
84
|
-
describe "fragment caching in memory" do
|
85
|
-
before do
|
86
|
-
Merb::Config['cache_store'] = 'memory'
|
87
|
-
@c = Merb::Caching::Fragment
|
88
|
-
@c.clear
|
89
|
-
end
|
90
|
-
|
91
|
-
it_should_behave_like "all fragment caching"
|
92
|
-
end
|
93
|
-
|
94
|
-
describe "fragment caching to a file" do
|
95
|
-
before do
|
96
|
-
Merb::Config[:cache_store] = 'file'
|
97
|
-
@c = Merb::Caching::Fragment
|
98
|
-
@c.clear
|
99
|
-
end
|
100
|
-
|
101
|
-
it_should_behave_like "all fragment caching"
|
102
|
-
end
|