rango 0.2.3 → 0.2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -2
- data/CHANGELOG +9 -0
- data/CONTRIBUTORS +0 -1
- data/Gemfile +2 -6
- data/lib/rango.rb +10 -7
- data/lib/rango/cli.rb +1 -1
- data/lib/rango/contrib/pagination/adapters/sequel.rb +6 -2
- data/lib/rango/controller.rb +24 -20
- data/lib/rango/core_ext.rb +54 -59
- data/lib/rango/exceptions.rb +2 -2
- data/lib/rango/gv/router.rb +1 -1
- data/lib/rango/gv/scaffolding.rb +0 -1
- data/lib/rango/mailer.rb +20 -40
- data/lib/rango/mixins/action_args.rb +8 -7
- data/lib/rango/mixins/filters.rb +1 -0
- data/lib/rango/mixins/message.rb +37 -33
- data/lib/rango/mixins/rack-flash.rb +44 -0
- data/{benchmarks/stubs/merb-app/spec/spec.opts → lib/rango/orm/tasks/ripple.nake} +0 -0
- data/lib/rango/rack/request.rb +12 -15
- data/lib/rango/router.rb +7 -3
- data/lib/rango/router/adapters/crudtree.rb +8 -1
- data/lib/rango/router/adapters/rack_mount.rb +5 -1
- data/lib/rango/router/adapters/usher.rb +5 -2
- data/lib/rango/stacks/controller.rb +0 -1
- data/lib/rango/templates/exts/haml.rb +14 -15
- data/lib/rango/templates/exts/tilt.rb +16 -23
- data/lib/rango/templates/helpers.rb +10 -1
- data/lib/rango/templates/template.rb +4 -4
- data/lib/rango/utils.rb +4 -2
- data/lib/rango/version.rb +5 -0
- data/rango.gemspec +3 -2
- data/{benchmarks/stubs/merb-core/spec/spec.opts → spec/rango/cli_spec.rb} +0 -0
- data/{benchmarks/stubs/rails/log/development.log → spec/rango/contrib/pagination/adapters/sequel_spec.rb} +0 -0
- data/spec/rango/controller_spec.rb +12 -0
- data/spec/rango/core_ext_spec.rb +61 -0
- data/spec/rango/environments_spec.rb +1 -0
- data/spec/rango/exceptions_spec.rb +1 -28
- data/{benchmarks/stubs/rails/log/production.log → spec/rango/mailer_spec.rb} +0 -0
- data/spec/rango/mixins/action_args_spec.rb +0 -4
- data/spec/rango/mixins/message_spec.rb +20 -10
- data/{benchmarks/stubs/rails/log/server.log → spec/rango/mixins/rack-flash_spec.rb} +0 -0
- data/spec/rango/rack/request_spec.rb +11 -0
- data/{benchmarks/stubs/rails/log/test.log → spec/rango/router/adapters/crudtree_spec.rb} +0 -0
- data/spec/rango/templates/helpers_spec.rb +19 -5
- data/spec/rango/templates/template_spec.rb +1 -20
- data/{benchmarks/stubs/rails/public/favicon.ico → spec/rango/version_spec.rb} +0 -0
- data/spec/spec_helper.rb +18 -4
- data/stubs/stack/content/%name%.gemspec.rbt +0 -0
- data/stubs/stack/content/%name%.pre.gemspec.rbt +1 -2
- data/stubs/stack/content/.gitignore +2 -5
- data/stubs/stack/content/Gemfile.rbt +23 -46
- data/stubs/stack/content/config.ru.rbt +9 -21
- data/stubs/stack/content/init.rb.rbt +10 -10
- data/stubs/stack/content/lib/%name%.rb.rbt +37 -4
- data/stubs/stack/content/lib/%name%/initializers/01_database.rb.rbt +16 -0
- data/stubs/stack/content/lib/%name%/initializers/05_templates.rb.rbt +13 -0
- data/stubs/stack/content/lib/%name%/initializers/10_pagination.rb.rbt +8 -0
- data/stubs/stack/content/lib/%name%/initializers/15_warden.rb.rbt +26 -0
- data/stubs/stack/content/lib/%name%/initializers/45_middlewares.rb.rbt +17 -0
- data/stubs/stack/content/lib/%name%/initializers/50_router.rb.rbt +7 -0
- data/stubs/stack/content/lib/%name%/{initializers/urls.rb.rbt → urls.rb.rbt} +3 -0
- data/stubs/stack/content/lib/%name%/views.rb.rbt +4 -1
- data/stubs/stack/content/templates/index.html.haml +1 -1
- data/{gems → vendor}/cache/abstract-1.0.0.gem +0 -0
- data/vendor/cache/code-cleaner-0.8.2.gem +0 -0
- data/{gems → vendor}/cache/erubis-2.6.5.gem +0 -0
- data/vendor/cache/haml-2.2.21.gem +0 -0
- data/{gems → vendor}/cache/nake-0.0.8.gem +0 -0
- data/vendor/cache/rack-1.1.0.gem +0 -0
- data/{gems → vendor}/cache/rspec-1.3.0.gem +0 -0
- data/vendor/cache/term-ansicolor-1.0.5.gem +0 -0
- data/vendor/cache/tilt-0.8.gem +0 -0
- metadata +63 -239
- data/benchmarks/stubs/merb-app/.gitignore +0 -21
- data/benchmarks/stubs/merb-app/Rakefile +0 -35
- data/benchmarks/stubs/merb-app/app/controllers/application.rb +0 -4
- data/benchmarks/stubs/merb-app/app/controllers/exceptions.rb +0 -15
- data/benchmarks/stubs/merb-app/app/helpers/global_helpers.rb +0 -7
- data/benchmarks/stubs/merb-app/app/models/user.rb +0 -19
- data/benchmarks/stubs/merb-app/app/views/exceptions/not_acceptable.html.erb +0 -63
- data/benchmarks/stubs/merb-app/app/views/exceptions/not_found.html.erb +0 -47
- data/benchmarks/stubs/merb-app/app/views/layout/application.html.erb +0 -12
- data/benchmarks/stubs/merb-app/autotest/discover.rb +0 -4
- data/benchmarks/stubs/merb-app/autotest/merb.rb +0 -154
- data/benchmarks/stubs/merb-app/autotest/merb_rspec.rb +0 -167
- data/benchmarks/stubs/merb-app/config/database.yml +0 -33
- data/benchmarks/stubs/merb-app/config/dependencies.rb +0 -36
- data/benchmarks/stubs/merb-app/config/environments/development.rb +0 -17
- data/benchmarks/stubs/merb-app/config/environments/production.rb +0 -12
- data/benchmarks/stubs/merb-app/config/environments/rake.rb +0 -13
- data/benchmarks/stubs/merb-app/config/environments/staging.rb +0 -12
- data/benchmarks/stubs/merb-app/config/environments/test.rb +0 -14
- data/benchmarks/stubs/merb-app/config/init.rb +0 -26
- data/benchmarks/stubs/merb-app/config/rack.rb +0 -13
- data/benchmarks/stubs/merb-app/config/router.rb +0 -46
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/merb_generator.rb +0 -1364
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/api_grease.js +0 -640
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/index.html.erb +0 -37
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb.css +0 -252
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb.rb +0 -353
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb_doc_styles.css +0 -492
- data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/prototype.js +0 -2515
- data/benchmarks/stubs/merb-app/merb/merb-auth/setup.rb +0 -46
- data/benchmarks/stubs/merb-app/merb/merb-auth/strategies.rb +0 -13
- data/benchmarks/stubs/merb-app/merb/session/session.rb +0 -11
- data/benchmarks/stubs/merb-app/public/.htaccess +0 -17
- data/benchmarks/stubs/merb-app/public/favicon.ico +0 -0
- data/benchmarks/stubs/merb-app/public/images/merb.jpg +0 -0
- data/benchmarks/stubs/merb-app/public/javascripts/application.js +0 -1
- data/benchmarks/stubs/merb-app/public/javascripts/jquery.js +0 -19
- data/benchmarks/stubs/merb-app/public/merb.fcgi +0 -22
- data/benchmarks/stubs/merb-app/public/robots.txt +0 -5
- data/benchmarks/stubs/merb-app/public/stylesheets/master.css +0 -119
- data/benchmarks/stubs/merb-app/spec/spec_helper.rb +0 -27
- data/benchmarks/stubs/merb-app/tasks/doc.thor +0 -151
- data/benchmarks/stubs/merb-app/tasks/merb.thor/app_script.rb +0 -33
- data/benchmarks/stubs/merb-app/tasks/merb.thor/common.rb +0 -70
- data/benchmarks/stubs/merb-app/tasks/merb.thor/gem_ext.rb +0 -127
- data/benchmarks/stubs/merb-app/tasks/merb.thor/main.thor +0 -152
- data/benchmarks/stubs/merb-app/tasks/merb.thor/ops.rb +0 -95
- data/benchmarks/stubs/merb-app/tasks/merb.thor/utils.rb +0 -42
- data/benchmarks/stubs/merb-core/.gitignore +0 -21
- data/benchmarks/stubs/merb-core/Rakefile +0 -35
- data/benchmarks/stubs/merb-core/app/controllers/application.rb +0 -4
- data/benchmarks/stubs/merb-core/app/controllers/exceptions.rb +0 -15
- data/benchmarks/stubs/merb-core/app/helpers/global_helpers.rb +0 -7
- data/benchmarks/stubs/merb-core/app/views/exceptions/not_acceptable.html.erb +0 -63
- data/benchmarks/stubs/merb-core/app/views/exceptions/not_found.html.erb +0 -47
- data/benchmarks/stubs/merb-core/app/views/layout/application.html.erb +0 -12
- data/benchmarks/stubs/merb-core/autotest/discover.rb +0 -1
- data/benchmarks/stubs/merb-core/autotest/merb.rb +0 -151
- data/benchmarks/stubs/merb-core/autotest/merb_rspec.rb +0 -167
- data/benchmarks/stubs/merb-core/config/environments/development.rb +0 -17
- data/benchmarks/stubs/merb-core/config/environments/production.rb +0 -12
- data/benchmarks/stubs/merb-core/config/environments/rake.rb +0 -13
- data/benchmarks/stubs/merb-core/config/environments/staging.rb +0 -12
- data/benchmarks/stubs/merb-core/config/environments/test.rb +0 -14
- data/benchmarks/stubs/merb-core/config/init.rb +0 -27
- data/benchmarks/stubs/merb-core/config/rack.rb +0 -13
- data/benchmarks/stubs/merb-core/config/router.rb +0 -43
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/merb_generator.rb +0 -1364
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/api_grease.js +0 -640
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/index.html.erb +0 -37
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb.css +0 -252
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb.rb +0 -353
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb_doc_styles.css +0 -492
- data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/prototype.js +0 -2515
- data/benchmarks/stubs/merb-core/public/.htaccess +0 -17
- data/benchmarks/stubs/merb-core/public/favicon.ico +0 -0
- data/benchmarks/stubs/merb-core/public/images/merb.jpg +0 -0
- data/benchmarks/stubs/merb-core/public/javascripts/application.js +0 -1
- data/benchmarks/stubs/merb-core/public/merb.fcgi +0 -22
- data/benchmarks/stubs/merb-core/public/robots.txt +0 -5
- data/benchmarks/stubs/merb-core/public/stylesheets/master.css +0 -119
- data/benchmarks/stubs/merb-core/spec/spec_helper.rb +0 -22
- data/benchmarks/stubs/merb-core/tasks/merb.thor/app_script.rb +0 -33
- data/benchmarks/stubs/merb-core/tasks/merb.thor/common.rb +0 -70
- data/benchmarks/stubs/merb-core/tasks/merb.thor/gem_ext.rb +0 -127
- data/benchmarks/stubs/merb-core/tasks/merb.thor/main.thor +0 -152
- data/benchmarks/stubs/merb-core/tasks/merb.thor/ops.rb +0 -95
- data/benchmarks/stubs/merb-core/tasks/merb.thor/utils.rb +0 -42
- data/benchmarks/stubs/merb-flat/.gitignore +0 -21
- data/benchmarks/stubs/merb-flat/README.txt +0 -10
- data/benchmarks/stubs/merb-flat/Rakefile +0 -35
- data/benchmarks/stubs/merb-flat/application.rb +0 -17
- data/benchmarks/stubs/merb-flat/config/framework.rb +0 -9
- data/benchmarks/stubs/merb-flat/config/init.rb +0 -42
- data/benchmarks/stubs/merb-flat/spec/spec_helper.rb +0 -26
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/app_script.rb +0 -33
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/common.rb +0 -70
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/gem_ext.rb +0 -127
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/main.thor +0 -152
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/ops.rb +0 -95
- data/benchmarks/stubs/merb-flat/tasks/merb.thor/utils.rb +0 -42
- data/benchmarks/stubs/merb-flat/views/foo.html.erb +0 -3
- data/benchmarks/stubs/merb-very-flat/.gitignore +0 -21
- data/benchmarks/stubs/merb-very-flat/Rakefile +0 -35
- data/benchmarks/stubs/merb-very-flat/merb-very-flat.rb +0 -61
- data/benchmarks/stubs/merb-very-flat/spec/spec_helper.rb +0 -26
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/app_script.rb +0 -33
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/common.rb +0 -70
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/gem_ext.rb +0 -127
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/main.thor +0 -152
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/ops.rb +0 -95
- data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/utils.rb +0 -42
- data/benchmarks/stubs/rails/README +0 -243
- data/benchmarks/stubs/rails/Rakefile +0 -10
- data/benchmarks/stubs/rails/app/controllers/application_controller.rb +0 -12
- data/benchmarks/stubs/rails/app/helpers/application_helper.rb +0 -5
- data/benchmarks/stubs/rails/config/boot.rb +0 -112
- data/benchmarks/stubs/rails/config/database.yml +0 -22
- data/benchmarks/stubs/rails/config/environment.rb +0 -43
- data/benchmarks/stubs/rails/config/environments/development.rb +0 -19
- data/benchmarks/stubs/rails/config/environments/production.rb +0 -30
- data/benchmarks/stubs/rails/config/environments/test.rb +0 -30
- data/benchmarks/stubs/rails/config/initializers/backtrace_silencers.rb +0 -9
- data/benchmarks/stubs/rails/config/initializers/inflections.rb +0 -12
- data/benchmarks/stubs/rails/config/initializers/mime_types.rb +0 -7
- data/benchmarks/stubs/rails/config/initializers/new_rails_defaults.rb +0 -21
- data/benchmarks/stubs/rails/config/initializers/session_store.rb +0 -17
- data/benchmarks/stubs/rails/config/locales/en.yml +0 -5
- data/benchmarks/stubs/rails/config/routes.rb +0 -45
- data/benchmarks/stubs/rails/doc/README_FOR_APP +0 -2
- data/benchmarks/stubs/rails/public/404.html +0 -30
- data/benchmarks/stubs/rails/public/422.html +0 -30
- data/benchmarks/stubs/rails/public/500.html +0 -30
- data/benchmarks/stubs/rails/public/images/rails.png +0 -0
- data/benchmarks/stubs/rails/public/index.html +0 -275
- data/benchmarks/stubs/rails/public/javascripts/application.js +0 -2
- data/benchmarks/stubs/rails/public/javascripts/controls.js +0 -963
- data/benchmarks/stubs/rails/public/javascripts/dragdrop.js +0 -973
- data/benchmarks/stubs/rails/public/javascripts/effects.js +0 -1128
- data/benchmarks/stubs/rails/public/javascripts/prototype.js +0 -4320
- data/benchmarks/stubs/rails/public/robots.txt +0 -5
- data/benchmarks/stubs/rails/script/about +0 -4
- data/benchmarks/stubs/rails/script/console +0 -3
- data/benchmarks/stubs/rails/script/dbconsole +0 -3
- data/benchmarks/stubs/rails/script/destroy +0 -3
- data/benchmarks/stubs/rails/script/generate +0 -3
- data/benchmarks/stubs/rails/script/performance/benchmarker +0 -3
- data/benchmarks/stubs/rails/script/performance/profiler +0 -3
- data/benchmarks/stubs/rails/script/plugin +0 -3
- data/benchmarks/stubs/rails/script/runner +0 -3
- data/benchmarks/stubs/rails/script/server +0 -3
- data/benchmarks/stubs/rails/test/performance/browsing_test.rb +0 -11
- data/benchmarks/stubs/rails/test/test_helper.rb +0 -40
- data/benchmarks/stubs/ramaze.rb +0 -0
- data/benchmarks/stubs/sinatra.rb +0 -11
- data/gems/cache/code-cleaner-0.1.gem +0 -0
- data/gems/cache/code-cleaner-0.2.gem +0 -0
- data/gems/cache/code-cleaner-0.3.gem +0 -0
- data/gems/cache/code-cleaner-0.4.gem +0 -0
- data/gems/cache/code-cleaner-0.5.gem +0 -0
- data/gems/cache/code-cleaner-0.6.gem +0 -0
- data/gems/cache/code-cleaner-0.7.gem +0 -0
- data/gems/cache/code-cleaner-0.8.1.gem +0 -0
- data/gems/cache/code-cleaner-0.8.gem +0 -0
- data/gems/cache/extlib-0.9.14.gem +0 -0
- data/gems/cache/haml-2.2.16.gem +0 -0
- data/gems/cache/haml-2.2.17.gem +0 -0
- data/gems/cache/nake-0.0.2.gem +0 -0
- data/gems/cache/nake-0.0.3.gem +0 -0
- data/gems/cache/nake-0.0.5.gem +0 -0
- data/gems/cache/nake-0.0.6.gem +0 -0
- data/gems/cache/rack-1.0.1.gem +0 -0
- data/gems/cache/rack-1.1.0.gem +0 -0
- data/gems/cache/rspec-1.2.9.gem +0 -0
- data/gems/cache/term-ansicolor-1.0.4.gem +0 -0
- data/gems/cache/tilt-0.4.gem +0 -0
- data/gems/cache/tilt-0.5.gem +0 -0
- data/lib/rango/forms/form.rb +0 -30
- data/lib/rango/helpers.rb +0 -31
- data/lib/rango/helpers/assets.rb +0 -46
- data/lib/rango/helpers/general.rb +0 -53
- data/lib/rango/helpers/syntax.rb +0 -30
- data/lib/rango/mixins/chainable.rb +0 -66
- data/lib/rango/mixins/http_caching.rb +0 -78
- data/lib/rango/router/adapters/rack_router.rb +0 -7
- data/lib/rango/templates/exts/erubis.rb +0 -65
- data/spec/rango/forms/form_spec.rb +0 -0
- data/spec/rango/helpers/assets_spec.rb +0 -0
- data/spec/rango/helpers/general_spec.rb +0 -0
- data/spec/rango/helpers/syntax_spec.rb +0 -0
- data/spec/rango/helpers_spec.rb +0 -0
- data/spec/rango/rack/middlewares/email_obfuscator_spec.rb +0 -0
- data/spec/rango/router/adapters/rack_router_spec.rb +0 -0
- data/spec/rango/templates/exts/erubis_spec.rb +0 -0
- data/spec/stubs/templates/_basic.html.erb +0 -6
- data/spec/stubs/templates/basic.html.erb +0 -6
- data/spec/stubs/templates/capture.html.erb +0 -11
- data/spec/stubs/templates/context.html.erb +0 -6
- data/spec/stubs/templates/erubis.html.erubis +0 -2
- data/spec/stubs/templates/exception.html.erb +0 -1
- data/spec/stubs/templates/inheritance/capture/erb/base.html.erb +0 -3
- data/spec/stubs/templates/inheritance/capture/erb/index.html.erb +0 -4
- data/spec/stubs/templates/inheritance/capture/erubis/base.html.erubis +0 -3
- data/spec/stubs/templates/inheritance/capture/erubis/index.html.erubis +0 -4
- data/stubs/stack/content/lib/%name%/config.rb.rbt +0 -0
- data/stubs/stack/content/lib/%name%/initializers/middlewares.rb.rbt +0 -5
- data/stubs/stack/content/rackup.rb.rbt +0 -41
- data/support/hooks/pre-commit +0 -12
@@ -1,40 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
ENV["RAILS_ENV"] = "test"
|
4
|
-
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
5
|
-
require 'test_help'
|
6
|
-
|
7
|
-
class ActiveSupport::TestCase
|
8
|
-
# Transactional fixtures accelerate your tests by wrapping each test method
|
9
|
-
# in a transaction that's rolled back on completion. This ensures that the
|
10
|
-
# test database remains unchanged so your fixtures don't have to be reloaded
|
11
|
-
# between every test method. Fewer database queries means faster tests.
|
12
|
-
#
|
13
|
-
# Read Mike Clark's excellent walkthrough at
|
14
|
-
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
15
|
-
#
|
16
|
-
# Every Active Record database supports transactions except MyISAM tables
|
17
|
-
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
18
|
-
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
19
|
-
# is recommended.
|
20
|
-
#
|
21
|
-
# The only drawback to using transactional fixtures is when you actually
|
22
|
-
# need to test transactions. Since your test is bracketed by a transaction,
|
23
|
-
# any transactions started in your code will be automatically rolled back.
|
24
|
-
self.use_transactional_fixtures = true
|
25
|
-
|
26
|
-
# Instantiated fixtures are slow, but give you @david where otherwise you
|
27
|
-
# would need people(:david). If you don't want to migrate your existing
|
28
|
-
# test cases which use the @david style and don't mind the speed hit (each
|
29
|
-
# instantiated fixtures translates to a database query per test method),
|
30
|
-
# then set this back to true.
|
31
|
-
self.use_instantiated_fixtures = false
|
32
|
-
|
33
|
-
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
34
|
-
#
|
35
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
36
|
-
# -- they do not yet inherit this setting
|
37
|
-
fixtures :all
|
38
|
-
|
39
|
-
# Add more helper methods to be used by all tests here...
|
40
|
-
end
|
data/benchmarks/stubs/ramaze.rb
DELETED
File without changes
|
data/benchmarks/stubs/sinatra.rb
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/gems/cache/haml-2.2.16.gem
DELETED
Binary file
|
data/gems/cache/haml-2.2.17.gem
DELETED
Binary file
|
data/gems/cache/nake-0.0.2.gem
DELETED
Binary file
|
data/gems/cache/nake-0.0.3.gem
DELETED
Binary file
|
data/gems/cache/nake-0.0.5.gem
DELETED
Binary file
|
data/gems/cache/nake-0.0.6.gem
DELETED
Binary file
|
data/gems/cache/rack-1.0.1.gem
DELETED
Binary file
|
data/gems/cache/rack-1.1.0.gem
DELETED
Binary file
|
data/gems/cache/rspec-1.2.9.gem
DELETED
Binary file
|
Binary file
|
data/gems/cache/tilt-0.4.gem
DELETED
Binary file
|
data/gems/cache/tilt-0.5.gem
DELETED
Binary file
|
data/lib/rango/forms/form.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# class ContactForm < Rango::Form
|
4
|
-
# property :subject, String
|
5
|
-
# property :message, Text
|
6
|
-
# property :cc_self, Boolean
|
7
|
-
# end
|
8
|
-
|
9
|
-
# @future 0.0.3 It's just a prototype now
|
10
|
-
module Rango
|
11
|
-
class Form
|
12
|
-
def media
|
13
|
-
end
|
14
|
-
|
15
|
-
def valid?
|
16
|
-
end
|
17
|
-
|
18
|
-
def to_html
|
19
|
-
output = Array.new
|
20
|
-
output << %{<form action="#{@action}" method="post">}
|
21
|
-
output << *@fields.map { |field| field.to_html }
|
22
|
-
output << %{</form>}
|
23
|
-
return output.join("\n")
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
class ModelForm
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
data/lib/rango/helpers.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module Rango
|
4
|
-
module Helpers
|
5
|
-
# tag :a, href: "/contact" { anchor }
|
6
|
-
# tag :a, "contact", href: "/contact"
|
7
|
-
# @since 0.0.2
|
8
|
-
def tag(tag, content, attrs = Hash.new, &block)
|
9
|
-
attrs, content = content, String.new if attrs.empty? && content.is_a?(Hash)
|
10
|
-
block.call if block
|
11
|
-
%[<#{tag}#{attrs_to_html(attrs)}>#{content}</#{tag}>]
|
12
|
-
end
|
13
|
-
|
14
|
-
# @since 0.0.2
|
15
|
-
def single_tag(tag, attrs = Hash.new)
|
16
|
-
%[<#{tag}#{attrs_to_html(attrs)} />]
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
def attrs_to_html(attrs)
|
21
|
-
attrs.inject(String.new) do |result, pair|
|
22
|
-
key, value = pair
|
23
|
-
result += " #{key}='#{value}'"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
require "rango/helpers/assets"
|
30
|
-
require "rango/helpers/syntax"
|
31
|
-
require "rango/helpers/general"
|
data/lib/rango/helpers/assets.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# TODO: javascript "application" => media/javascripts/application.js
|
4
|
-
# ... but what if I need full path? It should be tested if file exist, of course
|
5
|
-
# javascript Path.new("design/whatever.js")
|
6
|
-
require "rango/helpers"
|
7
|
-
|
8
|
-
begin
|
9
|
-
require "media-path"
|
10
|
-
rescue LoadError
|
11
|
-
raise LoadError, "You have to install media-path gem!"
|
12
|
-
end
|
13
|
-
|
14
|
-
module Rango
|
15
|
-
module Helpers
|
16
|
-
# stolen from pupu (but it's OK, it's my code)
|
17
|
-
# @since 0.0.2
|
18
|
-
def javascript(basename)
|
19
|
-
path = MediaPath.new(File.join(Rango.media_root, "javascripts", "#{basename}.js"))
|
20
|
-
tag :script, src: path.url, type: "text/javascript"
|
21
|
-
end
|
22
|
-
|
23
|
-
# @since 0.0.2
|
24
|
-
def stylesheet(basename, attrs = Hash.new)
|
25
|
-
path = MediaPath.new(File.join(Rango.media_root, "stylesheets", basename))
|
26
|
-
default = {href: path.url, media: 'screen', rel: 'stylesheet', type: 'text/css'}
|
27
|
-
single_tag :link, default.merge(attrs)
|
28
|
-
end
|
29
|
-
|
30
|
-
def image(basename, attrs = Hash.new)
|
31
|
-
path = MediaPath.new(File.join(Rango.media_root, "images", basename))
|
32
|
-
default = {src: path.url, alt: path.basename}
|
33
|
-
single_tag :img, default.merge(attrs)
|
34
|
-
end
|
35
|
-
|
36
|
-
# @since 0.0.2
|
37
|
-
def javascripts(*names)
|
38
|
-
names.map { |name| self.javascript(name) }.join("\n")
|
39
|
-
end
|
40
|
-
|
41
|
-
# @since 0.0.2
|
42
|
-
def stylesheets(*names)
|
43
|
-
names.map { |name| self.stylesheet(name) }.join("\n")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require "uri"
|
4
|
-
require "rango/helpers"
|
5
|
-
|
6
|
-
module Rango
|
7
|
-
module Helpers
|
8
|
-
# @since 0.0.1
|
9
|
-
def copyright(from)
|
10
|
-
now = Time.now.year
|
11
|
-
now.eql?(from) ? now : "#{from} - #{now}"
|
12
|
-
end
|
13
|
-
|
14
|
-
# @since 0.0.2
|
15
|
-
def link_to(name, url, options = Hash.new)
|
16
|
-
default = {href: URI.escape(url), title: name.to_s.gsub(/'/, ''')}
|
17
|
-
tag :a, name, default.merge(options)
|
18
|
-
end
|
19
|
-
|
20
|
-
# @since 0.0.2
|
21
|
-
def link_item(name, url)
|
22
|
-
tag :li, link_to(name, url)
|
23
|
-
end
|
24
|
-
|
25
|
-
# @since 0.0.2
|
26
|
-
# mail_to "joe@example.com"
|
27
|
-
# => "<a href='mailto:joe@example.com'>joe@example.com</a>"
|
28
|
-
# mail_to "joe@example.com", "Title"
|
29
|
-
# => "<a href='mailto:joe@example.com'>Title</a>"
|
30
|
-
def mail_to(mail, text = mail)
|
31
|
-
mail.gsub!("@" "@")
|
32
|
-
tag :a, text, href: "mailto:#{mail}"
|
33
|
-
end
|
34
|
-
|
35
|
-
# @since 0.0.2
|
36
|
-
def error_messages_for(model_instance)
|
37
|
-
tag :ul do
|
38
|
-
messages = model_instance.errors.full_messages
|
39
|
-
messages.map { |message| tag :li, message }
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def truncate(text, *args)
|
44
|
-
options = args.extract_options!
|
45
|
-
unless args.empty?
|
46
|
-
options[:size] = args[0] || 75
|
47
|
-
options[:omission] = args[1] || "..."
|
48
|
-
end
|
49
|
-
options = {size: 75, omission: "..."}.merge(options)
|
50
|
-
text.scan(/(\S+)(\s+)/)[0..options[:size]].flatten.join << options[:omission] if text
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
data/lib/rango/helpers/syntax.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require "rango/helpers"
|
4
|
-
|
5
|
-
module Rango
|
6
|
-
module Helpers
|
7
|
-
# @since 0.0.1
|
8
|
-
def textile(text)
|
9
|
-
require "redcloth"
|
10
|
-
RedCloth.new(text).to_html
|
11
|
-
end
|
12
|
-
|
13
|
-
# @since 0.0.1
|
14
|
-
def markdown(text)
|
15
|
-
require "bluecloth"
|
16
|
-
end
|
17
|
-
|
18
|
-
# @since 0.0.1
|
19
|
-
def maruku(text, options = Hash.new)
|
20
|
-
require "maruku"
|
21
|
-
end
|
22
|
-
|
23
|
-
# @since 0.0.1
|
24
|
-
def syntax(text, options = Hash.new)
|
25
|
-
require "syntax/convertors/html"
|
26
|
-
convertor = Syntax::Convertors::HTML.for_syntax(options[:language] || "ruby")
|
27
|
-
convertor.convert(text, false)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# from merb-core
|
4
|
-
module Chainable
|
5
|
-
# Allows the definition of methods on a class that will be available via
|
6
|
-
# super.
|
7
|
-
#
|
8
|
-
# ==== Examples
|
9
|
-
# class Foo
|
10
|
-
# extend Chainable
|
11
|
-
# chainable do
|
12
|
-
# def hello
|
13
|
-
# "hello"
|
14
|
-
# end
|
15
|
-
# end
|
16
|
-
# end
|
17
|
-
#
|
18
|
-
# class Foo
|
19
|
-
# def hello
|
20
|
-
# super + " Merb!"
|
21
|
-
# end
|
22
|
-
# end
|
23
|
-
#
|
24
|
-
# # Example with mixin:
|
25
|
-
# module TestMixin
|
26
|
-
# extend Chainable
|
27
|
-
# chainable do
|
28
|
-
# def test
|
29
|
-
# "from mixin!"
|
30
|
-
# end
|
31
|
-
# end
|
32
|
-
# end
|
33
|
-
#
|
34
|
-
# class Test
|
35
|
-
# include TestMixin
|
36
|
-
# def test
|
37
|
-
# "hello " + super
|
38
|
-
# end
|
39
|
-
# end
|
40
|
-
#
|
41
|
-
# puts Test.new.test
|
42
|
-
#
|
43
|
-
#
|
44
|
-
# Foo.new.hello #=> "hello Merb!"
|
45
|
-
#
|
46
|
-
# ==== Parameters
|
47
|
-
# &block::
|
48
|
-
# a block containing method definitions that should be
|
49
|
-
# marked as chainable
|
50
|
-
#
|
51
|
-
# ==== Returns
|
52
|
-
# Module:: The anonymous module that was created
|
53
|
-
def chainable(method = nil, &block)
|
54
|
-
if method.nil? && block_given?
|
55
|
-
mixin = Module.new(&block)
|
56
|
-
include mixin
|
57
|
-
return mixin
|
58
|
-
elsif method && ! block_given?
|
59
|
-
# TODO
|
60
|
-
# def test
|
61
|
-
# # ...
|
62
|
-
# end
|
63
|
-
# chainable :test
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module Rango
|
4
|
-
module HttpCaching
|
5
|
-
def self.included(base)
|
6
|
-
base.send(:include, LastModified)
|
7
|
-
base.send(:include, ETag)
|
8
|
-
end
|
9
|
-
|
10
|
-
module LastModified
|
11
|
-
def self.included(base)
|
12
|
-
Rango.logger.debug("LastModified caching mixin included to #{self.inspect}")
|
13
|
-
base.before_render_filters.push(:check_last_modified_for_template)
|
14
|
-
base.before_display_filters.push(:check_last_modified_for_object)
|
15
|
-
base.after_display_filters.push(:set_last_modified_for_object)
|
16
|
-
base.after_render_filters.push(:set_last_modified_for_template)
|
17
|
-
# Cache-Control: must-revalidate means that browser must send validation request every time even if there is already cache entry exists for this object.
|
18
|
-
base.headers["Cache-Control"] = "must-revalidate" unless base.headers["Cache-Control"]
|
19
|
-
end
|
20
|
-
|
21
|
-
# set headers
|
22
|
-
# after display
|
23
|
-
def set_last_modified_for_object(object, result)
|
24
|
-
if request.last_modified.nil? || request.last_modified < object.updated_at
|
25
|
-
self.headers["Last-Modified"] = object.updated_at
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# after render
|
30
|
-
def set_last_modified_for_template(template)
|
31
|
-
if self["Last-Modified"].nil? || self["Last-Modified"] < template.mtime
|
32
|
-
self.headers["Last-Modified"] = template.mtime
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# check headers
|
37
|
-
# before render
|
38
|
-
def check_last_modified_for_template(template)
|
39
|
-
template.last_modified
|
40
|
-
end
|
41
|
-
|
42
|
-
# TODO: last modified for static files as JS, CSS ... (middleware)
|
43
|
-
# before display
|
44
|
-
def check_last_modified_for_object(object)
|
45
|
-
last_modified = [object.updated_at, template.mtime].max
|
46
|
-
raise NotModified if request.if_modified_since < last_modified
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
module ETag
|
51
|
-
def self.included(base)
|
52
|
-
Rango.logger.debug("ETag-based caching mixin included to #{self.inspect}")
|
53
|
-
base.after_render_filters.push(:check_etag)
|
54
|
-
base.after_render_filters.push(:set_etag)
|
55
|
-
# Cache-Control: must-revalidate means that browser must send validation request every time even if there is already cache entry exists for this object.
|
56
|
-
base.headers["Cache-Control"] = "must-revalidate" unless base.headers["Cache-Control"]
|
57
|
-
end
|
58
|
-
|
59
|
-
# set headers
|
60
|
-
# after render
|
61
|
-
def set_etag(template)
|
62
|
-
headers["ETag"] = template.render.hash.to_s
|
63
|
-
end
|
64
|
-
|
65
|
-
# check headers
|
66
|
-
# Rango::Controller#display use it
|
67
|
-
# server sends HTTP ETAG
|
68
|
-
# client sends HTTP_IF_NONE_MATCH
|
69
|
-
# This method suits for cases when it’s difficult to maintain Last-Modified value: when you have complicated application with many page fragments especially if there are third-party libraries. Or for the case with authentication, when page content depends on authentication info.
|
70
|
-
# Etag is useful for dynamic content, when modify time is not known. In this case Etage can be
|
71
|
-
# generated from hash (md5/sha) of content.
|
72
|
-
# after render
|
73
|
-
def check_etag(result)
|
74
|
-
raise NotModified if request.etag.eql?(result.hash)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|