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,42 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
class String
|
4
|
-
def /(other)
|
5
|
-
(Pathname.new(self) + other).to_s
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
module ColorfulMessages
|
10
|
-
|
11
|
-
# red
|
12
|
-
def error(*messages)
|
13
|
-
puts messages.map { |msg| "\033[1;31m#{msg}\033[0m" }
|
14
|
-
end
|
15
|
-
|
16
|
-
# yellow
|
17
|
-
def warning(*messages)
|
18
|
-
puts messages.map { |msg| "\033[1;33m#{msg}\033[0m" }
|
19
|
-
end
|
20
|
-
|
21
|
-
# green
|
22
|
-
def success(*messages)
|
23
|
-
puts messages.map { |msg| "\033[1;32m#{msg}\033[0m" }
|
24
|
-
end
|
25
|
-
|
26
|
-
alias_method :message, :success
|
27
|
-
|
28
|
-
# magenta
|
29
|
-
def note(*messages)
|
30
|
-
puts messages.map { |msg| "\033[1;35m#{msg}\033[0m" }
|
31
|
-
end
|
32
|
-
|
33
|
-
# blue
|
34
|
-
def info(*messages)
|
35
|
-
puts messages.map { |msg| "\033[1;34m#{msg}\033[0m" }
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
module ThorUI
|
41
|
-
extend ColorfulMessages
|
42
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
.DS_Store
|
2
|
-
log/*
|
3
|
-
tmp/*
|
4
|
-
TAGS
|
5
|
-
*~
|
6
|
-
.#*
|
7
|
-
schema/schema.rb
|
8
|
-
schema/*_structure.sql
|
9
|
-
schema/*.sqlite3
|
10
|
-
schema/*.sqlite
|
11
|
-
schema/*.db
|
12
|
-
*.sqlite
|
13
|
-
*.sqlite3
|
14
|
-
*.db
|
15
|
-
src/*
|
16
|
-
.hgignore
|
17
|
-
.hg/*
|
18
|
-
.svn/*
|
19
|
-
gems/gems/*
|
20
|
-
gems/specifications/*
|
21
|
-
merb_profile_results
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake/rdoctask'
|
3
|
-
|
4
|
-
require 'merb-core'
|
5
|
-
require 'merb-core/tasks/merb'
|
6
|
-
|
7
|
-
include FileUtils
|
8
|
-
|
9
|
-
# Load the basic runtime dependencies; this will include
|
10
|
-
# any plugins and therefore plugin rake tasks.
|
11
|
-
init_env = ENV['MERB_ENV'] || 'rake'
|
12
|
-
Merb.load_dependencies(:environment => init_env)
|
13
|
-
|
14
|
-
# Get Merb plugins and dependencies
|
15
|
-
Merb::Plugins.rakefiles.each { |r| require r }
|
16
|
-
|
17
|
-
# Load any app level custom rakefile extensions from lib/tasks
|
18
|
-
tasks_path = File.join(File.dirname(__FILE__), "lib", "tasks")
|
19
|
-
rake_files = Dir["#{tasks_path}/*.rake"]
|
20
|
-
rake_files.each{|rake_file| load rake_file }
|
21
|
-
|
22
|
-
desc "Start runner environment"
|
23
|
-
task :merb_env do
|
24
|
-
Merb.start_environment(:environment => init_env, :adapter => 'runner')
|
25
|
-
end
|
26
|
-
|
27
|
-
require 'spec/rake/spectask'
|
28
|
-
require 'merb-core/test/tasks/spectasks'
|
29
|
-
desc 'Default: run spec examples'
|
30
|
-
task :default => 'spec'
|
31
|
-
|
32
|
-
##############################################################################
|
33
|
-
# ADD YOUR CUSTOM TASKS IN /lib/tasks
|
34
|
-
# NAME YOUR RAKE FILES file_name.rake
|
35
|
-
##############################################################################
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
class Exceptions < Merb::Controller
|
4
|
-
|
5
|
-
# handle NotFound exceptions (404)
|
6
|
-
def not_found
|
7
|
-
render :format => :html
|
8
|
-
end
|
9
|
-
|
10
|
-
# handle NotAcceptable exceptions (406)
|
11
|
-
def not_acceptable
|
12
|
-
render :format => :html
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
<div id="container">
|
2
|
-
<div id="header-container">
|
3
|
-
<img src="/images/merb.jpg" />
|
4
|
-
<!-- <h1>Mongrel + Erb</h1> -->
|
5
|
-
<h2>pocket rocket web framework</h2>
|
6
|
-
<hr />
|
7
|
-
</div>
|
8
|
-
|
9
|
-
<div id="left-container">
|
10
|
-
<h3>Exception:</h3>
|
11
|
-
<p><%= request.exceptions.first.message %></p>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<div id="main-container">
|
15
|
-
<h3>Why am I seeing this page?</h3>
|
16
|
-
<p>Merb couldn't find an appropriate content_type to return,
|
17
|
-
based on what you said was available via provides() and
|
18
|
-
what the client requested.</p>
|
19
|
-
|
20
|
-
<h3>How to add a mime-type</h3>
|
21
|
-
<pre><code>
|
22
|
-
Merb.add_mime_type :pdf, :to_pdf, %w[application/pdf], "Content-Encoding" => "gzip"
|
23
|
-
</code></pre>
|
24
|
-
<h3>What this means is:</h3>
|
25
|
-
<ul>
|
26
|
-
<li>Add a mime-type for :pdf</li>
|
27
|
-
<li>Register the method for converting objects to PDF as <code>#to_pdf</code>.</li>
|
28
|
-
<li>Register the incoming mime-type "Accept" header as <code>application/pdf</code>.</li>
|
29
|
-
<li>Specify a new header for PDF types so it will set <code>Content-Encoding</code> to gzip.</li>
|
30
|
-
</ul>
|
31
|
-
|
32
|
-
<h3>You can then do:</h3>
|
33
|
-
<pre><code>
|
34
|
-
class Foo < Application
|
35
|
-
provides :pdf
|
36
|
-
end
|
37
|
-
</code></pre>
|
38
|
-
|
39
|
-
<h3>Where can I find help?</h3>
|
40
|
-
<p>If you have any questions or if you can't figure something out, please take a
|
41
|
-
look at our <a href="http://merbivore.com/"> project page</a>,
|
42
|
-
feel free to come chat at irc.freenode.net, channel #merb,
|
43
|
-
or post to <a href="http://groups.google.com/group/merb">merb mailing list</a>
|
44
|
-
on Google Groups.</p>
|
45
|
-
|
46
|
-
<h3>What if I've found a bug?</h3>
|
47
|
-
<p>If you want to file a bug or make your own contribution to Merb,
|
48
|
-
feel free to register and create a ticket at our
|
49
|
-
<a href="http://merb.lighthouseapp.com/">project development page</a>
|
50
|
-
on Lighthouse.</p>
|
51
|
-
|
52
|
-
<h3>How do I edit this page?</h3>
|
53
|
-
<p>You can change what people see when this happens by editing <tt>app/views/exceptions/not_acceptable.html.erb</tt>.</p>
|
54
|
-
|
55
|
-
</div>
|
56
|
-
|
57
|
-
<div id="footer-container">
|
58
|
-
<hr />
|
59
|
-
<div class="left"></div>
|
60
|
-
<div class="right">© 2008 the merb dev team</div>
|
61
|
-
<p> </p>
|
62
|
-
</div>
|
63
|
-
</div>
|
@@ -1,47 +0,0 @@
|
|
1
|
-
<div id="container">
|
2
|
-
<div id="header-container">
|
3
|
-
<img src="/images/merb.jpg" />
|
4
|
-
<!-- <h1>Mongrel + Erb</h1> -->
|
5
|
-
<h2>pocket rocket web framework</h2>
|
6
|
-
<hr />
|
7
|
-
</div>
|
8
|
-
|
9
|
-
<div id="left-container">
|
10
|
-
<h3>Exception:</h3>
|
11
|
-
<p><%= request.exceptions.first.message %></p>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<div id="main-container">
|
15
|
-
<h3>Welcome to Merb!</h3>
|
16
|
-
<p>Merb is a light-weight MVC framework written in Ruby. We hope you enjoy it.</p>
|
17
|
-
|
18
|
-
<h3>Where can I find help?</h3>
|
19
|
-
<p>If you have any questions or if you can't figure something out, please take a
|
20
|
-
look at our <a href="http://merbivore.com/"> project page</a>,
|
21
|
-
feel free to come chat at irc.freenode.net, channel #merb,
|
22
|
-
or post to <a href="http://groups.google.com/group/merb">merb mailing list</a>
|
23
|
-
on Google Groups.</p>
|
24
|
-
|
25
|
-
<h3>What if I've found a bug?</h3>
|
26
|
-
<p>If you want to file a bug or make your own contribution to Merb,
|
27
|
-
feel free to register and create a ticket at our
|
28
|
-
<a href="http://merb.lighthouseapp.com/">project development page</a>
|
29
|
-
on Lighthouse.</p>
|
30
|
-
|
31
|
-
<h3>How do I edit this page?</h3>
|
32
|
-
<p>You're seeing this page because you need to edit the following files:
|
33
|
-
<ul>
|
34
|
-
<li>config/router.rb <strong><em>(recommended)</em></strong></li>
|
35
|
-
<li>app/views/exceptions/not_found.html.erb <strong><em>(recommended)</em></strong></li>
|
36
|
-
<li>app/views/layout/application.html.erb <strong><em>(change this layout)</em></strong></li>
|
37
|
-
</ul>
|
38
|
-
</p>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<div id="footer-container">
|
42
|
-
<hr />
|
43
|
-
<div class="left"></div>
|
44
|
-
<div class="right">© 2008 the merb dev team</div>
|
45
|
-
<p> </p>
|
46
|
-
</div>
|
47
|
-
</div>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
|
3
|
-
<head>
|
4
|
-
<title>Fresh Merb App</title>
|
5
|
-
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
6
|
-
<link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8" />
|
7
|
-
</head>
|
8
|
-
<body>
|
9
|
-
<%#= message[:notice] %>
|
10
|
-
<%= catch_content :for_layout %>
|
11
|
-
</body>
|
12
|
-
</html>
|
@@ -1 +0,0 @@
|
|
1
|
-
Autotest.add_discovery { "merb" }
|
@@ -1,151 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# Adapted from Autotest::Rails
|
4
|
-
require 'autotest'
|
5
|
-
|
6
|
-
class Autotest::Merb < Autotest
|
7
|
-
|
8
|
-
# +model_tests_dir+:: the directory to find model-centric tests
|
9
|
-
# +controller_tests_dir+:: the directory to find controller-centric tests
|
10
|
-
# +view_tests_dir+:: the directory to find view-centric tests
|
11
|
-
# +fixtures_dir+:: the directory to find fixtures in
|
12
|
-
attr_accessor :model_tests_dir, :controller_tests_dir, :view_tests_dir, :fixtures_dir
|
13
|
-
|
14
|
-
def initialize
|
15
|
-
super
|
16
|
-
|
17
|
-
initialize_test_layout
|
18
|
-
|
19
|
-
# Ignore any happenings in these directories
|
20
|
-
add_exception %r%^\./(?:doc|log|public|tmp)%
|
21
|
-
|
22
|
-
# Ignore any mappings that Autotest may have already set up
|
23
|
-
clear_mappings
|
24
|
-
|
25
|
-
# Any changes to a file in the root of the 'lib' directory will run any
|
26
|
-
# model test with a corresponding name.
|
27
|
-
add_mapping %r%^lib\/.*\.rb% do |filename, _|
|
28
|
-
files_matching Regexp.new(["^#{model_test_for(filename)}$"])
|
29
|
-
end
|
30
|
-
|
31
|
-
# Any changes to a fixture will run corresponding view, controller and
|
32
|
-
# model tests
|
33
|
-
add_mapping %r%^#{fixtures_dir}/(.*)s.yml% do |_, m|
|
34
|
-
[
|
35
|
-
model_test_for(m[1]),
|
36
|
-
controller_test_for(m[1]),
|
37
|
-
view_test_for(m[1])
|
38
|
-
]
|
39
|
-
end
|
40
|
-
|
41
|
-
# Any change to a test or test will cause it to be run
|
42
|
-
add_mapping %r%^test/(unit|models|integration|controllers|views|functional)/.*rb$% do |filename, _|
|
43
|
-
filename
|
44
|
-
end
|
45
|
-
|
46
|
-
# Any change to a model will cause it's corresponding test to be run
|
47
|
-
add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
|
48
|
-
model_test_for(m[1])
|
49
|
-
end
|
50
|
-
|
51
|
-
# Any change to the global helper will result in all view and controller
|
52
|
-
# tests being run
|
53
|
-
add_mapping %r%^app/helpers/global_helpers.rb% do
|
54
|
-
files_matching %r%^test/(views|functional|controllers)/.*_test\.rb$%
|
55
|
-
end
|
56
|
-
|
57
|
-
# Any change to a helper will run it's corresponding view and controller
|
58
|
-
# tests, unless the helper is the global helper. Changes to the global
|
59
|
-
# helper run all view and controller tests.
|
60
|
-
add_mapping %r%^app/helpers/(.*)_helper(s)?.rb% do |_, m|
|
61
|
-
if m[1] == "global" then
|
62
|
-
files_matching %r%^test/(views|functional|controllers)/.*_test\.rb$%
|
63
|
-
else
|
64
|
-
[
|
65
|
-
view_test_for(m[1]),
|
66
|
-
controller_test_for(m[1])
|
67
|
-
]
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
# Changes to views result in their corresponding view and controller test
|
72
|
-
# being run
|
73
|
-
add_mapping %r%^app/views/(.*)/% do |_, m|
|
74
|
-
[
|
75
|
-
view_test_for(m[1]),
|
76
|
-
controller_test_for(m[1])
|
77
|
-
]
|
78
|
-
end
|
79
|
-
|
80
|
-
# Changes to a controller result in its corresponding test being run. If
|
81
|
-
# the controller is the exception or application controller, all
|
82
|
-
# controller tests are run.
|
83
|
-
add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
|
84
|
-
if ["application", "exception"].include?(m[1])
|
85
|
-
files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
|
86
|
-
else
|
87
|
-
controller_test_for(m[1])
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
# If a change is made to the router, run all controller and view tests
|
92
|
-
add_mapping %r%^config/router.rb$% do # FIX
|
93
|
-
files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
|
94
|
-
end
|
95
|
-
|
96
|
-
# If any of the major files governing the environment are altered, run
|
97
|
-
# everything
|
98
|
-
add_mapping %r%^test/test_helper.rb|config/(init|rack|environments/test.rb|database.yml)% do # FIX
|
99
|
-
files_matching %r%^test/(unit|models|controllers|views|functional)/.*_test\.rb$%
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
private
|
104
|
-
|
105
|
-
# Determines the paths we can expect tests or specs to reside, as well as
|
106
|
-
# corresponding fixtures.
|
107
|
-
def initialize_test_layout
|
108
|
-
self.model_tests_dir = "test/unit"
|
109
|
-
self.controller_tests_dir = "test/functional"
|
110
|
-
self.view_tests_dir = "test/views"
|
111
|
-
self.fixtures_dir = "test/fixtures"
|
112
|
-
end
|
113
|
-
|
114
|
-
# Given a filename and the test type, this method will return the
|
115
|
-
# corresponding test's or spec's name.
|
116
|
-
#
|
117
|
-
# ==== Arguments
|
118
|
-
# +filename+<String>:: the file name of the model, view, or controller
|
119
|
-
# +kind_of_test+<Symbol>:: the type of test we that we should run
|
120
|
-
#
|
121
|
-
# ==== Returns
|
122
|
-
# String:: the name of the corresponding test or spec
|
123
|
-
#
|
124
|
-
# ==== Example
|
125
|
-
#
|
126
|
-
# > test_for("user", :model)
|
127
|
-
# => "user_test.rb"
|
128
|
-
# > test_for("login", :controller)
|
129
|
-
# => "login_controller_test.rb"
|
130
|
-
# > test_for("form", :view)
|
131
|
-
# => "form_view_spec.rb" # If you're running a RSpec-like suite
|
132
|
-
def test_for(filename, kind_of_test)
|
133
|
-
name = [filename]
|
134
|
-
name << kind_of_test.to_s if kind_of_test == :view
|
135
|
-
name << "test"
|
136
|
-
return name.join("_") + ".rb"
|
137
|
-
end
|
138
|
-
|
139
|
-
def model_test_for(filename)
|
140
|
-
[model_tests_dir, test_for(filename, :model)].join("/")
|
141
|
-
end
|
142
|
-
|
143
|
-
def controller_test_for(filename)
|
144
|
-
[controller_tests_dir, test_for(filename, :controller)].join("/")
|
145
|
-
end
|
146
|
-
|
147
|
-
def view_test_for(filename)
|
148
|
-
[view_tests_dir, test_for(filename, :view)].join("/")
|
149
|
-
end
|
150
|
-
|
151
|
-
end
|
@@ -1,167 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
# Adapted from Autotest::Rails, RSpec's autotest class, as well as merb-core's.
|
4
|
-
require 'autotest'
|
5
|
-
|
6
|
-
class RspecCommandError < StandardError; end
|
7
|
-
|
8
|
-
# This class maps your application's structure so Autotest can understand what
|
9
|
-
# specs to run when files change.
|
10
|
-
#
|
11
|
-
# Fixtures are _not_ covered by this class. If you change a fixture file, you
|
12
|
-
# will have to run your spec suite manually, or, better yet, provide your own
|
13
|
-
# Autotest map explaining how your fixtures are set up.
|
14
|
-
class Autotest::MerbRspec < Autotest
|
15
|
-
def initialize
|
16
|
-
super
|
17
|
-
|
18
|
-
# Ignore any happenings in these directories
|
19
|
-
add_exception %r%^\./(?:doc|log|public|tmp|\.git|\.hg|\.svn|framework|gems|schema|\.DS_Store|autotest|bin|.*\.sqlite3)%
|
20
|
-
# Ignore SCM directories and custom Autotest mappings
|
21
|
-
%w[.svn .hg .git .autotest].each { |exception| add_exception(exception) }
|
22
|
-
|
23
|
-
# Ignore any mappings that Autotest may have already set up
|
24
|
-
clear_mappings
|
25
|
-
|
26
|
-
# Anything in /lib could have a spec anywhere, if at all. So, look for
|
27
|
-
# files with roughly the same name as the file in /lib
|
28
|
-
add_mapping %r%^lib\/(.*)\.rb% do |_, m|
|
29
|
-
files_matching %r%^spec\/#{m[1]}%
|
30
|
-
end
|
31
|
-
|
32
|
-
add_mapping %r%^spec/(spec_helper|shared/.*)\.rb$% do
|
33
|
-
all_specs
|
34
|
-
end
|
35
|
-
|
36
|
-
# Changing a spec will cause it to run itself
|
37
|
-
add_mapping %r%^spec/.*\.rb$% do |filename, _|
|
38
|
-
filename
|
39
|
-
end
|
40
|
-
|
41
|
-
# Any change to a model will cause it's corresponding test to be run
|
42
|
-
add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
|
43
|
-
spec_for(m[1], 'model')
|
44
|
-
end
|
45
|
-
|
46
|
-
# Any change to global_helpers will result in all view and controller
|
47
|
-
# tests being run
|
48
|
-
add_mapping %r%^app/helpers/global_helpers\.rb% do
|
49
|
-
files_matching %r%^spec/(views|controllers|helpers)/.*_spec\.rb$%
|
50
|
-
end
|
51
|
-
|
52
|
-
# Any change to a helper will cause its spec to be run
|
53
|
-
add_mapping %r%^app/helpers/((.*)_helper(s)?)\.rb% do |_, m|
|
54
|
-
spec_for(m[1], 'helper')
|
55
|
-
end
|
56
|
-
|
57
|
-
# Changes to a view cause its spec to be run
|
58
|
-
add_mapping %r%^app/views/(.*)/% do |_, m|
|
59
|
-
spec_for(m[1], 'view')
|
60
|
-
end
|
61
|
-
|
62
|
-
# Changes to a controller result in its corresponding spec being run. If
|
63
|
-
# the controller is the exception or application controller, all
|
64
|
-
# controller specs are run.
|
65
|
-
add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
|
66
|
-
if ["application", "exception"].include?(m[1])
|
67
|
-
files_matching %r%^spec/controllers/.*_spec\.rb$%
|
68
|
-
else
|
69
|
-
spec_for(m[1], 'controller')
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
# If a change is made to the router, run controller, view and helper specs
|
74
|
-
add_mapping %r%^config/router.rb$% do
|
75
|
-
files_matching %r%^spec/(controllers|views|helpers)/.*_spec\.rb$%
|
76
|
-
end
|
77
|
-
|
78
|
-
# If any of the major files governing the environment are altered, run
|
79
|
-
# everything
|
80
|
-
add_mapping %r%^config/(init|rack|environments/test).*\.rb|database\.yml% do
|
81
|
-
all_specs
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def failed_results(results)
|
86
|
-
results.scan(/^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m)
|
87
|
-
end
|
88
|
-
|
89
|
-
def handle_results(results)
|
90
|
-
@failures = failed_results(results)
|
91
|
-
@files_to_test = consolidate_failures(@failures)
|
92
|
-
@files_to_test.empty? && !$TESTING ? hook(:green) : hook(:red)
|
93
|
-
@tainted = !@files_to_test.empty?
|
94
|
-
end
|
95
|
-
|
96
|
-
def consolidate_failures(failed)
|
97
|
-
filters = Hash.new { |h,k| h[k] = [] }
|
98
|
-
failed.each do |spec, failed_trace|
|
99
|
-
if f = test_files_for(failed).find { |f| f =~ /spec\// }
|
100
|
-
filters[f] << spec
|
101
|
-
break
|
102
|
-
end
|
103
|
-
end
|
104
|
-
filters
|
105
|
-
end
|
106
|
-
|
107
|
-
def make_test_cmd(specs_to_runs)
|
108
|
-
[
|
109
|
-
ruby,
|
110
|
-
"-S",
|
111
|
-
spec_command,
|
112
|
-
add_options_if_present,
|
113
|
-
files_to_test.keys.flatten.join(' ')
|
114
|
-
].join(' ')
|
115
|
-
end
|
116
|
-
|
117
|
-
def add_options_if_present
|
118
|
-
File.exist?("spec/spec.opts") ? "-O spec/spec.opts " : ""
|
119
|
-
end
|
120
|
-
|
121
|
-
# Finds the proper spec command to use. Precendence is set in the
|
122
|
-
# lazily-evaluated method spec_commands. Alias + Override that in
|
123
|
-
# ~/.autotest to provide a different spec command then the default
|
124
|
-
# paths provided.
|
125
|
-
def spec_command(separator=File::ALT_SEPARATOR)
|
126
|
-
unless defined?(@spec_command)
|
127
|
-
@spec_command = spec_commands.find { |cmd| File.exists?(cmd) }
|
128
|
-
|
129
|
-
raise RspecCommandError, "No spec command could be found" unless @spec_command
|
130
|
-
|
131
|
-
@spec_command.gsub!(File::SEPARATOR, separator) if separator
|
132
|
-
end
|
133
|
-
@spec_command
|
134
|
-
end
|
135
|
-
|
136
|
-
# Autotest will look for spec commands in the following
|
137
|
-
# locations, in this order:
|
138
|
-
#
|
139
|
-
# * default spec bin/loader installed in Rubygems
|
140
|
-
# * any spec command found in PATH
|
141
|
-
def spec_commands
|
142
|
-
[File.join(Config::CONFIG['bindir'], 'spec'), 'spec']
|
143
|
-
end
|
144
|
-
|
145
|
-
private
|
146
|
-
|
147
|
-
# Runs +files_matching+ for all specs
|
148
|
-
def all_specs
|
149
|
-
files_matching %r%^spec/.*_spec\.rb$%
|
150
|
-
end
|
151
|
-
|
152
|
-
# Generates a path to some spec given its kind and the match from a mapping
|
153
|
-
#
|
154
|
-
# ==== Arguments
|
155
|
-
# match<String>:: the match from a mapping
|
156
|
-
# kind<String>:: the kind of spec that the match represents
|
157
|
-
#
|
158
|
-
# ==== Returns
|
159
|
-
# String
|
160
|
-
#
|
161
|
-
# ==== Example
|
162
|
-
# > spec_for('post', :view')
|
163
|
-
# => "spec/views/post_spec.rb"
|
164
|
-
def spec_for(match, kind)
|
165
|
-
File.join("spec", kind + 's', "#{match}_spec.rb")
|
166
|
-
end
|
167
|
-
end
|