rango 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +6 -0
- data/CONTRIBUTORS +1 -0
- data/README.textile +4 -1
- data/bin/rango +1 -1
- data/lib/rango.rb +78 -12
- data/lib/rango/contrib/pagination.rb +2 -0
- data/lib/rango/controller.rb +58 -12
- data/lib/rango/environments.rb +26 -0
- data/lib/rango/exceptions.rb +2 -14
- data/lib/rango/gv.rb +7 -90
- data/lib/rango/gv/static.rb +22 -0
- data/lib/rango/helpers.rb +0 -1
- data/lib/rango/helpers/assets.rb +2 -0
- data/lib/rango/helpers/general.rb +1 -0
- data/lib/rango/helpers/syntax.rb +2 -0
- data/lib/rango/mini.rb +30 -0
- data/lib/rango/mixins/application.rb +5 -3
- data/lib/rango/mixins/configurable.rb +1 -0
- data/lib/rango/mixins/render.rb +13 -84
- data/lib/rango/orm/tasks/datamapper.rake +2 -2
- data/lib/rango/project.rb +2 -2
- data/lib/rango/rack/middlewares/basic.rb +15 -11
- data/lib/rango/rack/request.rb +5 -3
- data/lib/rango/router.rb +20 -2
- data/lib/rango/router/adapters/rack_mount.rb +0 -1
- data/lib/rango/router/adapters/rack_router.rb +0 -1
- data/lib/rango/router/adapters/urlmap.rb +0 -1
- data/lib/rango/router/adapters/usher.rb +0 -1
- data/lib/rango/settings/framework.rb +2 -43
- data/lib/rango/templates/{erubis.rb → exts/erubis.rb} +0 -19
- data/lib/rango/templates/exts/tilt.rb +16 -0
- data/lib/rango/templates/helpers.rb +107 -0
- data/lib/rango/templates/template.rb +44 -115
- data/lib/rango/utils.rb +9 -4
- data/spec/rango/controller_spec.rb +3 -1
- data/spec/rango/environments_spec.rb +68 -0
- data/spec/rango/gv_spec.rb +10 -0
- data/spec/rango/mini_spec.rb +58 -0
- data/spec/rango/project_spec.rb +1 -1
- data/spec/rango/templates/template_spec.rb +81 -0
- data/spec/rango/utils_spec.rb +33 -0
- data/spec/rango_spec.rb +3 -17
- data/spec/spec_helper.rb +5 -3
- data/spec/stubs/config.ru +5 -0
- data/spec/stubs/templates/capture.html.erb +1 -1
- data/spec/stubs/templates/erubis.html.erubis +2 -0
- data/spec/stubs/templates/inheritance/basic/base.html.haml +2 -0
- data/spec/stubs/templates/inheritance/basic/index.html.haml +2 -0
- data/spec/stubs/templates/inheritance/capture/erb/base.html.erb +3 -0
- data/spec/stubs/templates/inheritance/capture/erb/index.html.erb +4 -0
- data/spec/stubs/templates/inheritance/capture/erubis/base.html.erubis +3 -0
- data/spec/stubs/templates/inheritance/capture/erubis/index.html.erubis +4 -0
- data/spec/stubs/templates/inheritance/capture/haml/base.html.haml +2 -0
- data/spec/stubs/templates/inheritance/capture/haml/index.html.haml +3 -0
- data/spec/stubs/templates/test.html.haml +1 -0
- data/spec/stubs/templates/variables.html.haml +1 -0
- data/stubs/app/content/init.rb.rbt +2 -1
- data/stubs/app/content/views.rb.rbt +2 -0
- data/stubs/bigapp/content/views/%controller%.rb.rbt +2 -0
- data/stubs/project/content/config.ru.rbt +3 -0
- data/stubs/project/content/init.rb.rbt +11 -5
- data/stubs/project/content/settings.rb +0 -2
- data/stubs/project/content/settings_local.rb.rbt +1 -1
- data/stubs/project/content/templates/base.html.haml.rbt +1 -0
- metadata +42 -329
- data/examples/README.textile +0 -12
- data/examples/blog/Gemfile +0 -80
- data/examples/blog/Rakefile +0 -12
- data/examples/blog/TODO.txt +0 -0
- data/examples/blog/bin/autospec +0 -3
- data/examples/blog/bin/css2sass +0 -3
- data/examples/blog/bin/cucumber +0 -3
- data/examples/blog/bin/haml +0 -3
- data/examples/blog/bin/html2haml +0 -3
- data/examples/blog/bin/htmldiff +0 -3
- data/examples/blog/bin/launchy +0 -3
- data/examples/blog/bin/ldiff +0 -3
- data/examples/blog/bin/nokogiri +0 -3
- data/examples/blog/bin/racksh +0 -3
- data/examples/blog/bin/rackup +0 -3
- data/examples/blog/bin/rake +0 -3
- data/examples/blog/bin/rango +0 -3
- data/examples/blog/bin/sass +0 -3
- data/examples/blog/bin/shotgun +0 -3
- data/examples/blog/bin/simple-templater +0 -3
- data/examples/blog/bin/spec +0 -3
- data/examples/blog/bin/tt +0 -3
- data/examples/blog/blog/init.rb +0 -9
- data/examples/blog/blog/models.rb +0 -21
- data/examples/blog/blog/views.rb +0 -16
- data/examples/blog/config.ru +0 -19
- data/examples/blog/gems/cache/addressable-2.1.1.gem +0 -0
- data/examples/blog/gems/cache/builder-2.1.2.gem +0 -0
- data/examples/blog/gems/cache/bundler-0.7.0.gem +0 -0
- data/examples/blog/gems/cache/cli-0.0.1.gem +0 -0
- data/examples/blog/gems/cache/configuration-1.1.0.gem +0 -0
- data/examples/blog/gems/cache/cucumber-0.4.4.gem +0 -0
- data/examples/blog/gems/cache/data_objects-0.10.0.gem +0 -0
- data/examples/blog/gems/cache/diff-lcs-1.1.2.gem +0 -0
- data/examples/blog/gems/cache/dm-core-0.10.1.gem +0 -0
- data/examples/blog/gems/cache/dm-timestamps-0.10.1.gem +0 -0
- data/examples/blog/gems/cache/do_mysql-0.10.0.gem +0 -0
- data/examples/blog/gems/cache/do_sqlite3-0.10.0.gem +0 -0
- data/examples/blog/gems/cache/extlib-0.9.13.gem +0 -0
- data/examples/blog/gems/cache/fuzzyhash-0.0.9.gem +0 -0
- data/examples/blog/gems/cache/haml-2.2.14.gem +0 -0
- data/examples/blog/gems/cache/launchy-0.3.3.gem +0 -0
- data/examples/blog/gems/cache/media-path-0.1.gem +0 -0
- data/examples/blog/gems/cache/nokogiri-1.4.0.gem +0 -0
- data/examples/blog/gems/cache/polyglot-0.2.9.gem +0 -0
- data/examples/blog/gems/cache/rack-1.0.1.gem +0 -0
- data/examples/blog/gems/cache/rack-test-0.5.2.gem +0 -0
- data/examples/blog/gems/cache/racksh-0.9.4.2.gem +0 -0
- data/examples/blog/gems/cache/rake-0.8.7.gem +0 -0
- data/examples/blog/gems/cache/rango-0.1.0.gem +0 -0
- data/examples/blog/gems/cache/rspec-1.2.9.gem +0 -0
- data/examples/blog/gems/cache/rubyexts-0.0.1.gem +0 -0
- data/examples/blog/gems/cache/shotgun-0.4.gem +0 -0
- data/examples/blog/gems/cache/simple-templater-0.0.1.gem +0 -0
- data/examples/blog/gems/cache/term-ansicolor-1.0.4.gem +0 -0
- data/examples/blog/gems/cache/treetop-1.4.2.gem +0 -0
- data/examples/blog/gems/cache/usher-0.5.11.gem +0 -0
- data/examples/blog/gems/cache/webrat-0.5.3.gem +0 -0
- data/examples/blog/init.rb +0 -49
- data/examples/blog/settings.rb +0 -15
- data/examples/blog/settings_local.rb +0 -6
- data/examples/blog/spec/blog/init_spec.rb +0 -7
- data/examples/blog/spec/blog/models_spec.rb +0 -28
- data/examples/blog/spec/blog/views_spec.rb +0 -22
- data/examples/blog/spec/spec.opts +0 -5
- data/examples/blog/spec/spec_helper.rb +0 -27
- data/examples/blog/templates/base.html.haml +0 -16
- data/examples/blog/templates/index.html.haml +0 -12
- data/lib/rango/boot.rb +0 -55
- data/lib/rango/helpers/README +0 -179
- data/lib/rango/helpers/merb-helpers.rb +0 -3
- data/lib/rango/helpers/merb-helpers/core_ext.rb +0 -58
- data/lib/rango/helpers/merb-helpers/core_ext/numeric.rb +0 -389
- data/lib/rango/helpers/merb-helpers/date_time_formatting.rb +0 -146
- data/lib/rango/helpers/merb-helpers/date_time_helpers.rb +0 -191
- data/lib/rango/helpers/merb-helpers/form/builder.rb +0 -450
- data/lib/rango/helpers/merb-helpers/form/helpers.rb +0 -453
- data/lib/rango/helpers/merb-helpers/form_helpers.rb +0 -21
- data/lib/rango/helpers/merb-helpers/tag_helpers.rb +0 -63
- data/lib/rango/helpers/merb-helpers/text_helpers.rb +0 -73
- data/lib/rango/loggers/logger.rb +0 -100
- data/lib/rango/mixins/chainable.rb +0 -68
- data/lib/rango/mixins/hookable.rb +0 -32
- data/lib/rango/mixins/import.rb +0 -89
- data/lib/rango/mixins/mini.rb +0 -29
- data/lib/rango/mixins/strategy.rb +0 -28
- data/lib/rango/rango.rb +0 -93
- data/lib/rango/router/specification.txt +0 -11
- data/lib/rango/templates/adapter.rb +0 -19
- data/lib/rango/templates/adapters/erb.rb +0 -63
- data/lib/rango/templates/adapters/erubis.rb +0 -65
- data/lib/rango/templates/adapters/haml.rb +0 -26
- data/lib/rango/templates/templates.txt +0 -39
- data/spec/factories.rb +0 -22
- data/spec/rango/boot_spec.rb +0 -15
- data/spec/rango/helpers/merb-helpers/core_ext/numeric_spec.rb +0 -0
- data/spec/rango/helpers/merb-helpers/core_ext_spec.rb +0 -21
- data/spec/rango/helpers/merb-helpers/date_time_formatting_spec.rb +0 -0
- data/spec/rango/helpers/merb-helpers/date_time_helpers_spec.rb +0 -0
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/application.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_check_box.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_file_field.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_hidden_field.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_option_tag.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_password_field.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_radio_button.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_radio_group.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_select.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_text_area.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/bound_text_field.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/button.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/check_box.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/custom_builder.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/delete_button.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/exceptions.rb +0 -25
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/field_set.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/fields_for.rb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/file_field.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/foo.rb +0 -23
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/form.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/form_for.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/hacker.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/hidden_field.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/label.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/numeric_ext.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/option_tag.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/password_field.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/radio_button.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/radio_group.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/relative_date.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/relative_date_span.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/select.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/specs_controller.rb +0 -13
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/submit.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/tag_helper.rb +0 -23
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/text_area.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/controllers/text_field.rb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/helpers/global_helpers.rb +0 -7
- data/spec/rango/helpers/merb-helpers/fixture/app/models/fake_dm_model.rb +0 -27
- data/spec/rango/helpers/merb-helpers/fixture/app/models/first_generic_fake_model.rb +0 -59
- data/spec/rango/helpers/merb-helpers/fixture/app/models/hacker_generic_model.rb +0 -7
- data/spec/rango/helpers/merb-helpers/fixture/app/models/second_generic_fake_model.rb +0 -20
- data/spec/rango/helpers/merb-helpers/fixture/app/models/third_generic_fake_model.rb +0 -5
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_check_box_specs/basic.html.erb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_check_box_specs/basic_unchecked.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_check_box_specs/checked.html.erb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_check_box_specs/errors.html.erb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_check_box_specs/label.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_check_box_specs/on_and_off.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_check_box_specs/raise_value_error.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_file_field_specs/additional_attributes.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_file_field_specs/takes_string.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_file_field_specs/with_label.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_hidden_field_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_hidden_field_specs/errors.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_hidden_field_specs/hidden_error.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_hidden_field_specs/label.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_option_tag_specs/grouped.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_option_tag_specs/nested.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_option_tag_specs/text_and_value.html.erb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_password_field_specs/attributes.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_password_field_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_password_field_specs/label.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_radio_button_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_radio_group_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_radio_group_specs/hashes.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_radio_group_specs/mixed.html.erb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_radio_group_specs/override_id.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_select_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_select_specs/blank.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_select_specs/label.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_select_specs/multiple.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_select_specs/prompt.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_select_specs/with_options.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_select_specs/with_options_with_blank.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_text_area_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_text_area_specs/label.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/bound_text_field_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/button_specs/button_with_label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/button_specs/button_with_values.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/button_specs/disabled_button.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/boolean.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/disabled.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/on_off_is_boolean.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/raise_unless_both_on_and_off.html.erb +0 -2
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/raises_error_if_not_boolean.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/raises_error_if_on_off_and_boolean_false.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/simple.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/to_string.html.erb +0 -8
- data/spec/rango/helpers/merb-helpers/fixture/app/views/check_box_specs/unchecked.html.erb +0 -2
- data/spec/rango/helpers/merb-helpers/fixture/app/views/custom_builder_specs/everything.html.erb +0 -10
- data/spec/rango/helpers/merb-helpers/fixture/app/views/delete_button_specs/delete_with_explicit_url.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/delete_button_specs/delete_with_extra_params.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/delete_button_specs/delete_with_label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/delete_button_specs/simple_delete.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/exeptions/client_error.html.erb +0 -37
- data/spec/rango/helpers/merb-helpers/fixture/app/views/exeptions/internal_server_error.html.erb +0 -216
- data/spec/rango/helpers/merb-helpers/fixture/app/views/exeptions/not_acceptable.html.erb +0 -38
- data/spec/rango/helpers/merb-helpers/fixture/app/views/exeptions/not_found.html.erb +0 -40
- data/spec/rango/helpers/merb-helpers/fixture/app/views/fields_for_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/fields_for_specs/midstream.html.erb +0 -7
- data/spec/rango/helpers/merb-helpers/fixture/app/views/fields_for_specs/nil.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/fieldset_specs/legend.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/file_field_specs/disabled.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/file_field_specs/makes_multipart.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/file_field_specs/with_label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/file_field_specs/with_values.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/foo/bar.html.erb +0 -0
- data/spec/rango/helpers/merb-helpers/fixture/app/views/form_for_specs/basic.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/form_specs/create_a_form.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/form_specs/create_a_multipart_form.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/form_specs/fake_delete_if_set.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/form_specs/fake_put_if_set.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/form_specs/get_if_set.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/form_specs/post_by_default.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/form_specs/resourceful_form.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hacker/file_field.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hacker/hidden_field.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hacker/option_tag.html.erb +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hacker/password_field.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hacker/radio_button.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hacker/radio_group.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hacker/text_area.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hacker/text_field.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hidden_field_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hidden_field_specs/disabled.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/hidden_field_specs/label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/label_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/label_specs/basic_with_attributes.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/label_specs/basic_with_class.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/layout/application.html.erb +0 -11
- data/spec/rango/helpers/merb-helpers/fixture/app/views/numeric_ext_specs/minutes_to_hours.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/numeric_ext_specs/to_concurrency_default.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/numeric_ext_specs/two_digits.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/array.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/clean.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/collection.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/multiple_selects.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/no_extra_attributes.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/optgroups.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/selected.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/with_blank.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/option_tag_specs/with_prompt.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/password_field_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/password_field_specs/disabled.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_button_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_button_specs/checked.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_button_specs/disabled.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_button_specs/label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_button_specs/unchecked.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_group_specs/attributes.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_group_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_group_specs/checked.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_group_specs/hash.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/radio_group_specs/specific_attributes.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/relative_date_span_specs/date_span_on_same_day.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/relative_date_span_specs/date_span_on_same_day_on_different_year.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/relative_date_specs/relative_date_with_year.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/relative_date_specs/relative_date_without_year.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/relative_date_specs/relative_today.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/relative_date_specs/relative_tomorrow.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/relative_date_specs/relative_yesterday.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/select_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/select_specs/blank.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/select_specs/multiple.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/select_specs/selected.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/submit_specs/disabled_submit.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/submit_specs/submit_with_label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/submit_specs/submit_with_values.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/tag_helper/nested_tags.html.erb +0 -5
- data/spec/rango/helpers/merb-helpers/fixture/app/views/tag_helper/tag_with_attributes.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/tag_helper/tag_with_content.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/tag_helper/tag_with_content_in_the_block.html.erb +0 -3
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_area_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_area_specs/disabled.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_area_specs/label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_area_specs/nil.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_field_specs/basic.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_field_specs/class.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_field_specs/disabled.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_field_specs/label.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/app/views/text_field_specs/symbolized_name.html.erb +0 -1
- data/spec/rango/helpers/merb-helpers/fixture/config/environments/development.rb +0 -8
- data/spec/rango/helpers/merb-helpers/fixture/config/environments/production.rb +0 -7
- data/spec/rango/helpers/merb-helpers/fixture/config/environments/test.rb +0 -8
- data/spec/rango/helpers/merb-helpers/fixture/config/init.rb +0 -48
- data/spec/rango/helpers/merb-helpers/fixture/config/rack.rb +0 -13
- data/spec/rango/helpers/merb-helpers/fixture/config/router.rb +0 -40
- data/spec/rango/helpers/merb-helpers/fixture/public/images/merb.jpg +0 -0
- data/spec/rango/helpers/merb-helpers/fixture/public/merb.fcgi +0 -4
- data/spec/rango/helpers/merb-helpers/fixture/public/stylesheets/master.css +0 -119
- data/spec/rango/helpers/merb-helpers/form/builder_spec.rb +0 -0
- data/spec/rango/helpers/merb-helpers/form/helpers_spec.rb +0 -0
- data/spec/rango/helpers/merb-helpers/form_helpers_spec.rb +0 -0
- data/spec/rango/helpers/merb-helpers/merb_helpers_config_spec.rb +0 -85
- data/spec/rango/helpers/merb-helpers/merb_helpers_date_time_spec.rb +0 -270
- data/spec/rango/helpers/merb-helpers/merb_helpers_form_spec.rb +0 -1372
- data/spec/rango/helpers/merb-helpers/merb_helpers_tag_helper_spec.rb +0 -46
- data/spec/rango/helpers/merb-helpers/merb_helpers_text_spec.rb +0 -71
- data/spec/rango/helpers/merb-helpers/numeric_extlib_spec.rb +0 -138
- data/spec/rango/helpers/merb-helpers/ordinalize_spec.rb +0 -55
- data/spec/rango/helpers/merb-helpers/tag_helpers_spec.rb +0 -0
- data/spec/rango/helpers/merb-helpers/text_helpers_spec.rb +0 -0
- data/spec/rango/helpers/merb-helpers_spec.rb +0 -0
- data/spec/rango/mixins/chainable_spec.rb +0 -0
- data/spec/rango/mixins/hookable_spec.rb +0 -0
- data/spec/rango/mixins/import_spec.rb +0 -0
- data/spec/rango/mixins/mini_spec.rb +0 -0
- data/spec/rango/mixins/strategy_spec.rb +0 -0
- data/spec/rango/rango_spec.rb +0 -0
- data/spec/rango/templates/adapter_spec.rb +0 -0
- data/spec/rango/templates/adapters/erb_spec.rb +0 -0
- data/spec/rango/templates/adapters/erubis_spec.rb +0 -117
- data/spec/rango/templates/adapters/haml_spec.rb +0 -0
- data/spec/rango/templates/adapters/template_helpers.rb +0 -38
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
# Make the app's "gems" directory a place where gems are loaded from
|
|
4
|
-
Gem.clear_paths
|
|
5
|
-
Gem.path.unshift(Rango.root / "gems")
|
|
6
|
-
|
|
7
|
-
# Make the app's "lib" directory a place where ruby files get "require"d from
|
|
8
|
-
$LOAD_PATH.unshift(Rango.root / "lib")
|
|
9
|
-
|
|
10
|
-
Rango::Config.use { |c|
|
|
11
|
-
c[:session_store] = 'cookie'
|
|
12
|
-
c[:session_secret_key] = "2c24532b38b8c46d8acf1b5ed71bdd5426dadd9b"
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
### Rango doesn't come with database support by default. You need
|
|
16
|
-
### an ORM plugin. Install one, and uncomment one of the following lines,
|
|
17
|
-
### if you need a database.
|
|
18
|
-
|
|
19
|
-
### Uncomment for DataMapper ORM
|
|
20
|
-
# use_orm :datamapper
|
|
21
|
-
|
|
22
|
-
### Uncomment for ActiveRecord ORM
|
|
23
|
-
# use_orm :activerecord
|
|
24
|
-
|
|
25
|
-
### Uncomment for Sequel ORM
|
|
26
|
-
# use_orm :sequel
|
|
27
|
-
|
|
28
|
-
### This defines which test framework the generators will use
|
|
29
|
-
### rspec is turned on by default
|
|
30
|
-
# use_test :test_unit
|
|
31
|
-
# use_test :rspec
|
|
32
|
-
|
|
33
|
-
### Add your other dependencies here
|
|
34
|
-
|
|
35
|
-
# These are some examples of how you might specify dependencies.
|
|
36
|
-
#
|
|
37
|
-
# dependencies "RedCloth", "merb_helpers"
|
|
38
|
-
# OR
|
|
39
|
-
# dependency "RedCloth", "> 3.0"
|
|
40
|
-
# OR
|
|
41
|
-
# dependencies "RedCloth" => "> 3.0", "ruby-aes-cext" => "= 1.0"
|
|
42
|
-
dependency File.join(File.dirname(__FILE__),'..','..','..','lib','merb-helpers')
|
|
43
|
-
|
|
44
|
-
Rango::BootLoader.after_app_loads do
|
|
45
|
-
### Add dependencies here that must load after the application loads:
|
|
46
|
-
|
|
47
|
-
# dependency "magic_admin" # this gem uses the app's model classes
|
|
48
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
# use PathPrefix Middleware if :path_prefix is set in Rango::Config
|
|
4
|
-
if prefix = ::Rango::Config[:path_prefix]
|
|
5
|
-
use Rango::Rack::PathPrefix, prefix
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
# comment this out if you are running merb behind a load balancer
|
|
9
|
-
# that serves static files
|
|
10
|
-
use Rango::Rack::Static, Rango.dir_for(:public)
|
|
11
|
-
|
|
12
|
-
# this is our main merb application
|
|
13
|
-
run Rango::Rack::Application.new
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
# Rango::Router is the request routing mapper for the merb framework.
|
|
4
|
-
#
|
|
5
|
-
# You can route a specific URL to a controller / action pair:
|
|
6
|
-
#
|
|
7
|
-
# r.match("/contact").
|
|
8
|
-
# to(:controller => "info", :action => "contact")
|
|
9
|
-
#
|
|
10
|
-
# You can define placeholder parts of the url with the :symbol notation. These
|
|
11
|
-
# placeholders will be available in the params hash of your controllers. For example:
|
|
12
|
-
#
|
|
13
|
-
# r.match("/books/:book_id/:action").
|
|
14
|
-
# to(:controller => "books")
|
|
15
|
-
#
|
|
16
|
-
# Or, use placeholders in the "to" results for more complicated routing, e.g.:
|
|
17
|
-
#
|
|
18
|
-
# r.match("/admin/:module/:controller/:action/:id").
|
|
19
|
-
# to(:controller => ":module/:controller")
|
|
20
|
-
#
|
|
21
|
-
# You can also use regular expressions, deferred routes, and many other options.
|
|
22
|
-
# See merb/specs/merb/router.rb for a fairly complete usage sample.
|
|
23
|
-
|
|
24
|
-
Rango.logger.info("Compiling routes...")
|
|
25
|
-
Rango::Router.prepare do |r|
|
|
26
|
-
# RESTful routes
|
|
27
|
-
# r.resources :posts
|
|
28
|
-
resources :fake_models
|
|
29
|
-
resources :obj
|
|
30
|
-
resources :models
|
|
31
|
-
|
|
32
|
-
# This is the default route for /:controller/:action/:id
|
|
33
|
-
# This is fine for most cases. If you're heavily using resource-based
|
|
34
|
-
# routes, you may want to comment/remove this line to prevent
|
|
35
|
-
# clients from calling your create or destroy actions with a GET
|
|
36
|
-
r.default_routes
|
|
37
|
-
|
|
38
|
-
# Change this for your home page to be available at /
|
|
39
|
-
# r.match('/').to(:controller => 'whatever', :action =>'index')
|
|
40
|
-
end
|
|
Binary file
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
body {
|
|
2
|
-
font-family: Arial, Verdana, sans-serif;
|
|
3
|
-
font-size: 12px;
|
|
4
|
-
background-color: #fff;
|
|
5
|
-
}
|
|
6
|
-
* {
|
|
7
|
-
margin: 0px;
|
|
8
|
-
padding: 0px;
|
|
9
|
-
text-decoration: none;
|
|
10
|
-
}
|
|
11
|
-
html {
|
|
12
|
-
height: 100%;
|
|
13
|
-
margin-bottom: 1px;
|
|
14
|
-
}
|
|
15
|
-
#container {
|
|
16
|
-
width: 80%;
|
|
17
|
-
text-align: left;
|
|
18
|
-
background-color: #fff;
|
|
19
|
-
margin-right: auto;
|
|
20
|
-
margin-left: auto;
|
|
21
|
-
}
|
|
22
|
-
#header-container {
|
|
23
|
-
width: 100%;
|
|
24
|
-
padding-top: 15px;
|
|
25
|
-
}
|
|
26
|
-
#header-container h1, #header-container h2 {
|
|
27
|
-
margin-left: 6px;
|
|
28
|
-
margin-bottom: 6px;
|
|
29
|
-
}
|
|
30
|
-
.spacer {
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 15px;
|
|
33
|
-
}
|
|
34
|
-
hr {
|
|
35
|
-
border: 0px;
|
|
36
|
-
color: #ccc;
|
|
37
|
-
background-color: #cdcdcd;
|
|
38
|
-
height: 1px;
|
|
39
|
-
width: 100%;
|
|
40
|
-
text-align: left;
|
|
41
|
-
}
|
|
42
|
-
h1 {
|
|
43
|
-
font-size: 28px;
|
|
44
|
-
color: #c55;
|
|
45
|
-
background-color: #fff;
|
|
46
|
-
font-family: Arial, Verdana, sans-serif;
|
|
47
|
-
font-weight: 300;
|
|
48
|
-
}
|
|
49
|
-
h2 {
|
|
50
|
-
font-size: 15px;
|
|
51
|
-
color: #999;
|
|
52
|
-
font-family: Arial, Verdana, sans-serif;
|
|
53
|
-
font-weight: 300;
|
|
54
|
-
background-color: #fff;
|
|
55
|
-
}
|
|
56
|
-
h3 {
|
|
57
|
-
color: #4d9b12;
|
|
58
|
-
font-size: 15px;
|
|
59
|
-
text-align: left;
|
|
60
|
-
font-weight: 300;
|
|
61
|
-
padding: 5px;
|
|
62
|
-
margin-top: 5px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
#left-container {
|
|
66
|
-
float: left;
|
|
67
|
-
width: 250px;
|
|
68
|
-
background-color: #FFFFFF;
|
|
69
|
-
color: black;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
#left-container h3 {
|
|
73
|
-
color: #c55;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
#main-container {
|
|
77
|
-
margin: 5px 5px 5px 260px;
|
|
78
|
-
padding: 15px;
|
|
79
|
-
border-left: 1px solid silver;
|
|
80
|
-
min-height: 400px;
|
|
81
|
-
}
|
|
82
|
-
p {
|
|
83
|
-
color: #000;
|
|
84
|
-
background-color: #fff;
|
|
85
|
-
line-height: 20px;
|
|
86
|
-
padding: 5px;
|
|
87
|
-
}
|
|
88
|
-
a {
|
|
89
|
-
color: #4d9b12;
|
|
90
|
-
background-color: #fff;
|
|
91
|
-
text-decoration: none;
|
|
92
|
-
}
|
|
93
|
-
a:hover {
|
|
94
|
-
color: #4d9b12;
|
|
95
|
-
background-color: #fff;
|
|
96
|
-
text-decoration: underline;
|
|
97
|
-
}
|
|
98
|
-
#footer-container {
|
|
99
|
-
clear: both;
|
|
100
|
-
font-size: 12px;
|
|
101
|
-
font-family: Verdana, Arial, sans-serif;
|
|
102
|
-
}
|
|
103
|
-
.right {
|
|
104
|
-
float: right;
|
|
105
|
-
font-size: 100%;
|
|
106
|
-
margin-top: 5px;
|
|
107
|
-
color: #999;
|
|
108
|
-
background-color: #fff;
|
|
109
|
-
}
|
|
110
|
-
.left {
|
|
111
|
-
float: left;
|
|
112
|
-
font-size: 100%;
|
|
113
|
-
margin-top: 5px;
|
|
114
|
-
color: #999;
|
|
115
|
-
background-color: #fff;
|
|
116
|
-
}
|
|
117
|
-
#main-container ul {
|
|
118
|
-
margin-left: 3.0em;
|
|
119
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
__END__
|
|
4
|
-
require_relative "../../../spec_helper"
|
|
5
|
-
FIXTURES_DIR = File.dirname(__FILE__) + '/fixtures'
|
|
6
|
-
MERB_HELPERS_ROOT = File.dirname(__FILE__) + "/.."
|
|
7
|
-
|
|
8
|
-
describe "loading configuration" do
|
|
9
|
-
|
|
10
|
-
before :each do
|
|
11
|
-
#unload_merb_helpers
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
after :all do
|
|
15
|
-
#reload_merb_helpers
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it "should not have any helper available now" do
|
|
19
|
-
#unload_merb_helpers
|
|
20
|
-
defined?(Rango::Helpers).should be_nil
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it "should load #reload_merb_helpers" do
|
|
24
|
-
#unload_merb_helpers
|
|
25
|
-
#reload_merb_helpers
|
|
26
|
-
defined?(Rango::Helpers).should_not be_nil
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "should load all helpers by default" do
|
|
30
|
-
#reload_merb_helpers
|
|
31
|
-
defined?(Rango::Helpers).should_not be_nil
|
|
32
|
-
defined?(Rango::Helpers::Form).should_not be_nil
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
it "should load all helpers by default" do
|
|
36
|
-
Rango::Plugins.should_receive(:config).any_number_of_times.and_return({})
|
|
37
|
-
#reload_merb_helpers
|
|
38
|
-
defined?(Rango::Helpers).should_not be_nil
|
|
39
|
-
defined?(Rango::Helpers::DateAndTime).should_not be_nil
|
|
40
|
-
defined?(Rango::Helpers::Form)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it "should only load the helpers specified in the config hash (if defined)" do
|
|
44
|
-
#unload_merb_helpers
|
|
45
|
-
defined?(Rango::Helpers).should be_nil
|
|
46
|
-
defined?(Rango::Helpers::DateAndTime).should be_nil
|
|
47
|
-
Rango::Plugins.stub!(:config).and_return(:merb_helpers => {:include => "form_helpers"})
|
|
48
|
-
#reload_merb_helpers
|
|
49
|
-
defined?(Rango::Helpers).should_not be_nil
|
|
50
|
-
defined?(Rango::Helpers::Form).should_not be_nil
|
|
51
|
-
defined?(Rango::Helpers::DateAndTime).should be_nil
|
|
52
|
-
|
|
53
|
-
#unload_merb_helpers
|
|
54
|
-
defined?(Rango::Helpers).should be_nil
|
|
55
|
-
defined?(Rango::Helpers::DateAndTime).should be_nil
|
|
56
|
-
Rango::Plugins.stub!(:config).and_return(:merb_helpers => {:include => ["form_helpers", "date_time_helpers"]})
|
|
57
|
-
#reload_merb_helpers
|
|
58
|
-
defined?(Rango::Helpers).should_not be_nil
|
|
59
|
-
defined?(Rango::Helpers::Form).should_not be_nil
|
|
60
|
-
defined?(Rango::Helpers::DateAndTime).should_not be_nil
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
it "should load all helpers if the include hash is empty" do
|
|
64
|
-
#unload_merb_helpers
|
|
65
|
-
defined?(Rango::Helpers).should be_nil
|
|
66
|
-
defined?(Rango::Helpers::DateAndTime).should be_nil
|
|
67
|
-
Rango::Plugins.stub!(:config).and_return(:merb_helpers => {:include => ""})
|
|
68
|
-
#reload_merb_helpers
|
|
69
|
-
defined?(Rango::Helpers).should_not be_nil
|
|
70
|
-
defined?(Rango::Helpers::Form).should_not be_nil
|
|
71
|
-
defined?(Rango::Helpers::DateAndTime).should_not be_nil
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
it "should load helpers if the plugin conf is defined but the include pair is missing" do
|
|
75
|
-
#unload_merb_helpers
|
|
76
|
-
defined?(Rango::Helpers).should be_nil
|
|
77
|
-
defined?(Rango::Helpers::DateAndTime).should be_nil
|
|
78
|
-
Rango::Plugins.stub!(:config).and_return(:merb_helpers => {})
|
|
79
|
-
#reload_merb_helpers
|
|
80
|
-
defined?(Rango::Helpers).should_not be_nil
|
|
81
|
-
defined?(Rango::Helpers::Form).should_not be_nil
|
|
82
|
-
defined?(Rango::Helpers::DateAndTime).should_not be_nil
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
end
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require_relative "../../../spec_helper"
|
|
3
|
-
require "rango/helpers/merb-helpers/date_time_helpers"
|
|
4
|
-
|
|
5
|
-
__END__
|
|
6
|
-
describe "relative_date" do
|
|
7
|
-
include Rango::Helpers::DateAndTime
|
|
8
|
-
|
|
9
|
-
before :each do
|
|
10
|
-
Time.stub!(:now).and_return(Time.utc(2007, 6, 1, 11))
|
|
11
|
-
@controller = RelativeDateSpecs.new(Rango::Request.new({}))
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it "should show today" do
|
|
15
|
-
relative_date(Time.now.utc).should == "today"
|
|
16
|
-
result = @controller.render :relative_today
|
|
17
|
-
result.should == "today"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
it "should show yesterday" do
|
|
21
|
-
relative_date(1.day.ago.utc).should == 'yesterday'
|
|
22
|
-
result = @controller.render :relative_yesterday
|
|
23
|
-
result.should == "yesterday"
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "should show tomorrow" do
|
|
27
|
-
relative_date(1.day.from_now.utc).should == 'tomorrow'
|
|
28
|
-
@controller.render(:relative_tomorrow).should == 'tomorrow'
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it "should show date with year" do
|
|
32
|
-
relative_date(Time.utc(2005, 11, 15)).should == 'Nov 15th, 2005'
|
|
33
|
-
@controller.render(:relative_date_with_year).should == 'Nov 15th, 2005'
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it "should show date" do
|
|
37
|
-
relative_date(Time.utc(2007, 11, 15)).should == 'Nov 15th'
|
|
38
|
-
@controller.render(:relative_date_without_year).should == 'Nov 15th'
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
describe "relative_date_span" do
|
|
43
|
-
include Rango::Helpers::DateAndTime
|
|
44
|
-
|
|
45
|
-
before :each do
|
|
46
|
-
Time.stub!(:now).and_return(Time.utc(2007, 6, 1, 11))
|
|
47
|
-
@controller = RelativeDateSpanSpecs.new(Rango::Request.new({}))
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it "should show date span on the same day" do
|
|
51
|
-
relative_date_span([Time.utc(2007, 11, 15), Time.utc(2007, 11, 15)]).should == 'Nov 15th'
|
|
52
|
-
@controller.render(:date_span_on_same_day).should == 'Nov 15th'
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
it "should show date span on the same day on different year" do
|
|
56
|
-
relative_date_span([Time.utc(2006, 11, 15), Time.utc(2006, 11, 15)]).should == 'Nov 15th, 2006'
|
|
57
|
-
@controller.render(:date_span_on_same_day_on_different_year).should == 'Nov 15th, 2006'
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
it "should show date span on the same month" do
|
|
61
|
-
relative_date_span([Time.utc(2007, 11, 15), Time.utc(2007, 11, 16)]).should == 'Nov 15th - 16th'
|
|
62
|
-
relative_date_span([Time.utc(2007, 11, 16), Time.utc(2007, 11, 15)]).should == 'Nov 15th - 16th'
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
it "should show date span on the same month on different year" do
|
|
66
|
-
relative_date_span([Time.utc(2006, 11, 15), Time.utc(2006, 11, 16)]).should == 'Nov 15th - 16th, 2006'
|
|
67
|
-
relative_date_span([Time.utc(2006, 11, 16), Time.utc(2006, 11, 15)]).should == 'Nov 15th - 16th, 2006'
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
it "should show date span on the different month" do
|
|
71
|
-
relative_date_span([Time.utc(2007, 11, 15), Time.utc(2007, 12, 16)]).should == 'Nov 15th - Dec 16th'
|
|
72
|
-
relative_date_span([Time.utc(2007, 12, 16), Time.utc(2007, 11, 15)]).should == 'Nov 15th - Dec 16th'
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
it "should show date span on the different month on different year" do
|
|
76
|
-
relative_date_span([Time.utc(2006, 11, 15), Time.utc(2006, 12, 16)]).should == 'Nov 15th - Dec 16th, 2006'
|
|
77
|
-
relative_date_span([Time.utc(2006, 12, 16), Time.utc(2006, 11, 15)]).should == 'Nov 15th - Dec 16th, 2006'
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
it "should show date span on the different year" do
|
|
81
|
-
relative_date_span([Time.utc(2006, 11, 15), Time.utc(2007, 12, 16)]).should == 'Nov 15th, 2006 - Dec 16th, 2007'
|
|
82
|
-
relative_date_span([Time.utc(2007, 12, 16), Time.utc(2006, 11, 15)]).should == 'Nov 15th, 2006 - Dec 16th, 2007'
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
describe "relative_time_span" do
|
|
87
|
-
include Rango::Helpers::DateAndTime
|
|
88
|
-
|
|
89
|
-
before :each do
|
|
90
|
-
Time.stub!(:now).and_return(Time.utc(2007, 6, 1, 11))
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# Time, Single Date
|
|
94
|
-
it "should show time span on the same day with same time" do
|
|
95
|
-
relative_time_span([Time.utc(2007, 11, 15, 17, 00, 00)]).should == '5:00 PM Nov 15th'
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
it "should show time span on the same day with same time on different year" do
|
|
99
|
-
relative_time_span([Time.utc(2006, 11, 15, 17, 0), Time.utc(2006, 11, 15, 17, 0)]).should == '5:00 PM Nov 15th, 2006'
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
it "should show time span on the same day with different times in same half of day" do
|
|
103
|
-
relative_time_span([Time.utc(2007, 11, 15, 10), Time.utc(2007, 11, 15, 11, 0)]).should == '10:00 - 11:00 AM Nov 15th'
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
it "should show time span on the same day with different times in different half of day" do
|
|
107
|
-
relative_time_span([Time.utc(2007, 11, 15, 10, 0), Time.utc(2007, 11, 15, 14, 0)]).should == '10:00 AM - 2:00 PM Nov 15th'
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
it "should show time span on the same day with different times in different half of day in different year" do
|
|
111
|
-
relative_time_span([Time.utc(2006, 11, 15, 10, 0), Time.utc(2006, 11, 15, 14, 0)]).should == '10:00 AM - 2:00 PM Nov 15th, 2006'
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
it "should show time span on different days in same year" do
|
|
115
|
-
relative_time_span([Time.utc(2006, 11, 15, 10, 0), Time.utc(2006, 12, 16, 14, 0)]).should == '10:00 AM Nov 15th - 2:00 PM Dec 16th, 2006'
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
it "should show time span on different days in different years" do
|
|
119
|
-
relative_time_span([Time.utc(2006, 11, 15, 10, 0), Time.utc(2007, 12, 16, 14, 0)]).should == '10:00 AM Nov 15th, 2006 - 2:00 PM Dec 16th, 2007'
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
it "should show time span on different days in current year" do
|
|
123
|
-
relative_time_span([Time.utc(2007, 11, 15, 10, 0), Time.utc(2007, 12, 16, 14, 0)]).should == '10:00 AM Nov 15th - 2:00 PM Dec 16th'
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
|
|
127
|
-
describe "time_lost_in_words" do
|
|
128
|
-
include Rango::Helpers::DateAndTime
|
|
129
|
-
|
|
130
|
-
it "should show seconds" do
|
|
131
|
-
time_lost_in_words(Time.now, Time.now, true).should == "less than 5 seconds"
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
it "should not show seconds" do
|
|
135
|
-
time_lost_in_words(Time.now).should == "less than a minute"
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
it "should do minutes" do
|
|
139
|
-
time_lost_in_words(2.minutes.ago).should == "2 minutes"
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
it "should do hour" do
|
|
143
|
-
time_lost_in_words(50.minutes.ago).should == "about 1 hour"
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
it "should do hours" do
|
|
147
|
-
time_lost_in_words(2.hours.ago).should == "about 2 hours"
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
it "should do day" do
|
|
151
|
-
time_lost_in_words(1.day.ago).should == "1 day"
|
|
152
|
-
end
|
|
153
|
-
|
|
154
|
-
it "should do days" do
|
|
155
|
-
time_lost_in_words(5.days.ago).should == "5 days"
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
it "should do month" do
|
|
159
|
-
time_lost_in_words(1.month.ago).should == "about 1 month"
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
it "should do months" do
|
|
163
|
-
time_lost_in_words(5.months.ago).should == "5 months"
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
it "should do year" do
|
|
167
|
-
time_lost_in_words(1.2.years.ago).should == "about 1 year"
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
it "should do years" do
|
|
171
|
-
time_lost_in_words(5.5.years.ago).should == "over 5 years"
|
|
172
|
-
end
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
describe "prettier_time" do
|
|
176
|
-
include Rango::Helpers::DateAndTime
|
|
177
|
-
|
|
178
|
-
# prettier time"
|
|
179
|
-
it "should not show leading zero in hour" do
|
|
180
|
-
prettier_time(Time.utc(2007, 11, 15, 14, 0)).should == '2:00 PM'
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
it "should convert to 12 hour time" do
|
|
184
|
-
prettier_time(Time.utc(2007, 11, 15, 2, 0)).should == '2:00 AM'
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
it "should handle midnight correctly" do
|
|
188
|
-
prettier_time(Time.utc(2007, 11, 15, 0, 0)).should == '12:00 AM'
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
shared_examples_for "Date, DateTime, Time formatting" do
|
|
193
|
-
|
|
194
|
-
before(:each) do
|
|
195
|
-
Date.reset_formats
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
it "should list the available formats" do
|
|
199
|
-
Date.formats.should be_an_instance_of(Hash)
|
|
200
|
-
Date.formats.keys.length.should > 1
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
it "should support to be db formatted" do
|
|
204
|
-
@date.formatted(:db).should =~ /^2007-11-02 \d{2}:\d{2}:\d{2}$/
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
it "should support to be time formatted" do
|
|
208
|
-
@date.formatted(:time).should == "00:00"
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
it "should support to be short formatted" do
|
|
212
|
-
@date.formatted(:short).should == "02 Nov 00:00"
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
it "should support to be date formatted" do
|
|
216
|
-
@date.formatted(:date).should == "2007-11-02"
|
|
217
|
-
end
|
|
218
|
-
|
|
219
|
-
it "should support to be long formatted" do
|
|
220
|
-
@date.formatted(:long).should == "November 02, 2007 00:00"
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
it "should support a new date format" do
|
|
224
|
-
@date.formatted(:matt).should == @date.to_s
|
|
225
|
-
Date.add_format(:matt, "%H:%M:%S %Y-%m-%d")
|
|
226
|
-
@date.formatted(:matt).should == "00:00:00 2007-11-02"
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
describe "Date" do
|
|
232
|
-
before :each do
|
|
233
|
-
@date = Date.new(2007, 11, 02)
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
it "should do to_time conversion and return a Time class" do
|
|
237
|
-
@date.is_a?(Date)
|
|
238
|
-
@date.to_time.is_a?(Time)
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
it "should do to_time conversion to utc by default" do
|
|
242
|
-
@date.to_time.to_s.should == 'Fri Nov 02 00:00:00 UTC 2007'
|
|
243
|
-
end
|
|
244
|
-
|
|
245
|
-
it "should do to_time conversion to utc when param :utc is given" do
|
|
246
|
-
@date.to_time(:utc).to_s.should == 'Fri Nov 02 00:00:00 UTC 2007'
|
|
247
|
-
end
|
|
248
|
-
|
|
249
|
-
it "should do to_time conversion to local time when param :local is given" do
|
|
250
|
-
pending("Needs to have the call to figure out the local time stubbed so this test will work no matter what your local TZ is.")
|
|
251
|
-
@date.to_time(:local).to_s.should == 'Fri Nov 02 00:00:00 -0500 2007'
|
|
252
|
-
end
|
|
253
|
-
|
|
254
|
-
it "should return itself when to_date is called" do
|
|
255
|
-
@date.to_date.should == @date
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
it_should_behave_like "Date, DateTime, Time formatting"
|
|
259
|
-
|
|
260
|
-
end
|
|
261
|
-
|
|
262
|
-
describe "DateTime" do
|
|
263
|
-
|
|
264
|
-
before(:each) do
|
|
265
|
-
@date = DateTime.new(2007, 11, 02)
|
|
266
|
-
end
|
|
267
|
-
|
|
268
|
-
it_should_behave_like "Date, DateTime, Time formatting"
|
|
269
|
-
|
|
270
|
-
end
|