rango 0.1.pre → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -1
- data/README.textile +12 -4
- data/examples/README.textile +7 -8
- data/{stubs/project/content → examples/blog}/Gemfile +27 -4
- data/examples/blog/Rakefile +12 -0
- data/{vendor/cli → examples/blog}/TODO.txt +0 -0
- data/examples/blog/bin/autospec +3 -0
- data/examples/blog/bin/css2sass +3 -0
- data/examples/blog/bin/cucumber +3 -0
- data/examples/blog/bin/haml +3 -0
- data/examples/blog/bin/html2haml +3 -0
- data/examples/blog/bin/htmldiff +3 -0
- data/examples/blog/bin/launchy +3 -0
- data/examples/blog/bin/ldiff +3 -0
- data/examples/blog/bin/nokogiri +3 -0
- data/examples/blog/bin/racksh +3 -0
- data/examples/blog/bin/rackup +3 -0
- data/examples/blog/bin/rake +3 -0
- data/examples/blog/bin/rango +3 -0
- data/examples/blog/bin/sass +3 -0
- data/examples/blog/bin/shotgun +3 -0
- data/examples/blog/bin/simple-templater +3 -0
- data/examples/blog/bin/spec +3 -0
- data/examples/blog/bin/tt +3 -0
- data/examples/blog/blog/init.rb +9 -0
- data/examples/blog/blog/models.rb +21 -0
- data/examples/blog/blog/views.rb +16 -0
- data/examples/blog/config.ru +19 -0
- 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 +49 -0
- data/examples/blog/settings.rb +15 -0
- data/examples/{twitter → blog}/settings_local.rb +0 -0
- data/examples/blog/spec/blog/init_spec.rb +7 -0
- data/examples/blog/spec/blog/models_spec.rb +28 -0
- data/examples/blog/spec/blog/views_spec.rb +22 -0
- data/{vendor/cli → examples/blog}/spec/spec.opts +0 -0
- data/examples/blog/spec/spec_helper.rb +27 -0
- data/examples/blog/templates/base.html.haml +16 -0
- data/examples/blog/templates/index.html.haml +12 -0
- data/lib/rango.rb +1 -1
- data/lib/rango/contrib/pagination.rb +1 -2
- data/lib/rango/contrib/pagination/TODO +1 -2
- data/lib/rango/contrib/pagination/_pagination.html.haml +4 -4
- data/lib/rango/contrib/pagination/helpers.rb +10 -0
- data/lib/rango/exceptions.rb +1 -4
- data/lib/rango/gv.rb +8 -0
- data/lib/rango/helpers/merb-helpers/date_time_formatting.rb +2 -0
- data/lib/rango/helpers/merb-helpers/form/builder.rb +0 -1
- data/lib/rango/mixins/render.rb +3 -0
- data/lib/rango/orm/adapters/datamapper.rb +8 -0
- data/lib/rango/orm/support/datamapper/support.rb +2 -0
- data/lib/rango/orm/tasks/datamapper.rake +41 -0
- data/lib/rango/orm/tasks/sequel.rake +3 -0
- data/lib/rango/rack/request.rb +2 -0
- data/lib/rango/rango.rb +19 -5
- data/lib/rango/router.rb +9 -0
- data/lib/rango/router/adapters/rack_mount.rb +17 -0
- data/lib/rango/router/adapters/usher.rb +1 -1
- data/lib/rango/settings/erubis.rb +2 -0
- data/lib/rango/settings/framework.rb +1 -1
- data/lib/rango/settings/haml.rb +6 -0
- data/lib/rango/settings/template.rb +3 -1
- data/lib/rango/tasks/spec.rake +7 -0
- data/lib/rango/templates/adapter.rb +1 -1
- data/lib/rango/templates/erubis.rb +2 -2
- data/lib/rango/templates/template.rb +13 -1
- data/lib/rango/templates/templates.txt +1 -1
- data/lib/rango/{testing.rb → utils.rb} +1 -1
- data/spec/rango/helpers/merb-helpers/merb_helpers_text_spec.rb +1 -0
- data/spec/rango/helpers/merb-helpers/ordinalize_spec.rb +1 -0
- data/spec/rango/project_spec.rb +2 -2
- data/spec/rango_spec.rb +0 -4
- data/stubs/app/content/init.rb.rbt +4 -1
- data/stubs/app/content/models.rb.rbt +17 -6
- data/stubs/app/content/views.rb.rbt +17 -6
- data/stubs/app/setup.rb +4 -3
- data/stubs/project/content/Gemfile.rbt +106 -0
- data/stubs/project/content/Rakefile.rbt +12 -0
- data/stubs/project/content/config.ru.rbt +33 -5
- data/stubs/project/content/init.rb.rbt +34 -4
- data/stubs/project/content/spec/%name%/init_spec.rb.rbt +7 -0
- data/stubs/project/content/spec/%name%/models_spec.rb.rbt +23 -0
- data/stubs/project/content/spec/%name%/views_spec.rb.rbt +23 -0
- data/{vendor/media-path → stubs/project/content}/spec/spec.opts +0 -0
- data/stubs/project/content/spec/spec_helper.rb +24 -6
- data/stubs/project/content/templates/base.html.haml.rbt +9 -22
- data/stubs/project/content/templates/index.html.haml +37 -0
- data/stubs/project/postprocess.rb +7 -1
- data/stubs/project/setup.rb +6 -3
- metadata +92 -1857
- data/benchmarks/ab.rb +0 -6
- data/benchmarks/bm/boot.rb +0 -20
- data/benchmarks/bm/callbacks.rb +0 -0
- data/benchmarks/bm/request.rb +0 -4
- data/benchmarks/bm/routers.rb +0 -22
- data/benchmarks/bm/stack.rb +0 -19
- data/benchmarks/bm/templates.rb +0 -0
- data/benchmarks/helper.rb +0 -7
- 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/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.opts +0 -0
- 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/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/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.opts +0 -0
- 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/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/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/log/development.log +0 -0
- data/benchmarks/stubs/rails/log/production.log +0 -0
- data/benchmarks/stubs/rails/log/server.log +0 -0
- data/benchmarks/stubs/rails/log/test.log +0 -0
- 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/favicon.ico +0 -0
- 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/deps.rip +0 -8
- data/doc/0.0.3/Array.html +0 -354
- data/doc/0.0.3/AttributeMixin.html +0 -697
- data/doc/0.0.3/Class.html +0 -102
- data/doc/0.0.3/ColoredString.html +0 -476
- data/doc/0.0.3/Enumerable.html +0 -256
- data/doc/0.0.3/File.html +0 -909
- data/doc/0.0.3/Hash.html +0 -1586
- data/doc/0.0.3/Kernel.html +0 -956
- data/doc/0.0.3/OS.html +0 -740
- data/doc/0.0.3/Object.html +0 -466
- data/doc/0.0.3/ObjectSpace.html +0 -184
- data/doc/0.0.3/Path.html +0 -2499
- data/doc/0.0.3/Range.html +0 -190
- data/doc/0.0.3/Rango.html +0 -379
- data/doc/0.0.3/Rango/ApplicationMixin.html +0 -396
- data/doc/0.0.3/Rango/Bundling.html +0 -23
- data/doc/0.0.3/Rango/Bundling/RequireStrategy.html +0 -283
- data/doc/0.0.3/Rango/Bundling/Strategy.html +0 -703
- data/doc/0.0.3/Rango/CLI.html +0 -23
- data/doc/0.0.3/Rango/CLI/Generator.html +0 -762
- data/doc/0.0.3/Rango/CLI/Templater.html +0 -258
- data/doc/0.0.3/Rango/CallableStrategy.html +0 -300
- data/doc/0.0.3/Rango/Chainable.html +0 -181
- data/doc/0.0.3/Rango/Configurable.html +0 -199
- data/doc/0.0.3/Rango/Controller.html +0 -962
- data/doc/0.0.3/Rango/ControllerMixin.html +0 -860
- data/doc/0.0.3/Rango/ControllerStrategy.html +0 -264
- data/doc/0.0.3/Rango/DependencyStrategy.html +0 -116
- data/doc/0.0.3/Rango/Dispatcher.html +0 -305
- data/doc/0.0.3/Rango/Form.html +0 -162
- data/doc/0.0.3/Rango/GemDependencyStrategy.html +0 -210
- data/doc/0.0.3/Rango/Generator.html +0 -93
- data/doc/0.0.3/Rango/GenericViews.html +0 -128
- data/doc/0.0.3/Rango/GitDependencyStrategy.html +0 -224
- data/doc/0.0.3/Rango/GithubDependencyStrategy.html +0 -118
- data/doc/0.0.3/Rango/Handler.html +0 -474
- data/doc/0.0.3/Rango/Helpers.html +0 -1335
- data/doc/0.0.3/Rango/Hookable.html +0 -202
- data/doc/0.0.3/Rango/ImportMixin.html +0 -755
- data/doc/0.0.3/Rango/Logger.html +0 -920
- data/doc/0.0.3/Rango/Mini.html +0 -117
- data/doc/0.0.3/Rango/ModelForm.html +0 -42
- data/doc/0.0.3/Rango/Project.html +0 -516
- data/doc/0.0.3/Rango/RenderMixin.html +0 -23
- data/doc/0.0.3/Rango/Request.html +0 -1177
- data/doc/0.0.3/Rango/Route.html +0 -751
- data/doc/0.0.3/Rango/Router.html +0 -42
- data/doc/0.0.3/Rango/Router/Dispatcher.html +0 -311
- data/doc/0.0.3/Rango/RouterStrategy.html +0 -258
- data/doc/0.0.3/Rango/Session.html +0 -23
- data/doc/0.0.3/Rango/Settings.html +0 -23
- data/doc/0.0.3/Rango/Settings/Erubis.html +0 -23
- data/doc/0.0.3/Rango/Settings/Framework.html +0 -254
- data/doc/0.0.3/Rango/Settings/Haml.html +0 -23
- data/doc/0.0.3/Rango/Settings/Template.html +0 -23
- data/doc/0.0.3/Rango/SimpleTemplate.html +0 -187
- data/doc/0.0.3/Rango/StrategyMixin.html +0 -261
- data/doc/0.0.3/Rango/Tasks.html +0 -219
- data/doc/0.0.3/Rango/Template.html +0 -95
- data/doc/0.0.3/Rango/Template/Adapter.html +0 -90
- data/doc/0.0.3/Rango/Templates.html +0 -116
- data/doc/0.0.3/Rango/Templates/Adapter.html +0 -128
- data/doc/0.0.3/Rango/Templates/Template.html +0 -636
- data/doc/0.0.3/Rango/Templates/TemplateHelpers.html +0 -328
- data/doc/0.0.3/RangoThor.html +0 -205
- data/doc/0.0.3/String.html +0 -307
- data/doc/0.0.3/Time.html +0 -193
- data/doc/0.0.3/TimeDSL.html +0 -601
- data/doc/0.0.3/all-methods.html +0 -1908
- data/doc/0.0.3/all-namespaces.html +0 -114
- data/doc/0.0.3/app.js +0 -18
- data/doc/0.0.3/head/Array.html +0 -354
- data/doc/0.0.3/head/AttributeMixin.html +0 -697
- data/doc/0.0.3/head/Class.html +0 -102
- data/doc/0.0.3/head/ColoredString.html +0 -476
- data/doc/0.0.3/head/Enumerable.html +0 -256
- data/doc/0.0.3/head/File.html +0 -909
- data/doc/0.0.3/head/Hash.html +0 -1586
- data/doc/0.0.3/head/Kernel.html +0 -956
- data/doc/0.0.3/head/OS.html +0 -740
- data/doc/0.0.3/head/Object.html +0 -466
- data/doc/0.0.3/head/ObjectSpace.html +0 -184
- data/doc/0.0.3/head/Path.html +0 -2499
- data/doc/0.0.3/head/Range.html +0 -190
- data/doc/0.0.3/head/Rango.html +0 -379
- data/doc/0.0.3/head/Rango/ApplicationMixin.html +0 -396
- data/doc/0.0.3/head/Rango/Bundling.html +0 -23
- data/doc/0.0.3/head/Rango/Bundling/RequireStrategy.html +0 -283
- data/doc/0.0.3/head/Rango/Bundling/Strategy.html +0 -703
- data/doc/0.0.3/head/Rango/CLI.html +0 -23
- data/doc/0.0.3/head/Rango/CLI/Generator.html +0 -762
- data/doc/0.0.3/head/Rango/CLI/Templater.html +0 -258
- data/doc/0.0.3/head/Rango/CallableStrategy.html +0 -300
- data/doc/0.0.3/head/Rango/Chainable.html +0 -181
- data/doc/0.0.3/head/Rango/Configurable.html +0 -199
- data/doc/0.0.3/head/Rango/Controller.html +0 -962
- data/doc/0.0.3/head/Rango/ControllerMixin.html +0 -860
- data/doc/0.0.3/head/Rango/ControllerStrategy.html +0 -264
- data/doc/0.0.3/head/Rango/DependencyStrategy.html +0 -116
- data/doc/0.0.3/head/Rango/Dispatcher.html +0 -305
- data/doc/0.0.3/head/Rango/Form.html +0 -162
- data/doc/0.0.3/head/Rango/GemDependencyStrategy.html +0 -210
- data/doc/0.0.3/head/Rango/Generator.html +0 -93
- data/doc/0.0.3/head/Rango/GenericViews.html +0 -128
- data/doc/0.0.3/head/Rango/GitDependencyStrategy.html +0 -224
- data/doc/0.0.3/head/Rango/GithubDependencyStrategy.html +0 -118
- data/doc/0.0.3/head/Rango/Handler.html +0 -474
- data/doc/0.0.3/head/Rango/Helpers.html +0 -1335
- data/doc/0.0.3/head/Rango/Hookable.html +0 -202
- data/doc/0.0.3/head/Rango/ImportMixin.html +0 -755
- data/doc/0.0.3/head/Rango/Logger.html +0 -920
- data/doc/0.0.3/head/Rango/Mini.html +0 -117
- data/doc/0.0.3/head/Rango/ModelForm.html +0 -42
- data/doc/0.0.3/head/Rango/Project.html +0 -516
- data/doc/0.0.3/head/Rango/RenderMixin.html +0 -23
- data/doc/0.0.3/head/Rango/Request.html +0 -1177
- data/doc/0.0.3/head/Rango/Route.html +0 -751
- data/doc/0.0.3/head/Rango/Router.html +0 -42
- data/doc/0.0.3/head/Rango/Router/Dispatcher.html +0 -311
- data/doc/0.0.3/head/Rango/RouterStrategy.html +0 -258
- data/doc/0.0.3/head/Rango/Session.html +0 -23
- data/doc/0.0.3/head/Rango/Settings.html +0 -23
- data/doc/0.0.3/head/Rango/Settings/Erubis.html +0 -23
- data/doc/0.0.3/head/Rango/Settings/Framework.html +0 -254
- data/doc/0.0.3/head/Rango/Settings/Haml.html +0 -23
- data/doc/0.0.3/head/Rango/Settings/Template.html +0 -23
- data/doc/0.0.3/head/Rango/SimpleTemplate.html +0 -187
- data/doc/0.0.3/head/Rango/StrategyMixin.html +0 -261
- data/doc/0.0.3/head/Rango/Tasks.html +0 -219
- data/doc/0.0.3/head/Rango/Template.html +0 -95
- data/doc/0.0.3/head/Rango/Template/Adapter.html +0 -90
- data/doc/0.0.3/head/Rango/Templates.html +0 -116
- data/doc/0.0.3/head/Rango/Templates/Adapter.html +0 -128
- data/doc/0.0.3/head/Rango/Templates/Template.html +0 -636
- data/doc/0.0.3/head/Rango/Templates/TemplateHelpers.html +0 -328
- data/doc/0.0.3/head/RangoThor.html +0 -205
- data/doc/0.0.3/head/String.html +0 -307
- data/doc/0.0.3/head/Time.html +0 -193
- data/doc/0.0.3/head/TimeDSL.html +0 -601
- data/doc/0.0.3/head/all-methods.html +0 -1908
- data/doc/0.0.3/head/all-namespaces.html +0 -114
- data/doc/0.0.3/head/app.js +0 -18
- data/doc/0.0.3/head/index.html +0 -18
- data/doc/0.0.3/head/jquery.js +0 -11
- data/doc/0.0.3/head/readme.html +0 -36
- data/doc/0.0.3/head/style.css +0 -68
- data/doc/0.0.3/head/syntax_highlight.css +0 -21
- data/doc/0.0.3/index.html +0 -18
- data/doc/0.0.3/jquery.js +0 -11
- data/doc/0.0.3/readme.html +0 -36
- data/doc/0.0.3/style.css +0 -68
- data/doc/0.0.3/syntax_highlight.css +0 -21
- data/doc/0.0.4/Array.html +0 -354
- data/doc/0.0.4/AttributeMixin.html +0 -697
- data/doc/0.0.4/Class.html +0 -102
- data/doc/0.0.4/ColoredString.html +0 -476
- data/doc/0.0.4/Enumerable.html +0 -256
- data/doc/0.0.4/File.html +0 -909
- data/doc/0.0.4/Hash.html +0 -1586
- data/doc/0.0.4/Kernel.html +0 -956
- data/doc/0.0.4/OS.html +0 -740
- data/doc/0.0.4/Object.html +0 -466
- data/doc/0.0.4/ObjectSpace.html +0 -184
- data/doc/0.0.4/Path.html +0 -2499
- data/doc/0.0.4/Range.html +0 -190
- data/doc/0.0.4/Rango.html +0 -379
- data/doc/0.0.4/Rango/ApplicationMixin.html +0 -396
- data/doc/0.0.4/Rango/Bundling.html +0 -23
- data/doc/0.0.4/Rango/Bundling/RequireStrategy.html +0 -283
- data/doc/0.0.4/Rango/Bundling/Strategy.html +0 -703
- data/doc/0.0.4/Rango/CLI.html +0 -23
- data/doc/0.0.4/Rango/CLI/Generator.html +0 -762
- data/doc/0.0.4/Rango/CLI/Templater.html +0 -258
- data/doc/0.0.4/Rango/CallableStrategy.html +0 -300
- data/doc/0.0.4/Rango/Chainable.html +0 -181
- data/doc/0.0.4/Rango/Configurable.html +0 -199
- data/doc/0.0.4/Rango/Controller.html +0 -962
- data/doc/0.0.4/Rango/ControllerMixin.html +0 -860
- data/doc/0.0.4/Rango/ControllerStrategy.html +0 -264
- data/doc/0.0.4/Rango/DependencyStrategy.html +0 -116
- data/doc/0.0.4/Rango/Dispatcher.html +0 -305
- data/doc/0.0.4/Rango/Form.html +0 -162
- data/doc/0.0.4/Rango/GemDependencyStrategy.html +0 -210
- data/doc/0.0.4/Rango/Generator.html +0 -93
- data/doc/0.0.4/Rango/GenericViews.html +0 -128
- data/doc/0.0.4/Rango/GitDependencyStrategy.html +0 -224
- data/doc/0.0.4/Rango/GithubDependencyStrategy.html +0 -118
- data/doc/0.0.4/Rango/Handler.html +0 -474
- data/doc/0.0.4/Rango/Helpers.html +0 -1335
- data/doc/0.0.4/Rango/Hookable.html +0 -202
- data/doc/0.0.4/Rango/ImportMixin.html +0 -755
- data/doc/0.0.4/Rango/Logger.html +0 -920
- data/doc/0.0.4/Rango/Mini.html +0 -117
- data/doc/0.0.4/Rango/ModelForm.html +0 -42
- data/doc/0.0.4/Rango/Project.html +0 -516
- data/doc/0.0.4/Rango/RenderMixin.html +0 -23
- data/doc/0.0.4/Rango/Request.html +0 -1177
- data/doc/0.0.4/Rango/Route.html +0 -751
- data/doc/0.0.4/Rango/Router.html +0 -42
- data/doc/0.0.4/Rango/Router/Dispatcher.html +0 -311
- data/doc/0.0.4/Rango/RouterStrategy.html +0 -258
- data/doc/0.0.4/Rango/Session.html +0 -23
- data/doc/0.0.4/Rango/Settings.html +0 -23
- data/doc/0.0.4/Rango/Settings/Erubis.html +0 -23
- data/doc/0.0.4/Rango/Settings/Framework.html +0 -254
- data/doc/0.0.4/Rango/Settings/Haml.html +0 -23
- data/doc/0.0.4/Rango/Settings/Template.html +0 -23
- data/doc/0.0.4/Rango/SimpleTemplate.html +0 -187
- data/doc/0.0.4/Rango/StrategyMixin.html +0 -261
- data/doc/0.0.4/Rango/Tasks.html +0 -219
- data/doc/0.0.4/Rango/Template.html +0 -95
- data/doc/0.0.4/Rango/Template/Adapter.html +0 -90
- data/doc/0.0.4/Rango/Templates.html +0 -116
- data/doc/0.0.4/Rango/Templates/Adapter.html +0 -128
- data/doc/0.0.4/Rango/Templates/Template.html +0 -636
- data/doc/0.0.4/Rango/Templates/TemplateHelpers.html +0 -328
- data/doc/0.0.4/RangoThor.html +0 -205
- data/doc/0.0.4/String.html +0 -307
- data/doc/0.0.4/Time.html +0 -193
- data/doc/0.0.4/TimeDSL.html +0 -601
- data/doc/0.0.4/all-methods.html +0 -1908
- data/doc/0.0.4/all-namespaces.html +0 -114
- data/doc/0.0.4/app.js +0 -18
- data/doc/0.0.4/head/Array.html +0 -354
- data/doc/0.0.4/head/AttributeMixin.html +0 -697
- data/doc/0.0.4/head/Class.html +0 -102
- data/doc/0.0.4/head/ColoredString.html +0 -476
- data/doc/0.0.4/head/Enumerable.html +0 -256
- data/doc/0.0.4/head/File.html +0 -909
- data/doc/0.0.4/head/Hash.html +0 -1586
- data/doc/0.0.4/head/Kernel.html +0 -956
- data/doc/0.0.4/head/OS.html +0 -740
- data/doc/0.0.4/head/Object.html +0 -466
- data/doc/0.0.4/head/ObjectSpace.html +0 -184
- data/doc/0.0.4/head/Path.html +0 -2499
- data/doc/0.0.4/head/Range.html +0 -190
- data/doc/0.0.4/head/Rango.html +0 -379
- data/doc/0.0.4/head/Rango/ApplicationMixin.html +0 -396
- data/doc/0.0.4/head/Rango/Bundling.html +0 -23
- data/doc/0.0.4/head/Rango/Bundling/RequireStrategy.html +0 -283
- data/doc/0.0.4/head/Rango/Bundling/Strategy.html +0 -703
- data/doc/0.0.4/head/Rango/CLI.html +0 -23
- data/doc/0.0.4/head/Rango/CLI/Generator.html +0 -762
- data/doc/0.0.4/head/Rango/CLI/Templater.html +0 -258
- data/doc/0.0.4/head/Rango/CallableStrategy.html +0 -300
- data/doc/0.0.4/head/Rango/Chainable.html +0 -181
- data/doc/0.0.4/head/Rango/Configurable.html +0 -199
- data/doc/0.0.4/head/Rango/Controller.html +0 -962
- data/doc/0.0.4/head/Rango/ControllerMixin.html +0 -860
- data/doc/0.0.4/head/Rango/ControllerStrategy.html +0 -264
- data/doc/0.0.4/head/Rango/DependencyStrategy.html +0 -116
- data/doc/0.0.4/head/Rango/Dispatcher.html +0 -305
- data/doc/0.0.4/head/Rango/Form.html +0 -162
- data/doc/0.0.4/head/Rango/GemDependencyStrategy.html +0 -210
- data/doc/0.0.4/head/Rango/Generator.html +0 -93
- data/doc/0.0.4/head/Rango/GenericViews.html +0 -128
- data/doc/0.0.4/head/Rango/GitDependencyStrategy.html +0 -224
- data/doc/0.0.4/head/Rango/GithubDependencyStrategy.html +0 -118
- data/doc/0.0.4/head/Rango/Handler.html +0 -474
- data/doc/0.0.4/head/Rango/Helpers.html +0 -1335
- data/doc/0.0.4/head/Rango/Hookable.html +0 -202
- data/doc/0.0.4/head/Rango/ImportMixin.html +0 -755
- data/doc/0.0.4/head/Rango/Logger.html +0 -920
- data/doc/0.0.4/head/Rango/Mini.html +0 -117
- data/doc/0.0.4/head/Rango/ModelForm.html +0 -42
- data/doc/0.0.4/head/Rango/Project.html +0 -516
- data/doc/0.0.4/head/Rango/RenderMixin.html +0 -23
- data/doc/0.0.4/head/Rango/Request.html +0 -1177
- data/doc/0.0.4/head/Rango/Route.html +0 -751
- data/doc/0.0.4/head/Rango/Router.html +0 -42
- data/doc/0.0.4/head/Rango/Router/Dispatcher.html +0 -311
- data/doc/0.0.4/head/Rango/RouterStrategy.html +0 -258
- data/doc/0.0.4/head/Rango/Session.html +0 -23
- data/doc/0.0.4/head/Rango/Settings.html +0 -23
- data/doc/0.0.4/head/Rango/Settings/Erubis.html +0 -23
- data/doc/0.0.4/head/Rango/Settings/Framework.html +0 -254
- data/doc/0.0.4/head/Rango/Settings/Haml.html +0 -23
- data/doc/0.0.4/head/Rango/Settings/Template.html +0 -23
- data/doc/0.0.4/head/Rango/SimpleTemplate.html +0 -187
- data/doc/0.0.4/head/Rango/StrategyMixin.html +0 -261
- data/doc/0.0.4/head/Rango/Tasks.html +0 -219
- data/doc/0.0.4/head/Rango/Template.html +0 -95
- data/doc/0.0.4/head/Rango/Template/Adapter.html +0 -90
- data/doc/0.0.4/head/Rango/Templates.html +0 -116
- data/doc/0.0.4/head/Rango/Templates/Adapter.html +0 -128
- data/doc/0.0.4/head/Rango/Templates/Template.html +0 -636
- data/doc/0.0.4/head/Rango/Templates/TemplateHelpers.html +0 -328
- data/doc/0.0.4/head/RangoThor.html +0 -205
- data/doc/0.0.4/head/String.html +0 -307
- data/doc/0.0.4/head/Time.html +0 -193
- data/doc/0.0.4/head/TimeDSL.html +0 -601
- data/doc/0.0.4/head/all-methods.html +0 -1908
- data/doc/0.0.4/head/all-namespaces.html +0 -114
- data/doc/0.0.4/head/app.js +0 -18
- data/doc/0.0.4/head/index.html +0 -18
- data/doc/0.0.4/head/jquery.js +0 -11
- data/doc/0.0.4/head/readme.html +0 -36
- data/doc/0.0.4/head/style.css +0 -68
- data/doc/0.0.4/head/syntax_highlight.css +0 -21
- data/doc/0.0.4/index.html +0 -18
- data/doc/0.0.4/jquery.js +0 -11
- data/doc/0.0.4/readme.html +0 -36
- data/doc/0.0.4/style.css +0 -68
- data/doc/0.0.4/syntax_highlight.css +0 -21
- data/doc/0.0.5/Array.html +0 -354
- data/doc/0.0.5/AttributeMixin.html +0 -697
- data/doc/0.0.5/Class.html +0 -102
- data/doc/0.0.5/ColoredString.html +0 -476
- data/doc/0.0.5/Enumerable.html +0 -256
- data/doc/0.0.5/File.html +0 -909
- data/doc/0.0.5/Hash.html +0 -1586
- data/doc/0.0.5/Kernel.html +0 -956
- data/doc/0.0.5/OS.html +0 -740
- data/doc/0.0.5/Object.html +0 -466
- data/doc/0.0.5/ObjectSpace.html +0 -184
- data/doc/0.0.5/Path.html +0 -2499
- data/doc/0.0.5/Range.html +0 -190
- data/doc/0.0.5/Rango.html +0 -379
- data/doc/0.0.5/Rango/ApplicationMixin.html +0 -396
- data/doc/0.0.5/Rango/Bundling.html +0 -23
- data/doc/0.0.5/Rango/Bundling/RequireStrategy.html +0 -283
- data/doc/0.0.5/Rango/Bundling/Strategy.html +0 -703
- data/doc/0.0.5/Rango/CLI.html +0 -23
- data/doc/0.0.5/Rango/CLI/Generator.html +0 -762
- data/doc/0.0.5/Rango/CLI/Templater.html +0 -258
- data/doc/0.0.5/Rango/CallableStrategy.html +0 -300
- data/doc/0.0.5/Rango/Chainable.html +0 -181
- data/doc/0.0.5/Rango/Configurable.html +0 -199
- data/doc/0.0.5/Rango/Controller.html +0 -962
- data/doc/0.0.5/Rango/ControllerMixin.html +0 -860
- data/doc/0.0.5/Rango/ControllerStrategy.html +0 -264
- data/doc/0.0.5/Rango/DependencyStrategy.html +0 -116
- data/doc/0.0.5/Rango/Dispatcher.html +0 -305
- data/doc/0.0.5/Rango/Form.html +0 -162
- data/doc/0.0.5/Rango/GemDependencyStrategy.html +0 -210
- data/doc/0.0.5/Rango/Generator.html +0 -93
- data/doc/0.0.5/Rango/GenericViews.html +0 -128
- data/doc/0.0.5/Rango/GitDependencyStrategy.html +0 -224
- data/doc/0.0.5/Rango/GithubDependencyStrategy.html +0 -118
- data/doc/0.0.5/Rango/Handler.html +0 -474
- data/doc/0.0.5/Rango/Helpers.html +0 -1335
- data/doc/0.0.5/Rango/Hookable.html +0 -202
- data/doc/0.0.5/Rango/ImportMixin.html +0 -755
- data/doc/0.0.5/Rango/Logger.html +0 -920
- data/doc/0.0.5/Rango/Mini.html +0 -117
- data/doc/0.0.5/Rango/ModelForm.html +0 -42
- data/doc/0.0.5/Rango/Project.html +0 -516
- data/doc/0.0.5/Rango/RenderMixin.html +0 -23
- data/doc/0.0.5/Rango/Request.html +0 -1177
- data/doc/0.0.5/Rango/Route.html +0 -751
- data/doc/0.0.5/Rango/Router.html +0 -42
- data/doc/0.0.5/Rango/Router/Dispatcher.html +0 -311
- data/doc/0.0.5/Rango/RouterStrategy.html +0 -258
- data/doc/0.0.5/Rango/Session.html +0 -23
- data/doc/0.0.5/Rango/Settings.html +0 -23
- data/doc/0.0.5/Rango/Settings/Erubis.html +0 -23
- data/doc/0.0.5/Rango/Settings/Framework.html +0 -254
- data/doc/0.0.5/Rango/Settings/Haml.html +0 -23
- data/doc/0.0.5/Rango/Settings/Template.html +0 -23
- data/doc/0.0.5/Rango/SimpleTemplate.html +0 -187
- data/doc/0.0.5/Rango/StrategyMixin.html +0 -261
- data/doc/0.0.5/Rango/Tasks.html +0 -219
- data/doc/0.0.5/Rango/Template.html +0 -95
- data/doc/0.0.5/Rango/Template/Adapter.html +0 -90
- data/doc/0.0.5/Rango/Templates.html +0 -116
- data/doc/0.0.5/Rango/Templates/Adapter.html +0 -128
- data/doc/0.0.5/Rango/Templates/Template.html +0 -636
- data/doc/0.0.5/Rango/Templates/TemplateHelpers.html +0 -328
- data/doc/0.0.5/RangoThor.html +0 -205
- data/doc/0.0.5/String.html +0 -307
- data/doc/0.0.5/Time.html +0 -193
- data/doc/0.0.5/TimeDSL.html +0 -601
- data/doc/0.0.5/all-methods.html +0 -2092
- data/doc/0.0.5/all-namespaces.html +0 -126
- data/doc/0.0.5/app.js +0 -18
- data/doc/0.0.5/index.html +0 -18
- data/doc/0.0.5/jquery.js +0 -11
- data/doc/0.0.5/readme.html +0 -36
- data/doc/0.0.5/style.css +0 -68
- data/doc/0.0.5/syntax_highlight.css +0 -21
- data/doc/head/Array.html +0 -354
- data/doc/head/AttributeMixin.html +0 -697
- data/doc/head/Class.html +0 -102
- data/doc/head/ColoredString.html +0 -476
- data/doc/head/Enumerable.html +0 -256
- data/doc/head/File.html +0 -909
- data/doc/head/Hash.html +0 -1586
- data/doc/head/Kernel.html +0 -956
- data/doc/head/OS.html +0 -740
- data/doc/head/Object.html +0 -466
- data/doc/head/ObjectSpace.html +0 -184
- data/doc/head/Path.html +0 -2499
- data/doc/head/Range.html +0 -190
- data/doc/head/Rango.html +0 -379
- data/doc/head/Rango/ApplicationMixin.html +0 -396
- data/doc/head/Rango/Bundling.html +0 -23
- data/doc/head/Rango/Bundling/RequireStrategy.html +0 -283
- data/doc/head/Rango/Bundling/Strategy.html +0 -703
- data/doc/head/Rango/CLI.html +0 -23
- data/doc/head/Rango/CLI/Generator.html +0 -762
- data/doc/head/Rango/CLI/Templater.html +0 -258
- data/doc/head/Rango/CallableStrategy.html +0 -300
- data/doc/head/Rango/Chainable.html +0 -181
- data/doc/head/Rango/Configurable.html +0 -199
- data/doc/head/Rango/Controller.html +0 -962
- data/doc/head/Rango/ControllerMixin.html +0 -860
- data/doc/head/Rango/ControllerStrategy.html +0 -264
- data/doc/head/Rango/DependencyStrategy.html +0 -116
- data/doc/head/Rango/Dispatcher.html +0 -305
- data/doc/head/Rango/Form.html +0 -162
- data/doc/head/Rango/GemDependencyStrategy.html +0 -210
- data/doc/head/Rango/Generator.html +0 -93
- data/doc/head/Rango/GenericViews.html +0 -128
- data/doc/head/Rango/GitDependencyStrategy.html +0 -224
- data/doc/head/Rango/GithubDependencyStrategy.html +0 -118
- data/doc/head/Rango/Handler.html +0 -474
- data/doc/head/Rango/Helpers.html +0 -1335
- data/doc/head/Rango/Hookable.html +0 -202
- data/doc/head/Rango/ImportMixin.html +0 -755
- data/doc/head/Rango/Logger.html +0 -920
- data/doc/head/Rango/Mini.html +0 -117
- data/doc/head/Rango/ModelForm.html +0 -42
- data/doc/head/Rango/Project.html +0 -516
- data/doc/head/Rango/RenderMixin.html +0 -23
- data/doc/head/Rango/Request.html +0 -1177
- data/doc/head/Rango/Route.html +0 -751
- data/doc/head/Rango/Router.html +0 -42
- data/doc/head/Rango/Router/Dispatcher.html +0 -311
- data/doc/head/Rango/RouterStrategy.html +0 -258
- data/doc/head/Rango/Session.html +0 -23
- data/doc/head/Rango/Settings.html +0 -23
- data/doc/head/Rango/Settings/Erubis.html +0 -23
- data/doc/head/Rango/Settings/Framework.html +0 -254
- data/doc/head/Rango/Settings/Haml.html +0 -23
- data/doc/head/Rango/Settings/Template.html +0 -23
- data/doc/head/Rango/SimpleTemplate.html +0 -187
- data/doc/head/Rango/StrategyMixin.html +0 -261
- data/doc/head/Rango/Tasks.html +0 -219
- data/doc/head/Rango/Template.html +0 -95
- data/doc/head/Rango/Template/Adapter.html +0 -90
- data/doc/head/Rango/Templates.html +0 -116
- data/doc/head/Rango/Templates/Adapter.html +0 -128
- data/doc/head/Rango/Templates/Template.html +0 -636
- data/doc/head/Rango/Templates/TemplateHelpers.html +0 -328
- data/doc/head/RangoThor.html +0 -205
- data/doc/head/String.html +0 -307
- data/doc/head/Time.html +0 -193
- data/doc/head/TimeDSL.html +0 -601
- data/doc/head/all-methods.html +0 -2092
- data/doc/head/all-namespaces.html +0 -126
- data/doc/head/app.js +0 -18
- data/doc/head/index.html +0 -18
- data/doc/head/jquery.js +0 -11
- data/doc/head/readme.html +0 -36
- data/doc/head/style.css +0 -68
- data/doc/head/syntax_highlight.css +0 -21
- data/doc/versions/0.0.1/Rango.html +0 -1025
- data/doc/versions/0.0.1/Rango/CallableStrategy.html +0 -166
- data/doc/versions/0.0.1/Rango/ControllerStrategy.html +0 -180
- data/doc/versions/0.0.1/Rango/Route.html +0 -340
- data/doc/versions/0.0.1/Rango/Router.html +0 -502
- data/doc/versions/0.0.1/Rango/RouterStrategy.html +0 -94
- data/doc/versions/0.0.1/Rango/Template.html +0 -28
- data/doc/versions/0.0.1/Rango/Template/Adapter.html +0 -90
- data/doc/versions/0.0.1/all-methods.html +0 -228
- data/doc/versions/0.0.1/all-namespaces.html +0 -36
- data/doc/versions/0.0.1/app.js +0 -18
- data/doc/versions/0.0.1/index.html +0 -18
- data/doc/versions/0.0.1/jquery.js +0 -11
- data/doc/versions/0.0.1/readme.html +0 -137
- data/doc/versions/0.0.1/style.css +0 -68
- data/doc/versions/0.0.1/syntax_highlight.css +0 -21
- data/examples/TODO +0 -0
- data/examples/flat/basic.ru +0 -31
- data/examples/flat/generic_views.ru +0 -16
- data/examples/flat/info.ru +0 -18
- data/examples/flat/simple_controller.ru +0 -1
- data/examples/flat/templates/about/author.html.haml +0 -1
- data/examples/flat/templates/about/contact.html.haml +0 -0
- data/examples/flat/templates/base.html.haml +0 -0
- data/examples/flat/templates/info.html.haml +0 -25
- data/examples/twitter/Thorfile +0 -12
- data/examples/twitter/config.ru +0 -48
- data/examples/twitter/development.db +0 -0
- data/examples/twitter/factories.rb +0 -19
- data/examples/twitter/init.rb +0 -15
- data/examples/twitter/media/hello-static.txt +0 -0
- data/examples/twitter/models.rb +0 -13
- data/examples/twitter/run.rb +0 -8
- data/examples/twitter/settings.rb +0 -5
- data/examples/twitter/templates/base.html.haml +0 -9
- data/examples/twitter/templates/index.html.haml +0 -4
- data/examples/twitter/templates/show.html.haml +0 -4
- data/examples/twitter/templates/timeline.html.haml +0 -10
- data/examples/twitter/views.rb +0 -40
- data/lib/rango/orm/tasks/datamapper.thor +0 -41
- data/lib/rango/orm/tasks/sequel.thor +0 -0
- data/rango-0.0.6.pre.gem +0 -0
- data/rango.gemspec +0 -48
- data/rango.pre.gemspec +0 -48
- data/runcoderun.sh +0 -19
- data/script/erubis +0 -11
- data/script/rackup +0 -2
- data/script/rake2thor +0 -86
- data/script/spec +0 -12
- data/script/thor +0 -12
- data/stubs/project/content/Rakefile +0 -9
- data/support/Rango.tmbundle/Commands/Documentation for current word.tmCommand +0 -22
- data/support/Rango.tmbundle/Commands/Got to import.tmCommand +0 -23
- data/support/Rango.tmbundle/Commands/Rango console.tmCommand +0 -22
- data/support/Rango.tmbundle/Commands/Rango server.tmCommand +0 -22
- data/support/Rango.tmbundle/Commands/Read documentation.tmCommand +0 -22
- data/support/Rango.tmbundle/Snippets/Method with yardoc.tmSnippet +0 -20
- data/support/Rango.tmbundle/Snippets/Project_configure.tmSnippet +0 -18
- data/support/Rango.tmbundle/Snippets/Project_import.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Project_logger_debug.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Project_logger_error.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Project_logger_fatal.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Project_logger_inspect.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Project_logger_warn.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Rango_dependency.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Rango_import.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Rango_logger_debug.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Rango_logger_error.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Rango_logger_fatal.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Rango_logger_inspect.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/Rango_logger_warn.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/controller.tmSnippet +0 -28
- data/support/Rango.tmbundle/Snippets/doc.tmSnippet +0 -20
- data/support/Rango.tmbundle/Snippets/match.tmSnippet +0 -16
- data/support/Rango.tmbundle/Snippets/thor task.tmSnippet +0 -19
- data/support/Rango.tmbundle/info.plist +0 -37
- data/support/hooks/commit-msg +0 -13
- data/support/hooks/post-commit +0 -4
- data/support/hooks/pre-commit +0 -4
- data/support/hooks/pre-rebase +0 -169
- data/support/hooks/prepare-commit-msg +0 -36
- data/tasks/benchmark.thor +0 -15
- data/tasks/hooks.thor +0 -26
- data/tasks/package.thor +0 -31
- data/tasks/prerelease.thor +0 -34
- data/tasks/release.thor +0 -85
- data/tasks/repair.thor +0 -64
- data/tasks/spec.thor +0 -41
- data/tasks/stats.thor +0 -82
- data/tasks/system.thor +0 -158
- data/tasks/yardoc.thor +0 -16
- data/vendor/abstract/ChangeLog +0 -3
- data/vendor/abstract/README.txt +0 -57
- data/vendor/abstract/abstract.gemspec +0 -48
- data/vendor/abstract/doc/classes/Kernel.html +0 -134
- data/vendor/abstract/doc/classes/Kernel.src/M000002.html +0 -24
- data/vendor/abstract/doc/classes/Module.html +0 -140
- data/vendor/abstract/doc/classes/Module.src/M000001.html +0 -20
- data/vendor/abstract/doc/created.rid +0 -1
- data/vendor/abstract/doc/files/README_txt.html +0 -173
- data/vendor/abstract/doc/files/lib/abstract_rb.html +0 -137
- data/vendor/abstract/doc/fr_class_index.html +0 -28
- data/vendor/abstract/doc/fr_file_index.html +0 -28
- data/vendor/abstract/doc/fr_method_index.html +0 -28
- data/vendor/abstract/doc/index.html +0 -24
- data/vendor/abstract/doc/rdoc-style.css +0 -208
- data/vendor/abstract/lib/abstract.rb +0 -75
- data/vendor/abstract/setup.rb +0 -1331
- data/vendor/abstract/test/test.rb +0 -91
- data/vendor/cli/CHANGELOG +0 -2
- data/vendor/cli/LICENSE +0 -20
- data/vendor/cli/README.textile +0 -0
- data/vendor/cli/Rakefile +0 -61
- data/vendor/cli/cli.gemspec +0 -42
- data/vendor/cli/deps.rip +0 -5
- data/vendor/cli/lib/cli.rb +0 -33
- data/vendor/cli/script/spec +0 -12
- data/vendor/cli/spec/cli_spec.rb +0 -56
- data/vendor/cli/spec/spec_helper.rb +0 -18
- data/vendor/erubis/CHANGES.txt +0 -717
- data/vendor/erubis/MIT-LICENSE +0 -20
- data/vendor/erubis/README.txt +0 -102
- data/vendor/erubis/benchmark/Makefile +0 -6
- data/vendor/erubis/benchmark/bench.rb +0 -314
- data/vendor/erubis/benchmark/bench_context.yaml +0 -141
- data/vendor/erubis/benchmark/templates/_footer.html +0 -4
- data/vendor/erubis/benchmark/templates/_header.html +0 -52
- data/vendor/erubis/benchmark/templates/bench_erb.rhtml +0 -29
- data/vendor/erubis/benchmark/templates/bench_erubis.rhtml +0 -29
- data/vendor/erubis/benchmark/templates/bench_eruby.rhtml +0 -29
- data/vendor/erubis/bin/erubis +0 -11
- data/vendor/erubis/contrib/erubis +0 -11
- data/vendor/erubis/contrib/erubis-run.rb +0 -132
- data/vendor/erubis/contrib/inline-require +0 -153
- data/vendor/erubis/doc-api/classes/ActionView.html +0 -105
- data/vendor/erubis/doc-api/classes/ActionView/TemplateHandlers/ErubisHandler.html +0 -181
- data/vendor/erubis/doc-api/classes/ERB.html +0 -101
- data/vendor/erubis/doc-api/classes/Erubis.html +0 -353
- data/vendor/erubis/doc-api/classes/Erubis/ArrayBufferEnhancer.html +0 -175
- data/vendor/erubis/doc-api/classes/Erubis/ArrayBufferEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/ArrayEnhancer.html +0 -174
- data/vendor/erubis/doc-api/classes/Erubis/ArrayEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/Basic.html +0 -112
- data/vendor/erubis/doc-api/classes/Erubis/Basic/Converter.html +0 -327
- data/vendor/erubis/doc-api/classes/Erubis/Basic/Engine.html +0 -130
- data/vendor/erubis/doc-api/classes/Erubis/BiPatternEnhancer.html +0 -215
- data/vendor/erubis/doc-api/classes/Erubis/BiPatternEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/CGenerator.html +0 -386
- data/vendor/erubis/doc-api/classes/Erubis/CommandOptionError.html +0 -113
- data/vendor/erubis/doc-api/classes/Erubis/Context.html +0 -344
- data/vendor/erubis/doc-api/classes/Erubis/Converter.html +0 -283
- data/vendor/erubis/doc-api/classes/Erubis/DeleteIndentEnhancer.html +0 -150
- data/vendor/erubis/doc-api/classes/Erubis/DeleteIndentEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/Ec.html +0 -126
- data/vendor/erubis/doc-api/classes/Erubis/Ejava.html +0 -126
- data/vendor/erubis/doc-api/classes/Erubis/Ejavascript.html +0 -126
- data/vendor/erubis/doc-api/classes/Erubis/Engine.html +0 -305
- data/vendor/erubis/doc-api/classes/Erubis/Eperl.html +0 -126
- data/vendor/erubis/doc-api/classes/Erubis/Ephp.html +0 -126
- data/vendor/erubis/doc-api/classes/Erubis/ErboutEnhancer.html +0 -175
- data/vendor/erubis/doc-api/classes/Erubis/ErboutEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/ErubisError.html +0 -117
- data/vendor/erubis/doc-api/classes/Erubis/Eruby.html +0 -132
- data/vendor/erubis/doc-api/classes/Erubis/EscapeEnhancer.html +0 -165
- data/vendor/erubis/doc-api/classes/Erubis/EscapedEc.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/EscapedEjava.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/EscapedEjavascript.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/EscapedEperl.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/EscapedEphp.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/EscapedEruby.html +0 -127
- data/vendor/erubis/doc-api/classes/Erubis/EscapedEscheme.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/Escheme.html +0 -126
- data/vendor/erubis/doc-api/classes/Erubis/Evaluator.html +0 -212
- data/vendor/erubis/doc-api/classes/Erubis/FastEruby.html +0 -131
- data/vendor/erubis/doc-api/classes/Erubis/Generator.html +0 -416
- data/vendor/erubis/doc-api/classes/Erubis/HeaderFooterEnhancer.html +0 -267
- data/vendor/erubis/doc-api/classes/Erubis/HeaderFooterEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/Helpers.html +0 -116
- data/vendor/erubis/doc-api/classes/Erubis/Helpers/RailsFormHelper.html +0 -787
- data/vendor/erubis/doc-api/classes/Erubis/Helpers/RailsHelper.html +0 -349
- data/vendor/erubis/doc-api/classes/Erubis/Helpers/RailsHelper/TemplateConverter.html +0 -164
- data/vendor/erubis/doc-api/classes/Erubis/InterpolationEnhancer.html +0 -306
- data/vendor/erubis/doc-api/classes/Erubis/InterpolationEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/JavaGenerator.html +0 -359
- data/vendor/erubis/doc-api/classes/Erubis/JavascriptGenerator.html +0 -386
- data/vendor/erubis/doc-api/classes/Erubis/Main.html +0 -340
- data/vendor/erubis/doc-api/classes/Erubis/NoCodeEnhancer.html +0 -249
- data/vendor/erubis/doc-api/classes/Erubis/NoCodeEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/NoTextEnhancer.html +0 -159
- data/vendor/erubis/doc-api/classes/Erubis/NoTextEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/NotSupportedError.html +0 -119
- data/vendor/erubis/doc-api/classes/Erubis/OptimizedEruby.html +0 -163
- data/vendor/erubis/doc-api/classes/Erubis/OptimizedGenerator.html +0 -439
- data/vendor/erubis/doc-api/classes/Erubis/OptimizedXmlEruby.html +0 -163
- data/vendor/erubis/doc-api/classes/Erubis/PI.html +0 -124
- data/vendor/erubis/doc-api/classes/Erubis/PI/Converter.html +0 -266
- data/vendor/erubis/doc-api/classes/Erubis/PI/Ec.html +0 -166
- data/vendor/erubis/doc-api/classes/Erubis/PI/Ejava.html +0 -166
- data/vendor/erubis/doc-api/classes/Erubis/PI/Ejavascript.html +0 -166
- data/vendor/erubis/doc-api/classes/Erubis/PI/Engine.html +0 -122
- data/vendor/erubis/doc-api/classes/Erubis/PI/Eperl.html +0 -166
- data/vendor/erubis/doc-api/classes/Erubis/PI/Ephp.html +0 -166
- data/vendor/erubis/doc-api/classes/Erubis/PI/Eruby.html +0 -155
- data/vendor/erubis/doc-api/classes/Erubis/PI/Escheme.html +0 -166
- data/vendor/erubis/doc-api/classes/Erubis/PI/TinyEruby.html +0 -293
- data/vendor/erubis/doc-api/classes/Erubis/PercentLineEnhancer.html +0 -179
- data/vendor/erubis/doc-api/classes/Erubis/PercentLineEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/PerlGenerator.html +0 -344
- data/vendor/erubis/doc-api/classes/Erubis/PhpGenerator.html +0 -350
- data/vendor/erubis/doc-api/classes/Erubis/PreprocessingEruby.html +0 -183
- data/vendor/erubis/doc-api/classes/Erubis/PreprocessingHelper.html +0 -212
- data/vendor/erubis/doc-api/classes/Erubis/PrintEnabledEnhancer.html +0 -212
- data/vendor/erubis/doc-api/classes/Erubis/PrintEnabledEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/PrintOutEnhancer.html +0 -244
- data/vendor/erubis/doc-api/classes/Erubis/PrintOutEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/PrintOutSimplifiedEruby.html +0 -121
- data/vendor/erubis/doc-api/classes/Erubis/RubyEvaluator.html +0 -227
- data/vendor/erubis/doc-api/classes/Erubis/RubyGenerator.html +0 -327
- data/vendor/erubis/doc-api/classes/Erubis/SchemeGenerator.html +0 -382
- data/vendor/erubis/doc-api/classes/Erubis/SimplifiedEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/SimplifyEnhancer.html +0 -191
- data/vendor/erubis/doc-api/classes/Erubis/StdoutEnhancer.html +0 -173
- data/vendor/erubis/doc-api/classes/Erubis/StdoutEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/StdoutSimplifiedEruby.html +0 -121
- data/vendor/erubis/doc-api/classes/Erubis/StringBufferEnhancer.html +0 -174
- data/vendor/erubis/doc-api/classes/Erubis/StringBufferEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/StringIOEruby.html +0 -120
- data/vendor/erubis/doc-api/classes/Erubis/TinyEruby.html +0 -299
- data/vendor/erubis/doc-api/classes/Erubis/XmlEruby.html +0 -130
- data/vendor/erubis/doc-api/classes/Erubis/XmlHelper.html +0 -255
- data/vendor/erubis/doc-api/created.rid +0 -1
- data/vendor/erubis/doc-api/files/README_txt.html +0 -247
- data/vendor/erubis/doc-api/files/erubis/context_rb.html +0 -107
- data/vendor/erubis/doc-api/files/erubis/converter_rb.html +0 -114
- data/vendor/erubis/doc-api/files/erubis/engine/ec_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/engine/ejava_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/engine/ejavascript_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/engine/enhanced_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/engine/eperl_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/engine/ephp_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/engine/eruby_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/engine/escheme_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/engine/optimized_rb.html +0 -114
- data/vendor/erubis/doc-api/files/erubis/engine_rb.html +0 -117
- data/vendor/erubis/doc-api/files/erubis/enhancer_rb.html +0 -107
- data/vendor/erubis/doc-api/files/erubis/error_rb.html +0 -107
- data/vendor/erubis/doc-api/files/erubis/evaluator_rb.html +0 -115
- data/vendor/erubis/doc-api/files/erubis/generator_rb.html +0 -114
- data/vendor/erubis/doc-api/files/erubis/helper_rb.html +0 -107
- data/vendor/erubis/doc-api/files/erubis/helpers/rails_form_helper_rb.html +0 -107
- data/vendor/erubis/doc-api/files/erubis/helpers/rails_helper_rb.html +0 -116
- data/vendor/erubis/doc-api/files/erubis/local-setting_rb.html +0 -107
- data/vendor/erubis/doc-api/files/erubis/main_rb.html +0 -127
- data/vendor/erubis/doc-api/files/erubis/preprocessing_rb.html +0 -114
- data/vendor/erubis/doc-api/files/erubis/tiny_rb.html +0 -107
- data/vendor/erubis/doc-api/files/erubis_rb.html +0 -118
- data/vendor/erubis/doc-api/fr_class_index.html +0 -122
- data/vendor/erubis/doc-api/fr_file_index.html +0 -51
- data/vendor/erubis/doc-api/fr_method_index.html +0 -248
- data/vendor/erubis/doc-api/index.html +0 -24
- data/vendor/erubis/doc-api/rdoc-style.css +0 -208
- data/vendor/erubis/doc/docstyle.css +0 -188
- data/vendor/erubis/doc/users-guide.html +0 -3285
- data/vendor/erubis/erubis.gemspec +0 -66
- data/vendor/erubis/examples/basic/Makefile +0 -53
- data/vendor/erubis/examples/basic/example.ec +0 -42
- data/vendor/erubis/examples/basic/example.ejava +0 -45
- data/vendor/erubis/examples/basic/example.ejs +0 -16
- data/vendor/erubis/examples/basic/example.eperl +0 -16
- data/vendor/erubis/examples/basic/example.ephp +0 -17
- data/vendor/erubis/examples/basic/example.eruby +0 -15
- data/vendor/erubis/examples/basic/example.escheme +0 -26
- data/vendor/erubis/examples/pi/Makefile +0 -54
- data/vendor/erubis/examples/pi/example.ec +0 -42
- data/vendor/erubis/examples/pi/example.ejava +0 -45
- data/vendor/erubis/examples/pi/example.ejs +0 -16
- data/vendor/erubis/examples/pi/example.eperl +0 -16
- data/vendor/erubis/examples/pi/example.ephp +0 -17
- data/vendor/erubis/examples/pi/example.eruby +0 -15
- data/vendor/erubis/examples/pi/example.escheme +0 -26
- data/vendor/erubis/lib/erubis.rb +0 -73
- data/vendor/erubis/lib/erubis/context.rb +0 -84
- data/vendor/erubis/lib/erubis/converter.rb +0 -358
- data/vendor/erubis/lib/erubis/engine.rb +0 -121
- data/vendor/erubis/lib/erubis/engine/ec.rb +0 -118
- data/vendor/erubis/lib/erubis/engine/ejava.rb +0 -111
- data/vendor/erubis/lib/erubis/engine/ejavascript.rb +0 -120
- data/vendor/erubis/lib/erubis/engine/enhanced.rb +0 -122
- data/vendor/erubis/lib/erubis/engine/eperl.rb +0 -96
- data/vendor/erubis/lib/erubis/engine/ephp.rb +0 -100
- data/vendor/erubis/lib/erubis/engine/eruby.rb +0 -125
- data/vendor/erubis/lib/erubis/engine/escheme.rb +0 -115
- data/vendor/erubis/lib/erubis/engine/optimized.rb +0 -128
- data/vendor/erubis/lib/erubis/enhancer.rb +0 -681
- data/vendor/erubis/lib/erubis/error.rb +0 -24
- data/vendor/erubis/lib/erubis/evaluator.rb +0 -89
- data/vendor/erubis/lib/erubis/generator.rb +0 -86
- data/vendor/erubis/lib/erubis/helper.rb +0 -48
- data/vendor/erubis/lib/erubis/helpers/rails_form_helper.rb +0 -198
- data/vendor/erubis/lib/erubis/helpers/rails_helper.rb +0 -325
- data/vendor/erubis/lib/erubis/local-setting.rb +0 -10
- data/vendor/erubis/lib/erubis/main.rb +0 -491
- data/vendor/erubis/lib/erubis/preprocessing.rb +0 -59
- data/vendor/erubis/lib/erubis/tiny.rb +0 -146
- data/vendor/erubis/setup.rb +0 -1331
- data/vendor/erubis/test/assert-text-equal.rb +0 -45
- data/vendor/erubis/test/assert-text-equal.rbc +0 -0
- data/vendor/erubis/test/data/users-guide/Example.ejava +0 -55
- data/vendor/erubis/test/data/users-guide/array_example.result +0 -9
- data/vendor/erubis/test/data/users-guide/arraybuffer_example.result +0 -9
- data/vendor/erubis/test/data/users-guide/bipattern-example.rhtml +0 -4
- data/vendor/erubis/test/data/users-guide/bipattern_example.result +0 -6
- data/vendor/erubis/test/data/users-guide/context.rb +0 -6
- data/vendor/erubis/test/data/users-guide/context.yaml +0 -8
- data/vendor/erubis/test/data/users-guide/def_method.rb +0 -14
- data/vendor/erubis/test/data/users-guide/def_method.result +0 -3
- data/vendor/erubis/test/data/users-guide/escape_example.result +0 -9
- data/vendor/erubis/test/data/users-guide/example.ec +0 -27
- data/vendor/erubis/test/data/users-guide/example.ejs +0 -20
- data/vendor/erubis/test/data/users-guide/example.eperl +0 -18
- data/vendor/erubis/test/data/users-guide/example.ephp +0 -18
- data/vendor/erubis/test/data/users-guide/example.eruby +0 -6
- data/vendor/erubis/test/data/users-guide/example.escheme +0 -28
- data/vendor/erubis/test/data/users-guide/example1.eruby +0 -6
- data/vendor/erubis/test/data/users-guide/example1.rb +0 -17
- data/vendor/erubis/test/data/users-guide/example1.result +0 -16
- data/vendor/erubis/test/data/users-guide/example10.rb +0 -4
- data/vendor/erubis/test/data/users-guide/example10.result +0 -17
- data/vendor/erubis/test/data/users-guide/example10.xhtml +0 -14
- data/vendor/erubis/test/data/users-guide/example10_x.result +0 -17
- data/vendor/erubis/test/data/users-guide/example11.php +0 -20
- data/vendor/erubis/test/data/users-guide/example11.result +0 -23
- data/vendor/erubis/test/data/users-guide/example11.rhtml +0 -21
- data/vendor/erubis/test/data/users-guide/example11_C.result +0 -10
- data/vendor/erubis/test/data/users-guide/example11_N.result +0 -16
- data/vendor/erubis/test/data/users-guide/example11_U.result +0 -16
- data/vendor/erubis/test/data/users-guide/example11_php.result +0 -15
- data/vendor/erubis/test/data/users-guide/example1_x.result +0 -9
- data/vendor/erubis/test/data/users-guide/example2.eruby +0 -7
- data/vendor/erubis/test/data/users-guide/example2.rb +0 -10
- data/vendor/erubis/test/data/users-guide/example2.result +0 -27
- data/vendor/erubis/test/data/users-guide/example2_trim.result +0 -10
- data/vendor/erubis/test/data/users-guide/example2_x.result +0 -10
- data/vendor/erubis/test/data/users-guide/example3.eruby +0 -6
- data/vendor/erubis/test/data/users-guide/example3.rb +0 -10
- data/vendor/erubis/test/data/users-guide/example31.result +0 -22
- data/vendor/erubis/test/data/users-guide/example32.result +0 -4
- data/vendor/erubis/test/data/users-guide/example3_e.result +0 -8
- data/vendor/erubis/test/data/users-guide/example4.eruby +0 -3
- data/vendor/erubis/test/data/users-guide/example4.rb +0 -11
- data/vendor/erubis/test/data/users-guide/example4.result +0 -10
- data/vendor/erubis/test/data/users-guide/example4_x.result +0 -5
- data/vendor/erubis/test/data/users-guide/example5.eruby +0 -6
- data/vendor/erubis/test/data/users-guide/example5.rb +0 -16
- data/vendor/erubis/test/data/users-guide/example5.result +0 -7
- data/vendor/erubis/test/data/users-guide/example6.rb +0 -12
- data/vendor/erubis/test/data/users-guide/example6.result +0 -7
- data/vendor/erubis/test/data/users-guide/example7.eruby +0 -8
- data/vendor/erubis/test/data/users-guide/example71.result +0 -13
- data/vendor/erubis/test/data/users-guide/example72.result +0 -13
- data/vendor/erubis/test/data/users-guide/example8.eruby +0 -6
- data/vendor/erubis/test/data/users-guide/example8_ruby.result +0 -7
- data/vendor/erubis/test/data/users-guide/example8_yaml.result +0 -7
- data/vendor/erubis/test/data/users-guide/example9.eruby +0 -3
- data/vendor/erubis/test/data/users-guide/example9.rb +0 -8
- data/vendor/erubis/test/data/users-guide/example9.result +0 -9
- data/vendor/erubis/test/data/users-guide/example91.result +0 -5
- data/vendor/erubis/test/data/users-guide/example92.result +0 -4
- data/vendor/erubis/test/data/users-guide/example_c.result +0 -29
- data/vendor/erubis/test/data/users-guide/example_java.result +0 -56
- data/vendor/erubis/test/data/users-guide/example_js.result +0 -22
- data/vendor/erubis/test/data/users-guide/example_perl.result +0 -20
- data/vendor/erubis/test/data/users-guide/example_php.result +0 -19
- data/vendor/erubis/test/data/users-guide/example_scheme.result +0 -30
- data/vendor/erubis/test/data/users-guide/example_scheme_display.result +0 -29
- data/vendor/erubis/test/data/users-guide/fasteruby.rb +0 -11
- data/vendor/erubis/test/data/users-guide/fasteruby.result +0 -38
- data/vendor/erubis/test/data/users-guide/fasteruby.rhtml +0 -15
- data/vendor/erubis/test/data/users-guide/headerfooter-example.eruby +0 -9
- data/vendor/erubis/test/data/users-guide/headerfooter-example2.rb +0 -8
- data/vendor/erubis/test/data/users-guide/headerfooter-example2.rhtml +0 -10
- data/vendor/erubis/test/data/users-guide/headerfooter_example.result +0 -11
- data/vendor/erubis/test/data/users-guide/headerfooter_example2.result +0 -13
- data/vendor/erubis/test/data/users-guide/interpolation_example.result +0 -9
- data/vendor/erubis/test/data/users-guide/main_program1.rb +0 -8
- data/vendor/erubis/test/data/users-guide/main_program1.result +0 -6
- data/vendor/erubis/test/data/users-guide/main_program2.rb +0 -8
- data/vendor/erubis/test/data/users-guide/main_program2.result +0 -6
- data/vendor/erubis/test/data/users-guide/nocode-example.eruby +0 -14
- data/vendor/erubis/test/data/users-guide/nocode-php.result +0 -20
- data/vendor/erubis/test/data/users-guide/nocode_example.result +0 -15
- data/vendor/erubis/test/data/users-guide/normal-eruby-test.eruby +0 -9
- data/vendor/erubis/test/data/users-guide/normal_eruby_test.result +0 -11
- data/vendor/erubis/test/data/users-guide/notext-example.eruby +0 -14
- data/vendor/erubis/test/data/users-guide/notext-example.php +0 -19
- data/vendor/erubis/test/data/users-guide/notext-php.result +0 -20
- data/vendor/erubis/test/data/users-guide/notext_example.result +0 -16
- data/vendor/erubis/test/data/users-guide/percentline-example.rhtml +0 -4
- data/vendor/erubis/test/data/users-guide/percentline_example.result +0 -7
- data/vendor/erubis/test/data/users-guide/printenable_example.result +0 -4
- data/vendor/erubis/test/data/users-guide/printenabled-example.eruby +0 -3
- data/vendor/erubis/test/data/users-guide/printenabled-example.rb +0 -8
- data/vendor/erubis/test/data/users-guide/printstatement_example.result +0 -8
- data/vendor/erubis/test/data/users-guide/simplify_example.result +0 -9
- data/vendor/erubis/test/data/users-guide/stdout_exmple.result +0 -9
- data/vendor/erubis/test/data/users-guide/stringbuffer_example.result +0 -9
- data/vendor/erubis/test/data/users-guide/tail_260.result +0 -4
- data/vendor/erubis/test/data/users-guide/tailnewline.rhtml +0 -3
- data/vendor/erubis/test/data/users-guide/template1.rhtml +0 -4
- data/vendor/erubis/test/data/users-guide/template2.rhtml +0 -4
- data/vendor/erubis/test/hoge.rb +0 -5
- data/vendor/erubis/test/test-engines.rb +0 -370
- data/vendor/erubis/test/test-engines.rbc +0 -0
- data/vendor/erubis/test/test-enhancers.rb +0 -571
- data/vendor/erubis/test/test-erubis.rb +0 -884
- data/vendor/erubis/test/test-erubis.rbc +0 -0
- data/vendor/erubis/test/test-main.rb +0 -674
- data/vendor/erubis/test/test-users-guide.rb +0 -58
- data/vendor/erubis/test/test-users-guide.rbc +0 -0
- data/vendor/erubis/test/test.rb +0 -30
- data/vendor/erubis/test/test.rbc +0 -0
- data/vendor/erubis/test/testutil.rb +0 -101
- data/vendor/erubis/test/testutil.rbc +0 -0
- data/vendor/extlib/History.txt +0 -77
- data/vendor/extlib/LICENSE +0 -47
- data/vendor/extlib/README +0 -0
- data/vendor/extlib/Rakefile +0 -133
- data/vendor/extlib/benchmarks/camel_case.rb +0 -45
- data/vendor/extlib/benchmarks/to_const_path.rb +0 -65
- data/vendor/extlib/benchmarks/to_const_string.rb +0 -91
- data/vendor/extlib/lib/extlib.rb +0 -50
- data/vendor/extlib/lib/extlib/array.rb +0 -36
- data/vendor/extlib/lib/extlib/assertions.rb +0 -8
- data/vendor/extlib/lib/extlib/blank.rb +0 -89
- data/vendor/extlib/lib/extlib/boolean.rb +0 -11
- data/vendor/extlib/lib/extlib/byte_array.rb +0 -6
- data/vendor/extlib/lib/extlib/class.rb +0 -177
- data/vendor/extlib/lib/extlib/datetime.rb +0 -29
- data/vendor/extlib/lib/extlib/dictionary.rb +0 -433
- data/vendor/extlib/lib/extlib/hash.rb +0 -442
- data/vendor/extlib/lib/extlib/hook.rb +0 -401
- data/vendor/extlib/lib/extlib/inflection.rb +0 -440
- data/vendor/extlib/lib/extlib/lazy_array.rb +0 -451
- data/vendor/extlib/lib/extlib/lazy_module.rb +0 -18
- data/vendor/extlib/lib/extlib/logger.rb +0 -198
- data/vendor/extlib/lib/extlib/mash.rb +0 -155
- data/vendor/extlib/lib/extlib/module.rb +0 -47
- data/vendor/extlib/lib/extlib/nil.rb +0 -5
- data/vendor/extlib/lib/extlib/numeric.rb +0 -5
- data/vendor/extlib/lib/extlib/object.rb +0 -175
- data/vendor/extlib/lib/extlib/object_space.rb +0 -13
- data/vendor/extlib/lib/extlib/pathname.rb +0 -20
- data/vendor/extlib/lib/extlib/pooling.rb +0 -235
- data/vendor/extlib/lib/extlib/rubygems.rb +0 -38
- data/vendor/extlib/lib/extlib/simple_set.rb +0 -66
- data/vendor/extlib/lib/extlib/string.rb +0 -176
- data/vendor/extlib/lib/extlib/struct.rb +0 -17
- data/vendor/extlib/lib/extlib/symbol.rb +0 -21
- data/vendor/extlib/lib/extlib/tasks/release.rb +0 -15
- data/vendor/extlib/lib/extlib/time.rb +0 -43
- data/vendor/extlib/lib/extlib/version.rb +0 -3
- data/vendor/extlib/lib/extlib/virtual_file.rb +0 -10
- data/vendor/extlib/spec/array_spec.rb +0 -39
- data/vendor/extlib/spec/blank_spec.rb +0 -85
- data/vendor/extlib/spec/byte_array_spec.rb +0 -7
- data/vendor/extlib/spec/class_spec.rb +0 -157
- data/vendor/extlib/spec/datetime_spec.rb +0 -22
- data/vendor/extlib/spec/hash_spec.rb +0 -537
- data/vendor/extlib/spec/hook_spec.rb +0 -1234
- data/vendor/extlib/spec/inflection/plural_spec.rb +0 -564
- data/vendor/extlib/spec/inflection/singular_spec.rb +0 -497
- data/vendor/extlib/spec/inflection_extras_spec.rb +0 -110
- data/vendor/extlib/spec/lazy_array_spec.rb +0 -1957
- data/vendor/extlib/spec/lazy_module_spec.rb +0 -38
- data/vendor/extlib/spec/mash_spec.rb +0 -311
- data/vendor/extlib/spec/module_spec.rb +0 -70
- data/vendor/extlib/spec/object_space_spec.rb +0 -9
- data/vendor/extlib/spec/object_spec.rb +0 -114
- data/vendor/extlib/spec/pooling_spec.rb +0 -511
- data/vendor/extlib/spec/simple_set_spec.rb +0 -57
- data/vendor/extlib/spec/spec.opts +0 -3
- data/vendor/extlib/spec/spec_helper.rb +0 -10
- data/vendor/extlib/spec/string_spec.rb +0 -221
- data/vendor/extlib/spec/struct_spec.rb +0 -12
- data/vendor/extlib/spec/symbol_spec.rb +0 -8
- data/vendor/extlib/spec/time_spec.rb +0 -29
- data/vendor/extlib/spec/try_call_spec.rb +0 -73
- data/vendor/extlib/spec/try_dup_spec.rb +0 -45
- data/vendor/extlib/spec/virtual_file_spec.rb +0 -21
- data/vendor/media-path/CHANGELOG +0 -3
- data/vendor/media-path/LICENSE +0 -20
- data/vendor/media-path/README.textile +0 -40
- data/vendor/media-path/Rakefile +0 -61
- data/vendor/media-path/TODO.txt +0 -6
- data/vendor/media-path/deps.rip +0 -5
- data/vendor/media-path/lib/media-path.rb +0 -269
- data/vendor/media-path/media-path.gemspec +0 -38
- data/vendor/media-path/script/spec +0 -14
- data/vendor/media-path/spec/media-path_spec.rb +0 -158
- data/vendor/media-path/spec/stubs/blog/public/js/moo.js +0 -0
- data/vendor/rack/COPYING +0 -18
- data/vendor/rack/KNOWN-ISSUES +0 -18
- data/vendor/rack/README +0 -364
- data/vendor/rack/Rakefile +0 -164
- data/vendor/rack/bin/rackup +0 -2
- data/vendor/rack/contrib/rack_logo.svg +0 -111
- data/vendor/rack/example/lobster.ru +0 -4
- data/vendor/rack/example/protectedlobster.rb +0 -14
- data/vendor/rack/example/protectedlobster.ru +0 -8
- data/vendor/rack/lib/rack.rb +0 -87
- data/vendor/rack/lib/rack/adapter/camping.rb +0 -22
- data/vendor/rack/lib/rack/auth/abstract/handler.rb +0 -37
- data/vendor/rack/lib/rack/auth/abstract/request.rb +0 -37
- data/vendor/rack/lib/rack/auth/basic.rb +0 -58
- data/vendor/rack/lib/rack/auth/digest/md5.rb +0 -124
- data/vendor/rack/lib/rack/auth/digest/nonce.rb +0 -51
- data/vendor/rack/lib/rack/auth/digest/params.rb +0 -55
- data/vendor/rack/lib/rack/auth/digest/request.rb +0 -40
- data/vendor/rack/lib/rack/auth/openid.rb +0 -487
- data/vendor/rack/lib/rack/builder.rb +0 -78
- data/vendor/rack/lib/rack/cascade.rb +0 -41
- data/vendor/rack/lib/rack/chunked.rb +0 -49
- data/vendor/rack/lib/rack/commonlogger.rb +0 -52
- data/vendor/rack/lib/rack/conditionalget.rb +0 -47
- data/vendor/rack/lib/rack/content_length.rb +0 -29
- data/vendor/rack/lib/rack/content_type.rb +0 -23
- data/vendor/rack/lib/rack/deflater.rb +0 -96
- data/vendor/rack/lib/rack/directory.rb +0 -153
- data/vendor/rack/lib/rack/file.rb +0 -88
- data/vendor/rack/lib/rack/handler.rb +0 -88
- data/vendor/rack/lib/rack/handler/cgi.rb +0 -61
- data/vendor/rack/lib/rack/handler/evented_mongrel.rb +0 -8
- data/vendor/rack/lib/rack/handler/fastcgi.rb +0 -90
- data/vendor/rack/lib/rack/handler/lsws.rb +0 -63
- data/vendor/rack/lib/rack/handler/mongrel.rb +0 -91
- data/vendor/rack/lib/rack/handler/scgi.rb +0 -62
- data/vendor/rack/lib/rack/handler/swiftiplied_mongrel.rb +0 -8
- data/vendor/rack/lib/rack/handler/thin.rb +0 -18
- data/vendor/rack/lib/rack/handler/webrick.rb +0 -71
- data/vendor/rack/lib/rack/head.rb +0 -19
- data/vendor/rack/lib/rack/lint.rb +0 -546
- data/vendor/rack/lib/rack/lobster.rb +0 -65
- data/vendor/rack/lib/rack/lock.rb +0 -16
- data/vendor/rack/lib/rack/methodoverride.rb +0 -27
- data/vendor/rack/lib/rack/mime.rb +0 -205
- data/vendor/rack/lib/rack/mock.rb +0 -189
- data/vendor/rack/lib/rack/recursive.rb +0 -57
- data/vendor/rack/lib/rack/reloader.rb +0 -109
- data/vendor/rack/lib/rack/request.rb +0 -248
- data/vendor/rack/lib/rack/response.rb +0 -149
- data/vendor/rack/lib/rack/rewindable_input.rb +0 -100
- data/vendor/rack/lib/rack/server.rb +0 -189
- data/vendor/rack/lib/rack/session/abstract/id.rb +0 -140
- data/vendor/rack/lib/rack/session/cookie.rb +0 -90
- data/vendor/rack/lib/rack/session/memcache.rb +0 -109
- data/vendor/rack/lib/rack/session/pool.rb +0 -100
- data/vendor/rack/lib/rack/showexceptions.rb +0 -349
- data/vendor/rack/lib/rack/showstatus.rb +0 -106
- data/vendor/rack/lib/rack/static.rb +0 -38
- data/vendor/rack/lib/rack/urlmap.rb +0 -55
- data/vendor/rack/lib/rack/utils.rb +0 -590
- data/vendor/rack/test/cgi/lighttpd.conf +0 -20
- data/vendor/rack/test/cgi/test +0 -9
- data/vendor/rack/test/cgi/test.fcgi +0 -8
- data/vendor/rack/test/cgi/test.ru +0 -6
- data/vendor/rack/test/multipart/binary +0 -0
- data/vendor/rack/test/multipart/empty +0 -10
- data/vendor/rack/test/multipart/file1.txt +0 -1
- data/vendor/rack/test/multipart/ie +0 -6
- data/vendor/rack/test/multipart/nested +0 -10
- data/vendor/rack/test/multipart/none +0 -9
- data/vendor/rack/test/multipart/semicolon +0 -6
- data/vendor/rack/test/multipart/text +0 -10
- data/vendor/rack/test/rackup/config.ru +0 -31
- data/vendor/rack/test/spec_rack_auth_basic.rb +0 -73
- data/vendor/rack/test/spec_rack_auth_digest.rb +0 -226
- data/vendor/rack/test/spec_rack_auth_openid.rb +0 -84
- data/vendor/rack/test/spec_rack_builder.rb +0 -84
- data/vendor/rack/test/spec_rack_camping.rb +0 -51
- data/vendor/rack/test/spec_rack_cascade.rb +0 -48
- data/vendor/rack/test/spec_rack_cgi.rb +0 -89
- data/vendor/rack/test/spec_rack_chunked.rb +0 -62
- data/vendor/rack/test/spec_rack_commonlogger.rb +0 -61
- data/vendor/rack/test/spec_rack_conditionalget.rb +0 -41
- data/vendor/rack/test/spec_rack_content_length.rb +0 -43
- data/vendor/rack/test/spec_rack_content_type.rb +0 -30
- data/vendor/rack/test/spec_rack_deflater.rb +0 -127
- data/vendor/rack/test/spec_rack_directory.rb +0 -61
- data/vendor/rack/test/spec_rack_fastcgi.rb +0 -89
- data/vendor/rack/test/spec_rack_file.rb +0 -75
- data/vendor/rack/test/spec_rack_handler.rb +0 -43
- data/vendor/rack/test/spec_rack_head.rb +0 -30
- data/vendor/rack/test/spec_rack_lint.rb +0 -523
- data/vendor/rack/test/spec_rack_lobster.rb +0 -45
- data/vendor/rack/test/spec_rack_lock.rb +0 -38
- data/vendor/rack/test/spec_rack_methodoverride.rb +0 -60
- data/vendor/rack/test/spec_rack_mock.rb +0 -243
- data/vendor/rack/test/spec_rack_mongrel.rb +0 -189
- data/vendor/rack/test/spec_rack_recursive.rb +0 -77
- data/vendor/rack/test/spec_rack_request.rb +0 -510
- data/vendor/rack/test/spec_rack_response.rb +0 -218
- data/vendor/rack/test/spec_rack_rewindable_input.rb +0 -118
- data/vendor/rack/test/spec_rack_session_cookie.rb +0 -82
- data/vendor/rack/test/spec_rack_session_memcache.rb +0 -250
- data/vendor/rack/test/spec_rack_session_pool.rb +0 -172
- data/vendor/rack/test/spec_rack_showexceptions.rb +0 -21
- data/vendor/rack/test/spec_rack_showstatus.rb +0 -72
- data/vendor/rack/test/spec_rack_static.rb +0 -37
- data/vendor/rack/test/spec_rack_thin.rb +0 -91
- data/vendor/rack/test/spec_rack_urlmap.rb +0 -185
- data/vendor/rack/test/spec_rack_utils.rb +0 -488
- data/vendor/rack/test/spec_rack_webrick.rb +0 -130
- data/vendor/rack/test/spec_rackup.rb +0 -154
- data/vendor/rack/test/testrequest.rb +0 -72
- data/vendor/rack/test/unregistered_handler/rack/handler/unregistered.rb +0 -7
- data/vendor/rack/test/unregistered_handler/rack/handler/unregistered_long_one.rb +0 -7
- data/vendor/rspec/History.rdoc +0 -1510
- data/vendor/rspec/License.txt +0 -22
- data/vendor/rspec/Manifest.txt +0 -383
- data/vendor/rspec/README.rdoc +0 -55
- data/vendor/rspec/Rakefile +0 -145
- data/vendor/rspec/Ruby1.9.rdoc +0 -31
- data/vendor/rspec/TODO.txt +0 -17
- data/vendor/rspec/Upgrade.rdoc +0 -199
- data/vendor/rspec/bin/autospec +0 -4
- data/vendor/rspec/bin/spec +0 -5
- data/vendor/rspec/cucumber.yml +0 -5
- data/vendor/rspec/examples/failing/README.txt +0 -11
- data/vendor/rspec/examples/failing/diffing_spec.rb +0 -36
- data/vendor/rspec/examples/failing/failing_implicit_docstrings_example.rb +0 -17
- data/vendor/rspec/examples/failing/failure_in_after.rb +0 -10
- data/vendor/rspec/examples/failing/failure_in_before.rb +0 -10
- data/vendor/rspec/examples/failing/mocking_example.rb +0 -38
- data/vendor/rspec/examples/failing/mocking_with_flexmock.rb +0 -26
- data/vendor/rspec/examples/failing/mocking_with_mocha.rb +0 -25
- data/vendor/rspec/examples/failing/mocking_with_rr.rb +0 -27
- data/vendor/rspec/examples/failing/partial_mock_example.rb +0 -18
- data/vendor/rspec/examples/failing/pending_example.rb +0 -7
- data/vendor/rspec/examples/failing/predicate_example.rb +0 -32
- data/vendor/rspec/examples/failing/raising_example.rb +0 -47
- data/vendor/rspec/examples/failing/syntax_error_example.rb +0 -7
- data/vendor/rspec/examples/failing/team_spec.rb +0 -41
- data/vendor/rspec/examples/failing/timeout_behaviour.rb +0 -5
- data/vendor/rspec/examples/passing/custom_formatter.rb +0 -11
- data/vendor/rspec/examples/passing/custom_matchers.rb +0 -54
- data/vendor/rspec/examples/passing/dynamic_spec.rb +0 -7
- data/vendor/rspec/examples/passing/file_accessor.rb +0 -18
- data/vendor/rspec/examples/passing/file_accessor_spec.rb +0 -37
- data/vendor/rspec/examples/passing/filtered_formatter.rb +0 -17
- data/vendor/rspec/examples/passing/filtered_formatter_example.rb +0 -31
- data/vendor/rspec/examples/passing/greeter_spec.rb +0 -30
- data/vendor/rspec/examples/passing/helper_method_example.rb +0 -12
- data/vendor/rspec/examples/passing/implicit_docstrings_example.rb +0 -16
- data/vendor/rspec/examples/passing/io_processor.rb +0 -8
- data/vendor/rspec/examples/passing/io_processor_spec.rb +0 -20
- data/vendor/rspec/examples/passing/mocking_example.rb +0 -25
- data/vendor/rspec/examples/passing/multi_threaded_example_group_runner.rb +0 -26
- data/vendor/rspec/examples/passing/nested_classes_example.rb +0 -35
- data/vendor/rspec/examples/passing/options_example.rb +0 -29
- data/vendor/rspec/examples/passing/options_formatter.rb +0 -20
- data/vendor/rspec/examples/passing/partial_mock_example.rb +0 -27
- data/vendor/rspec/examples/passing/pending_example.rb +0 -18
- data/vendor/rspec/examples/passing/predicate_example.rb +0 -25
- data/vendor/rspec/examples/passing/shared_example_group_example.rb +0 -79
- data/vendor/rspec/examples/passing/shared_stack_examples.rb +0 -36
- data/vendor/rspec/examples/passing/simple_matcher_example.rb +0 -29
- data/vendor/rspec/examples/passing/stack.rb +0 -36
- data/vendor/rspec/examples/passing/stack_spec.rb +0 -63
- data/vendor/rspec/examples/passing/stack_spec_with_nested_example_groups.rb +0 -66
- data/vendor/rspec/examples/passing/stubbing_example.rb +0 -67
- data/vendor/rspec/examples/passing/yielding_example.rb +0 -31
- data/vendor/rspec/examples/ruby1.9.compatibility/access_to_constants_spec.rb +0 -85
- data/vendor/rspec/features-pending/cli/conditional_exclusion.feature +0 -39
- data/vendor/rspec/features-pending/heckle/heckle.feature +0 -56
- data/vendor/rspec/features/before_and_after_blocks/before_and_after_blocks.feature +0 -167
- data/vendor/rspec/features/command_line/line_number_option.feature +0 -56
- data/vendor/rspec/features/command_line/line_number_option_with_example_with_no_name.feature +0 -22
- data/vendor/rspec/features/example_groups/define_example_attribute.feature +0 -41
- data/vendor/rspec/features/example_groups/example_group_with_should_methods.feature +0 -29
- data/vendor/rspec/features/example_groups/implicit_docstrings.feature +0 -59
- data/vendor/rspec/features/example_groups/nested_groups.feature +0 -32
- data/vendor/rspec/features/expectations/customized_message.feature +0 -54
- data/vendor/rspec/features/expectations/expect_change.feature +0 -65
- data/vendor/rspec/features/expectations/expect_error.feature +0 -44
- data/vendor/rspec/features/extensions/custom_example_group.feature +0 -19
- data/vendor/rspec/features/formatters/custom_formatter.feature +0 -30
- data/vendor/rspec/features/interop/examples_and_tests_together.feature +0 -84
- data/vendor/rspec/features/interop/rspec_output.feature +0 -25
- data/vendor/rspec/features/interop/test_but_not_test_unit.feature +0 -26
- data/vendor/rspec/features/interop/test_case_with_should_methods.feature +0 -46
- data/vendor/rspec/features/load_paths/add_lib_to_load_path.feature +0 -20
- data/vendor/rspec/features/load_paths/add_spec_to_load_path.feature +0 -20
- data/vendor/rspec/features/matchers/define_diffable_matcher.feature +0 -26
- data/vendor/rspec/features/matchers/define_matcher.feature +0 -179
- data/vendor/rspec/features/matchers/define_matcher_outside_rspec.feature +0 -38
- data/vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature +0 -27
- data/vendor/rspec/features/matchers/define_wrapped_matcher.feature +0 -29
- data/vendor/rspec/features/matchers/match_unless_raises.feature +0 -60
- data/vendor/rspec/features/matchers/match_unless_raises_unexpected_error.feature +0 -39
- data/vendor/rspec/features/mock_framework_integration/use_flexmock.feature +0 -27
- data/vendor/rspec/features/mock_framework_integration/use_mocha.feature +0 -27
- data/vendor/rspec/features/mock_framework_integration/use_rr.feature +0 -27
- data/vendor/rspec/features/mocks/block_local_expectations.feature +0 -62
- data/vendor/rspec/features/mocks/mix_stubs_and_mocks.feature +0 -22
- data/vendor/rspec/features/mocks/stub_implementation.feature +0 -26
- data/vendor/rspec/features/pending/pending_examples.feature +0 -81
- data/vendor/rspec/features/runner/specify_line_number.feature +0 -32
- data/vendor/rspec/features/spec_helper/spec_helper.feature +0 -25
- data/vendor/rspec/features/step_definitions/running_rspec_steps.rb +0 -43
- data/vendor/rspec/features/subject/explicit_subject.feature +0 -31
- data/vendor/rspec/features/subject/implicit_subject.feature +0 -43
- data/vendor/rspec/features/support/env.rb +0 -82
- data/vendor/rspec/features/support/matchers/smart_match.rb +0 -12
- data/vendor/rspec/geminstaller.yml +0 -28
- data/vendor/rspec/init.rb +0 -9
- data/vendor/rspec/lib/autotest/discover.rb +0 -3
- data/vendor/rspec/lib/autotest/rspec.rb +0 -54
- data/vendor/rspec/lib/spec.rb +0 -8
- data/vendor/rspec/lib/spec/adapters/mock_frameworks/flexmock.rb +0 -24
- data/vendor/rspec/lib/spec/adapters/mock_frameworks/mocha.rb +0 -25
- data/vendor/rspec/lib/spec/adapters/mock_frameworks/rr.rb +0 -22
- data/vendor/rspec/lib/spec/adapters/mock_frameworks/rspec.rb +0 -21
- data/vendor/rspec/lib/spec/autorun.rb +0 -3
- data/vendor/rspec/lib/spec/deprecation.rb +0 -40
- data/vendor/rspec/lib/spec/dsl.rb +0 -1
- data/vendor/rspec/lib/spec/dsl/main.rb +0 -92
- data/vendor/rspec/lib/spec/example.rb +0 -164
- data/vendor/rspec/lib/spec/example/args_and_options.rb +0 -27
- data/vendor/rspec/lib/spec/example/before_and_after_hooks.rb +0 -93
- data/vendor/rspec/lib/spec/example/errors.rb +0 -25
- data/vendor/rspec/lib/spec/example/example_group.rb +0 -10
- data/vendor/rspec/lib/spec/example/example_group_factory.rb +0 -82
- data/vendor/rspec/lib/spec/example/example_group_hierarchy.rb +0 -53
- data/vendor/rspec/lib/spec/example/example_group_methods.rb +0 -282
- data/vendor/rspec/lib/spec/example/example_group_proxy.rb +0 -61
- data/vendor/rspec/lib/spec/example/example_matcher.rb +0 -43
- data/vendor/rspec/lib/spec/example/example_methods.rb +0 -152
- data/vendor/rspec/lib/spec/example/example_proxy.rb +0 -41
- data/vendor/rspec/lib/spec/example/module_reopening_fix.rb +0 -43
- data/vendor/rspec/lib/spec/example/pending.rb +0 -18
- data/vendor/rspec/lib/spec/example/predicate_matchers.rb +0 -46
- data/vendor/rspec/lib/spec/example/shared_example_group.rb +0 -59
- data/vendor/rspec/lib/spec/example/subject.rb +0 -108
- data/vendor/rspec/lib/spec/expectations.rb +0 -35
- data/vendor/rspec/lib/spec/expectations/errors.rb +0 -12
- data/vendor/rspec/lib/spec/expectations/extensions.rb +0 -1
- data/vendor/rspec/lib/spec/expectations/extensions/kernel.rb +0 -52
- data/vendor/rspec/lib/spec/expectations/fail_with.rb +0 -45
- data/vendor/rspec/lib/spec/expectations/handler.rb +0 -50
- data/vendor/rspec/lib/spec/extensions/instance_exec.rb +0 -31
- data/vendor/rspec/lib/spec/interop/test.rb +0 -44
- data/vendor/rspec/lib/spec/interop/test/unit/autorunner.rb +0 -6
- data/vendor/rspec/lib/spec/interop/test/unit/testcase.rb +0 -56
- data/vendor/rspec/lib/spec/interop/test/unit/testresult.rb +0 -6
- data/vendor/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb +0 -34
- data/vendor/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +0 -61
- data/vendor/rspec/lib/spec/matchers.rb +0 -195
- data/vendor/rspec/lib/spec/matchers/be.rb +0 -211
- data/vendor/rspec/lib/spec/matchers/be_close.rb +0 -32
- data/vendor/rspec/lib/spec/matchers/be_instance_of.rb +0 -26
- data/vendor/rspec/lib/spec/matchers/be_kind_of.rb +0 -26
- data/vendor/rspec/lib/spec/matchers/change.rb +0 -151
- data/vendor/rspec/lib/spec/matchers/compatibility.rb +0 -14
- data/vendor/rspec/lib/spec/matchers/dsl.rb +0 -20
- data/vendor/rspec/lib/spec/matchers/eql.rb +0 -42
- data/vendor/rspec/lib/spec/matchers/equal.rb +0 -53
- data/vendor/rspec/lib/spec/matchers/errors.rb +0 -5
- data/vendor/rspec/lib/spec/matchers/exist.rb +0 -16
- data/vendor/rspec/lib/spec/matchers/generated_descriptions.rb +0 -36
- data/vendor/rspec/lib/spec/matchers/has.rb +0 -35
- data/vendor/rspec/lib/spec/matchers/have.rb +0 -152
- data/vendor/rspec/lib/spec/matchers/include.rb +0 -44
- data/vendor/rspec/lib/spec/matchers/match.rb +0 -21
- data/vendor/rspec/lib/spec/matchers/match_array.rb +0 -71
- data/vendor/rspec/lib/spec/matchers/matcher.rb +0 -102
- data/vendor/rspec/lib/spec/matchers/method_missing.rb +0 -9
- data/vendor/rspec/lib/spec/matchers/operator_matcher.rb +0 -78
- data/vendor/rspec/lib/spec/matchers/pretty.rb +0 -37
- data/vendor/rspec/lib/spec/matchers/raise_error.rb +0 -129
- data/vendor/rspec/lib/spec/matchers/respond_to.rb +0 -71
- data/vendor/rspec/lib/spec/matchers/satisfy.rb +0 -47
- data/vendor/rspec/lib/spec/matchers/simple_matcher.rb +0 -133
- data/vendor/rspec/lib/spec/matchers/throw_symbol.rb +0 -104
- data/vendor/rspec/lib/spec/matchers/wrap_expectation.rb +0 -55
- data/vendor/rspec/lib/spec/mocks.rb +0 -200
- data/vendor/rspec/lib/spec/mocks/argument_expectation.rb +0 -51
- data/vendor/rspec/lib/spec/mocks/argument_matchers.rb +0 -237
- data/vendor/rspec/lib/spec/mocks/error_generator.rb +0 -92
- data/vendor/rspec/lib/spec/mocks/errors.rb +0 -10
- data/vendor/rspec/lib/spec/mocks/example_methods.rb +0 -69
- data/vendor/rspec/lib/spec/mocks/extensions.rb +0 -1
- data/vendor/rspec/lib/spec/mocks/extensions/object.rb +0 -3
- data/vendor/rspec/lib/spec/mocks/framework.rb +0 -15
- data/vendor/rspec/lib/spec/mocks/message_expectation.rb +0 -343
- data/vendor/rspec/lib/spec/mocks/methods.rb +0 -89
- data/vendor/rspec/lib/spec/mocks/mock.rb +0 -71
- data/vendor/rspec/lib/spec/mocks/order_group.rb +0 -29
- data/vendor/rspec/lib/spec/mocks/proxy.rb +0 -245
- data/vendor/rspec/lib/spec/mocks/space.rb +0 -28
- data/vendor/rspec/lib/spec/rake/spectask.rb +0 -230
- data/vendor/rspec/lib/spec/rake/verify_rcov.rb +0 -52
- data/vendor/rspec/lib/spec/ruby.rb +0 -9
- data/vendor/rspec/lib/spec/runner.rb +0 -66
- data/vendor/rspec/lib/spec/runner/backtrace_tweaker.rb +0 -77
- data/vendor/rspec/lib/spec/runner/class_and_arguments_parser.rb +0 -14
- data/vendor/rspec/lib/spec/runner/command_line.rb +0 -15
- data/vendor/rspec/lib/spec/runner/configuration.rb +0 -194
- data/vendor/rspec/lib/spec/runner/differs/default.rb +0 -93
- data/vendor/rspec/lib/spec/runner/differs/load-diff-lcs.rb +0 -12
- data/vendor/rspec/lib/spec/runner/drb_command_line.rb +0 -26
- data/vendor/rspec/lib/spec/runner/example_group_runner.rb +0 -58
- data/vendor/rspec/lib/spec/runner/extensions/kernel.rb +0 -9
- data/vendor/rspec/lib/spec/runner/formatter/base_formatter.rb +0 -139
- data/vendor/rspec/lib/spec/runner/formatter/base_text_formatter.rb +0 -142
- data/vendor/rspec/lib/spec/runner/formatter/failing_example_groups_formatter.rb +0 -25
- data/vendor/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +0 -20
- data/vendor/rspec/lib/spec/runner/formatter/html_formatter.rb +0 -338
- data/vendor/rspec/lib/spec/runner/formatter/nested_text_formatter.rb +0 -47
- data/vendor/rspec/lib/spec/runner/formatter/no_op_method_missing.rb +0 -21
- data/vendor/rspec/lib/spec/runner/formatter/profile_formatter.rb +0 -47
- data/vendor/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +0 -33
- data/vendor/rspec/lib/spec/runner/formatter/silent_formatter.rb +0 -10
- data/vendor/rspec/lib/spec/runner/formatter/snippet_extractor.rb +0 -52
- data/vendor/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +0 -33
- data/vendor/rspec/lib/spec/runner/formatter/text_mate_formatter.rb +0 -16
- data/vendor/rspec/lib/spec/runner/heckle_runner.rb +0 -72
- data/vendor/rspec/lib/spec/runner/heckle_runner_unsupported.rb +0 -10
- data/vendor/rspec/lib/spec/runner/line_number_query.rb +0 -78
- data/vendor/rspec/lib/spec/runner/option_parser.rb +0 -223
- data/vendor/rspec/lib/spec/runner/options.rb +0 -400
- data/vendor/rspec/lib/spec/runner/reporter.rb +0 -171
- data/vendor/rspec/lib/spec/stubs/cucumber.rb +0 -5
- data/vendor/rspec/lib/spec/test/unit.rb +0 -10
- data/vendor/rspec/lib/spec/version.rb +0 -14
- data/vendor/rspec/resources/helpers/cmdline.rb +0 -8
- data/vendor/rspec/resources/rake/examples.rake +0 -7
- data/vendor/rspec/resources/rake/examples_with_rcov.rake +0 -9
- data/vendor/rspec/resources/rake/failing_examples_with_html.rake +0 -9
- data/vendor/rspec/resources/rake/verify_rcov.rake +0 -7
- data/vendor/rspec/spec/README.jruby +0 -15
- data/vendor/rspec/spec/autotest/autotest_helper.rb +0 -8
- data/vendor/rspec/spec/autotest/autotest_matchers.rb +0 -38
- data/vendor/rspec/spec/autotest/discover_spec.rb +0 -8
- data/vendor/rspec/spec/autotest/failed_results_re_spec.rb +0 -31
- data/vendor/rspec/spec/autotest/rspec_spec.rb +0 -126
- data/vendor/rspec/spec/ruby_forker.rb +0 -13
- data/vendor/rspec/spec/spec.opts +0 -6
- data/vendor/rspec/spec/spec/dsl/main_spec.rb +0 -95
- data/vendor/rspec/spec/spec/example/example_group_class_definition_spec.rb +0 -51
- data/vendor/rspec/spec/spec/example/example_group_factory_spec.rb +0 -180
- data/vendor/rspec/spec/spec/example/example_group_methods_spec.rb +0 -759
- data/vendor/rspec/spec/spec/example/example_group_proxy_spec.rb +0 -107
- data/vendor/rspec/spec/spec/example/example_group_spec.rb +0 -643
- data/vendor/rspec/spec/spec/example/example_matcher_spec.rb +0 -86
- data/vendor/rspec/spec/spec/example/example_methods_spec.rb +0 -162
- data/vendor/rspec/spec/spec/example/example_proxy_spec.rb +0 -57
- data/vendor/rspec/spec/spec/example/helper_method_spec.rb +0 -24
- data/vendor/rspec/spec/spec/example/nested_example_group_spec.rb +0 -71
- data/vendor/rspec/spec/spec/example/pending_module_spec.rb +0 -58
- data/vendor/rspec/spec/spec/example/predicate_matcher_spec.rb +0 -41
- data/vendor/rspec/spec/spec/example/shared_example_group_spec.rb +0 -257
- data/vendor/rspec/spec/spec/example/subclassing_example_group_spec.rb +0 -25
- data/vendor/rspec/spec/spec/example/subject_spec.rb +0 -103
- data/vendor/rspec/spec/spec/expectations/differs/default_spec.rb +0 -194
- data/vendor/rspec/spec/spec/expectations/extensions/kernel_spec.rb +0 -45
- data/vendor/rspec/spec/spec/expectations/fail_with_spec.rb +0 -96
- data/vendor/rspec/spec/spec/expectations/handler_spec.rb +0 -206
- data/vendor/rspec/spec/spec/expectations/wrap_expectation_spec.rb +0 -30
- data/vendor/rspec/spec/spec/interop/test/unit/resources/spec_that_fails.rb +0 -10
- data/vendor/rspec/spec/spec/interop/test/unit/resources/spec_that_passes.rb +0 -10
- data/vendor/rspec/spec/spec/interop/test/unit/resources/spec_with_errors.rb +0 -10
- data/vendor/rspec/spec/spec/interop/test/unit/resources/spec_with_options_hash.rb +0 -13
- data/vendor/rspec/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +0 -10
- data/vendor/rspec/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +0 -10
- data/vendor/rspec/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +0 -10
- data/vendor/rspec/spec/spec/interop/test/unit/resources/test_case_with_various_names.rb +0 -22
- data/vendor/rspec/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +0 -38
- data/vendor/rspec/spec/spec/interop/test/unit/spec_spec.rb +0 -48
- data/vendor/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +0 -18
- data/vendor/rspec/spec/spec/interop/test/unit/testcase_spec.rb +0 -50
- data/vendor/rspec/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +0 -9
- data/vendor/rspec/spec/spec/matchers/be_close_spec.rb +0 -50
- data/vendor/rspec/spec/spec/matchers/be_instance_of_spec.rb +0 -36
- data/vendor/rspec/spec/spec/matchers/be_kind_of_spec.rb +0 -33
- data/vendor/rspec/spec/spec/matchers/be_spec.rb +0 -419
- data/vendor/rspec/spec/spec/matchers/change_spec.rb +0 -349
- data/vendor/rspec/spec/spec/matchers/compatibility_spec.rb +0 -28
- data/vendor/rspec/spec/spec/matchers/description_generation_spec.rb +0 -160
- data/vendor/rspec/spec/spec/matchers/dsl_spec.rb +0 -34
- data/vendor/rspec/spec/spec/matchers/eql_spec.rb +0 -33
- data/vendor/rspec/spec/spec/matchers/equal_spec.rb +0 -57
- data/vendor/rspec/spec/spec/matchers/exist_spec.rb +0 -65
- data/vendor/rspec/spec/spec/matchers/has_spec.rb +0 -190
- data/vendor/rspec/spec/spec/matchers/have_spec.rb +0 -396
- data/vendor/rspec/spec/spec/matchers/include_spec.rb +0 -88
- data/vendor/rspec/spec/spec/matchers/match_array_spec.rb +0 -108
- data/vendor/rspec/spec/spec/matchers/match_spec.rb +0 -57
- data/vendor/rspec/spec/spec/matchers/matcher_methods_spec.rb +0 -63
- data/vendor/rspec/spec/spec/matchers/matcher_spec.rb +0 -273
- data/vendor/rspec/spec/spec/matchers/matchers_spec.rb +0 -2
- data/vendor/rspec/spec/spec/matchers/operator_matcher_spec.rb +0 -191
- data/vendor/rspec/spec/spec/matchers/raise_error_spec.rb +0 -333
- data/vendor/rspec/spec/spec/matchers/respond_to_spec.rb +0 -116
- data/vendor/rspec/spec/spec/matchers/satisfy_spec.rb +0 -36
- data/vendor/rspec/spec/spec/matchers/simple_matcher_spec.rb +0 -93
- data/vendor/rspec/spec/spec/matchers/throw_symbol_spec.rb +0 -96
- data/vendor/rspec/spec/spec/mocks/and_yield_spec.rb +0 -117
- data/vendor/rspec/spec/spec/mocks/any_number_of_times_spec.rb +0 -36
- data/vendor/rspec/spec/spec/mocks/argument_expectation_spec.rb +0 -23
- data/vendor/rspec/spec/spec/mocks/argument_matchers_spec.rb +0 -19
- data/vendor/rspec/spec/spec/mocks/at_least_spec.rb +0 -97
- data/vendor/rspec/spec/spec/mocks/at_most_spec.rb +0 -93
- data/vendor/rspec/spec/spec/mocks/bug_report_10260_spec.rb +0 -8
- data/vendor/rspec/spec/spec/mocks/bug_report_10263_spec.rb +0 -27
- data/vendor/rspec/spec/spec/mocks/bug_report_11545_spec.rb +0 -32
- data/vendor/rspec/spec/spec/mocks/bug_report_15719_spec.rb +0 -30
- data/vendor/rspec/spec/spec/mocks/bug_report_496_spec.rb +0 -19
- data/vendor/rspec/spec/spec/mocks/bug_report_600_spec.rb +0 -22
- data/vendor/rspec/spec/spec/mocks/bug_report_7611_spec.rb +0 -19
- data/vendor/rspec/spec/spec/mocks/bug_report_7805_spec.rb +0 -22
- data/vendor/rspec/spec/spec/mocks/bug_report_8165_spec.rb +0 -31
- data/vendor/rspec/spec/spec/mocks/bug_report_8302_spec.rb +0 -26
- data/vendor/rspec/spec/spec/mocks/bug_report_830_spec.rb +0 -21
- data/vendor/rspec/spec/spec/mocks/double_spec.rb +0 -12
- data/vendor/rspec/spec/spec/mocks/failing_argument_matchers_spec.rb +0 -95
- data/vendor/rspec/spec/spec/mocks/hash_including_matcher_spec.rb +0 -90
- data/vendor/rspec/spec/spec/mocks/hash_not_including_matcher_spec.rb +0 -67
- data/vendor/rspec/spec/spec/mocks/mock_ordering_spec.rb +0 -94
- data/vendor/rspec/spec/spec/mocks/mock_space_spec.rb +0 -54
- data/vendor/rspec/spec/spec/mocks/mock_spec.rb +0 -594
- data/vendor/rspec/spec/spec/mocks/multiple_return_value_spec.rb +0 -113
- data/vendor/rspec/spec/spec/mocks/nil_expectation_warning_spec.rb +0 -53
- data/vendor/rspec/spec/spec/mocks/null_object_mock_spec.rb +0 -54
- data/vendor/rspec/spec/spec/mocks/once_counts_spec.rb +0 -53
- data/vendor/rspec/spec/spec/mocks/options_hash_spec.rb +0 -35
- data/vendor/rspec/spec/spec/mocks/partial_mock_spec.rb +0 -164
- data/vendor/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +0 -66
- data/vendor/rspec/spec/spec/mocks/passing_argument_matchers_spec.rb +0 -145
- data/vendor/rspec/spec/spec/mocks/precise_counts_spec.rb +0 -52
- data/vendor/rspec/spec/spec/mocks/record_messages_spec.rb +0 -26
- data/vendor/rspec/spec/spec/mocks/stub_chain_spec.rb +0 -42
- data/vendor/rspec/spec/spec/mocks/stub_implementation_spec.rb +0 -31
- data/vendor/rspec/spec/spec/mocks/stub_spec.rb +0 -203
- data/vendor/rspec/spec/spec/mocks/stubbed_message_expectations_spec.rb +0 -26
- data/vendor/rspec/spec/spec/mocks/twice_counts_spec.rb +0 -67
- data/vendor/rspec/spec/spec/mocks/unstub_spec.rb +0 -127
- data/vendor/rspec/spec/spec/package/bin_spec_spec.rb +0 -16
- data/vendor/rspec/spec/spec/rake/spectask_spec.rb +0 -150
- data/vendor/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +0 -23
- data/vendor/rspec/spec/spec/runner/command_line_spec.rb +0 -162
- data/vendor/rspec/spec/spec/runner/configuration_spec.rb +0 -320
- data/vendor/rspec/spec/spec/runner/drb_command_line_spec.rb +0 -107
- data/vendor/rspec/spec/spec/runner/empty_file.txt +0 -0
- data/vendor/rspec/spec/spec/runner/example_group_runner_spec.rb +0 -26
- data/vendor/rspec/spec/spec/runner/examples.txt +0 -2
- data/vendor/rspec/spec/spec/runner/failed.txt +0 -3
- data/vendor/rspec/spec/spec/runner/formatter/base_formatter_spec.rb +0 -30
- data/vendor/rspec/spec/spec/runner/formatter/base_text_formatter_spec.rb +0 -113
- data/vendor/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +0 -45
- data/vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +0 -33
- data/vendor/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +0 -377
- data/vendor/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +0 -377
- data/vendor/rspec/spec/spec/runner/formatter/html_formatted-1.8.7.html +0 -377
- data/vendor/rspec/spec/spec/runner/formatter/html_formatted-1.9.1.html +0 -377
- data/vendor/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +0 -118
- data/vendor/rspec/spec/spec/runner/formatter/nested_text_formatter_spec.rb +0 -305
- data/vendor/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +0 -70
- data/vendor/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +0 -149
- data/vendor/rspec/spec/spec/runner/formatter/snippet_extractor_spec.rb +0 -18
- data/vendor/rspec/spec/spec/runner/formatter/specdoc_formatter_spec.rb +0 -159
- data/vendor/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6-jruby.html +0 -371
- data/vendor/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +0 -371
- data/vendor/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +0 -371
- data/vendor/rspec/spec/spec/runner/formatter/text_mate_formatted-1.9.1.html +0 -371
- data/vendor/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb +0 -106
- data/vendor/rspec/spec/spec/runner/heckle_runner_spec.rb +0 -78
- data/vendor/rspec/spec/spec/runner/heckler_spec.rb +0 -20
- data/vendor/rspec/spec/spec/runner/line_number_query/line_number_query_fixture.rb +0 -70
- data/vendor/rspec/spec/spec/runner/line_number_query_spec.rb +0 -129
- data/vendor/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +0 -51
- data/vendor/rspec/spec/spec/runner/option_parser_spec.rb +0 -545
- data/vendor/rspec/spec/spec/runner/options_spec.rb +0 -547
- data/vendor/rspec/spec/spec/runner/output_one_time_fixture.rb +0 -7
- data/vendor/rspec/spec/spec/runner/output_one_time_fixture_runner.rb +0 -7
- data/vendor/rspec/spec/spec/runner/output_one_time_spec.rb +0 -15
- data/vendor/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +0 -123
- data/vendor/rspec/spec/spec/runner/reporter_spec.rb +0 -244
- data/vendor/rspec/spec/spec/runner/resources/a_bar.rb +0 -0
- data/vendor/rspec/spec/spec/runner/resources/a_foo.rb +0 -0
- data/vendor/rspec/spec/spec/runner/resources/a_spec.rb +0 -1
- data/vendor/rspec/spec/spec/runner/resources/custom_example_group_runner.rb +0 -14
- data/vendor/rspec/spec/spec/runner/resources/utf8_encoded.rb +0 -8
- data/vendor/rspec/spec/spec/runner/spec.opts +0 -2
- data/vendor/rspec/spec/spec/runner/spec_drb.opts +0 -2
- data/vendor/rspec/spec/spec/runner/spec_spaced.opts +0 -2
- data/vendor/rspec/spec/spec/runner_spec.rb +0 -13
- data/vendor/rspec/spec/spec_helper.rb +0 -112
- data/vendor/rspec/spec/support/macros.rb +0 -29
- data/vendor/rspec/spec/support/spec_classes.rb +0 -133
- data/vendor/rubyexts/CHANGELOG +0 -2
- data/vendor/rubyexts/LICENSE +0 -20
- data/vendor/rubyexts/README.textile +0 -0
- data/vendor/rubyexts/Rakefile +0 -61
- data/vendor/rubyexts/TODO.txt +0 -6
- data/vendor/rubyexts/lib/rubyexts.rb +0 -102
- data/vendor/rubyexts/lib/rubyexts/array.rb +0 -20
- data/vendor/rubyexts/lib/rubyexts/attribute.rb +0 -151
- data/vendor/rubyexts/lib/rubyexts/capture_io.rb +0 -32
- data/vendor/rubyexts/lib/rubyexts/class.rb +0 -177
- data/vendor/rubyexts/lib/rubyexts/colored_string.rb +0 -103
- data/vendor/rubyexts/lib/rubyexts/enumerable.rb +0 -30
- data/vendor/rubyexts/lib/rubyexts/file.rb +0 -84
- data/vendor/rubyexts/lib/rubyexts/hash.rb +0 -147
- data/vendor/rubyexts/lib/rubyexts/kernel.rb +0 -91
- data/vendor/rubyexts/lib/rubyexts/module.rb +0 -53
- data/vendor/rubyexts/lib/rubyexts/object.rb +0 -56
- data/vendor/rubyexts/lib/rubyexts/object_space.rb +0 -16
- data/vendor/rubyexts/lib/rubyexts/os.rb +0 -89
- data/vendor/rubyexts/lib/rubyexts/platform.rb +0 -27
- data/vendor/rubyexts/lib/rubyexts/random.rb +0 -25
- data/vendor/rubyexts/lib/rubyexts/string.rb +0 -92
- data/vendor/rubyexts/lib/rubyexts/time.rb +0 -15
- data/vendor/rubyexts/lib/rubyexts/time_dsl.rb +0 -62
- data/vendor/rubyexts/lib/rubyexts/try_dup.rb +0 -43
- data/vendor/rubyexts/lib/rubyexts/unique_array.rb +0 -16
- data/vendor/rubyexts/rubyexts.gemspec +0 -36
- data/vendor/rubyexts/script/spec +0 -12
- data/vendor/rubyexts/spec/rubyexts/array_spec.rb +0 -19
- data/vendor/rubyexts/spec/rubyexts/attribute_spec.rb +0 -37
- data/vendor/rubyexts/spec/rubyexts/class_spec.rb +0 -1
- data/vendor/rubyexts/spec/rubyexts/cli_spec.rb +0 -0
- data/vendor/rubyexts/spec/rubyexts/colored_string_spec.rb +0 -9
- data/vendor/rubyexts/spec/rubyexts/enumerable_spec.rb +0 -52
- data/vendor/rubyexts/spec/rubyexts/file_spec.rb +0 -78
- data/vendor/rubyexts/spec/rubyexts/hash_spec.rb +0 -91
- data/vendor/rubyexts/spec/rubyexts/kernel_spec.rb +0 -9
- data/vendor/rubyexts/spec/rubyexts/module_spec.rb +0 -0
- data/vendor/rubyexts/spec/rubyexts/object_space_spec.rb +0 -17
- data/vendor/rubyexts/spec/rubyexts/object_spec.rb +0 -57
- data/vendor/rubyexts/spec/rubyexts/os_spec.rb +0 -121
- data/vendor/rubyexts/spec/rubyexts/platform_spec.rb +0 -0
- data/vendor/rubyexts/spec/rubyexts/random_spec.rb +0 -31
- data/vendor/rubyexts/spec/rubyexts/string_spec.rb +0 -23
- data/vendor/rubyexts/spec/rubyexts/time_dsl_spec.rb +0 -88
- data/vendor/rubyexts/spec/rubyexts/time_spec.rb +0 -11
- data/vendor/rubyexts/spec/rubyexts/unique_array_spec.rb +0 -0
- data/vendor/rubyexts/spec/rubyexts_spec.rb +0 -182
- data/vendor/rubyexts/spec/spec.opts +0 -5
- data/vendor/rubyexts/spec/spec_helper.rb +0 -16
- data/vendor/simple-templater/CHANGELOG +0 -10
- data/vendor/simple-templater/LICENSE +0 -20
- data/vendor/simple-templater/README.textile +0 -136
- data/vendor/simple-templater/Rakefile +0 -61
- data/vendor/simple-templater/TODO.txt +0 -15
- data/vendor/simple-templater/bin/simple-templater +0 -66
- data/vendor/simple-templater/deps.rip +0 -7
- data/vendor/simple-templater/lib/simple-templater.rb +0 -97
- data/vendor/simple-templater/lib/simple-templater/argv_parsing.rb +0 -27
- data/vendor/simple-templater/lib/simple-templater/builder.rb +0 -134
- data/vendor/simple-templater/lib/simple-templater/discoverer.rb +0 -20
- data/vendor/simple-templater/lib/simple-templater/discoverers/gems.rb +0 -79
- data/vendor/simple-templater/lib/simple-templater/discoverers/plain.rb +0 -1
- data/vendor/simple-templater/lib/simple-templater/discoverers/rip.rb +0 -1
- data/vendor/simple-templater/lib/simple-templater/dsl.rb +0 -27
- data/vendor/simple-templater/lib/simple-templater/generator.rb +0 -129
- data/vendor/simple-templater/lib/simple-templater/generator_set.rb +0 -45
- data/vendor/simple-templater/lib/simple-templater/helpers.rb +0 -34
- data/vendor/simple-templater/lib/simple-templater/hooks/hook.rb +0 -76
- data/vendor/simple-templater/lib/simple-templater/hooks/postprocess/git_repository.rb +0 -25
- data/vendor/simple-templater/lib/simple-templater/hooks/postprocess/github.rb +0 -20
- data/vendor/simple-templater/lib/simple-templater/hooks/preprocess/full_name.rb +0 -17
- data/vendor/simple-templater/lib/simple-templater/hooks/preprocess/github.rb +0 -25
- data/vendor/simple-templater/script/spec +0 -14
- data/vendor/simple-templater/simple-templater.gemspec +0 -45
- data/vendor/simple-templater/simple-templater.scope +0 -6
- data/vendor/simple-templater/spec/simple-templater/argv_parsing_spec.rb +0 -41
- data/vendor/simple-templater/spec/simple-templater/builder_spec.rb +0 -1
- data/vendor/simple-templater/spec/simple-templater/discoverers/gems_spec.rb +0 -0
- data/vendor/simple-templater/spec/simple-templater/discoverers/plain_spec.rb +0 -0
- data/vendor/simple-templater/spec/simple-templater/discoverers/rip_spec.rb +0 -0
- data/vendor/simple-templater/spec/simple-templater/generator_set_spec.rb +0 -55
- data/vendor/simple-templater/spec/simple-templater/generator_spec.rb +0 -30
- data/vendor/simple-templater/spec/simple-templater/helpers_spec.rb +0 -81
- data/vendor/simple-templater/spec/simple-templater/hooks/hook_spec.rb +0 -100
- data/vendor/simple-templater/spec/simple-templater/hooks/postprocess/git_repository_spec.rb +0 -25
- data/vendor/simple-templater/spec/simple-templater/hooks/postprocess/github_spec.rb +0 -8
- data/vendor/simple-templater/spec/simple-templater_spec.rb +0 -112
- data/vendor/simple-templater/spec/spec.opts +0 -5
- data/vendor/simple-templater/spec/spec_helper.rb +0 -19
- data/vendor/simple-templater/spec/stubs/gems/cache/test_generator-0.0.1.gem +0 -0
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/simple-generator.scope +0 -8
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/simple-templater.scope +0 -8
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/stubs/content/%name%1_test.rb.rbt +0 -1
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/stubs/content/%name%_test.rb +0 -0
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/stubs/content/README.textile +0 -3
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/stubs/content/script.rb.rbt +0 -1
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/stubs/test/content/%name%1_test.rb.rbt +0 -1
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/stubs/test/content/%name%_test.rb +0 -0
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/stubs/test/content/README.textile +0 -3
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/stubs/test/content/script.rb.rbt +0 -1
- data/vendor/simple-templater/spec/stubs/gems/gems/test_generator-0.0.1/test_generator.gemspec +0 -19
- data/vendor/simple-templater/spec/stubs/gems/specifications/test_generator-0.0.1.gemspec +0 -28
- data/vendor/simple-templater/spec/stubs/simple-templater.scope +0 -8
- data/vendor/simple-templater/spec/stubs/test_generator/simple-templater.scope +0 -8
- data/vendor/simple-templater/spec/stubs/test_generator/stubs/test/content/%name%1_test.rb.rbt +0 -1
- data/vendor/simple-templater/spec/stubs/test_generator/stubs/test/content/%name%_test.rb +0 -0
- data/vendor/simple-templater/spec/stubs/test_generator/stubs/test/content/README.textile +0 -3
- data/vendor/simple-templater/spec/stubs/test_generator/stubs/test/content/script.rb.rbt +0 -1
- data/vendor/simple-templater/spec/stubs/test_generator/test_generator-0.0.1.gem +0 -0
- data/vendor/simple-templater/spec/stubs/test_generator/test_generator.gemspec +0 -19
- data/vendor/simple-templater/stubs/project/content/%name%.gemspec.rbt +0 -37
- data/vendor/simple-templater/stubs/project/content/CHANGELOG +0 -2
- data/vendor/simple-templater/stubs/project/content/LICENSE.rbt +0 -20
- data/vendor/simple-templater/stubs/project/content/README.textile.rbt +0 -19
- data/vendor/simple-templater/stubs/project/content/Rakefile +0 -39
- data/vendor/simple-templater/stubs/project/content/TODO.txt +0 -0
- data/vendor/simple-templater/stubs/project/content/bin/%name%.rbt +0 -14
- data/vendor/simple-templater/stubs/project/content/deps.rip +0 -5
- data/vendor/simple-templater/stubs/project/content/lib/%name%.rb.rbt +0 -5
- data/vendor/simple-templater/stubs/project/content/spec/%name%_spec.rb.rbt +0 -10
- data/vendor/simple-templater/stubs/project/content/spec/spec.opts +0 -5
- data/vendor/simple-templater/stubs/project/content/spec/spec_helper.rb.rbt +0 -11
- data/vendor/simple-templater/stubs/project/metadata.yml +0 -3
- data/vendor/simple-templater/stubs/project/postprocess.rb +0 -13
- data/vendor/simple-templater/stubs/project/setup.rb +0 -13
- data/vendor/simple-templater/stubs/stub/content/metadata.yml.rbt +0 -3
- data/vendor/simple-templater/stubs/stub/content/postprocess.rb +0 -11
- data/vendor/simple-templater/stubs/stub/content/setup.rb +0 -10
- data/vendor/simple-templater/stubs/stub/metadata.yml +0 -3
- data/vendor/simple-templater/stubs/stub/postprocess.rb +0 -9
- data/vendor/simple-templater/stubs/stub/setup.rb +0 -15
- data/vendor/simple-templater/vendor/abstract/ChangeLog +0 -3
- data/vendor/simple-templater/vendor/abstract/README.txt +0 -57
- data/vendor/simple-templater/vendor/abstract/abstract.gemspec +0 -48
- data/vendor/simple-templater/vendor/abstract/doc/classes/Kernel.html +0 -134
- data/vendor/simple-templater/vendor/abstract/doc/classes/Kernel.src/M000002.html +0 -24
- data/vendor/simple-templater/vendor/abstract/doc/classes/Module.html +0 -140
- data/vendor/simple-templater/vendor/abstract/doc/classes/Module.src/M000001.html +0 -20
- data/vendor/simple-templater/vendor/abstract/doc/created.rid +0 -1
- data/vendor/simple-templater/vendor/abstract/doc/files/README_txt.html +0 -173
- data/vendor/simple-templater/vendor/abstract/doc/files/lib/abstract_rb.html +0 -137
- data/vendor/simple-templater/vendor/abstract/doc/fr_class_index.html +0 -28
- data/vendor/simple-templater/vendor/abstract/doc/fr_file_index.html +0 -28
- data/vendor/simple-templater/vendor/abstract/doc/fr_method_index.html +0 -28
- data/vendor/simple-templater/vendor/abstract/doc/index.html +0 -24
- data/vendor/simple-templater/vendor/abstract/doc/rdoc-style.css +0 -208
- data/vendor/simple-templater/vendor/abstract/lib/abstract.rb +0 -75
- data/vendor/simple-templater/vendor/abstract/setup.rb +0 -1331
- data/vendor/simple-templater/vendor/abstract/test/test.rb +0 -91
- data/vendor/thor/CHANGELOG.rdoc +0 -82
- data/vendor/thor/LICENSE +0 -20
- data/vendor/thor/README.rdoc +0 -234
- data/vendor/thor/Thorfile +0 -63
- data/vendor/thor/bin/rake2thor +0 -86
- data/vendor/thor/bin/thor +0 -7
- data/vendor/thor/lib/thor.rb +0 -242
- data/vendor/thor/lib/thor/actions.rb +0 -273
- data/vendor/thor/lib/thor/actions/create_file.rb +0 -103
- data/vendor/thor/lib/thor/actions/directory.rb +0 -93
- data/vendor/thor/lib/thor/actions/empty_directory.rb +0 -134
- data/vendor/thor/lib/thor/actions/file_manipulation.rb +0 -219
- data/vendor/thor/lib/thor/actions/inject_into_file.rb +0 -101
- data/vendor/thor/lib/thor/base.rb +0 -517
- data/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +0 -75
- data/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -100
- data/vendor/thor/lib/thor/error.rb +0 -27
- data/vendor/thor/lib/thor/group.rb +0 -263
- data/vendor/thor/lib/thor/invocation.rb +0 -178
- data/vendor/thor/lib/thor/parser.rb +0 -4
- data/vendor/thor/lib/thor/parser/argument.rb +0 -67
- data/vendor/thor/lib/thor/parser/arguments.rb +0 -145
- data/vendor/thor/lib/thor/parser/option.rb +0 -132
- data/vendor/thor/lib/thor/parser/options.rb +0 -142
- data/vendor/thor/lib/thor/rake_compat.rb +0 -66
- data/vendor/thor/lib/thor/runner.rb +0 -299
- data/vendor/thor/lib/thor/shell.rb +0 -78
- data/vendor/thor/lib/thor/shell/basic.rb +0 -219
- data/vendor/thor/lib/thor/shell/color.rb +0 -108
- data/vendor/thor/lib/thor/task.rb +0 -122
- data/vendor/thor/lib/thor/util.rb +0 -251
- data/vendor/thor/lib/thor/version.rb +0 -3
- data/vendor/thor/spec/actions/create_file_spec.rb +0 -170
- data/vendor/thor/spec/actions/directory_spec.rb +0 -130
- data/vendor/thor/spec/actions/empty_directory_spec.rb +0 -91
- data/vendor/thor/spec/actions/file_manipulation_spec.rb +0 -249
- data/vendor/thor/spec/actions/inject_into_file_spec.rb +0 -106
- data/vendor/thor/spec/actions_spec.rb +0 -291
- data/vendor/thor/spec/base_spec.rb +0 -236
- data/vendor/thor/spec/core_ext/hash_with_indifferent_access_spec.rb +0 -43
- data/vendor/thor/spec/core_ext/ordered_hash_spec.rb +0 -115
- data/vendor/thor/spec/fixtures/application.rb +0 -2
- data/vendor/thor/spec/fixtures/bundle/execute.rb +0 -6
- data/vendor/thor/spec/fixtures/bundle/main.thor +0 -1
- data/vendor/thor/spec/fixtures/doc/%file_name%.rb.tt +0 -1
- data/vendor/thor/spec/fixtures/doc/README +0 -3
- data/vendor/thor/spec/fixtures/doc/config.rb +0 -1
- data/vendor/thor/spec/fixtures/group.thor +0 -83
- data/vendor/thor/spec/fixtures/invoke.thor +0 -112
- data/vendor/thor/spec/fixtures/script.thor +0 -126
- data/vendor/thor/spec/fixtures/task.thor +0 -10
- data/vendor/thor/spec/group_spec.rb +0 -177
- data/vendor/thor/spec/invocation_spec.rb +0 -107
- data/vendor/thor/spec/parser/argument_spec.rb +0 -47
- data/vendor/thor/spec/parser/arguments_spec.rb +0 -64
- data/vendor/thor/spec/parser/option_spec.rb +0 -212
- data/vendor/thor/spec/parser/options_spec.rb +0 -255
- data/vendor/thor/spec/rake_compat_spec.rb +0 -68
- data/vendor/thor/spec/runner_spec.rb +0 -204
- data/vendor/thor/spec/shell/basic_spec.rb +0 -211
- data/vendor/thor/spec/shell/color_spec.rb +0 -41
- data/vendor/thor/spec/shell_spec.rb +0 -25
- data/vendor/thor/spec/spec.opts +0 -1
- data/vendor/thor/spec/spec_helper.rb +0 -52
- data/vendor/thor/spec/task_spec.rb +0 -88
- data/vendor/thor/spec/thor_spec.rb +0 -234
- data/vendor/thor/spec/util_spec.rb +0 -196
@@ -1,188 +0,0 @@
|
|
1
|
-
body {
|
2
|
-
background-color:#FFFFFF;
|
3
|
-
}
|
4
|
-
|
5
|
-
.mainbody {
|
6
|
-
color:#333333;
|
7
|
-
line-height:150%;
|
8
|
-
margin: 5px 30px 5px 30px;
|
9
|
-
}
|
10
|
-
|
11
|
-
a:link, a:active, a:hover {
|
12
|
-
color:#CC6600;
|
13
|
-
}
|
14
|
-
|
15
|
-
a:visited {
|
16
|
-
color:#DD9900;
|
17
|
-
}
|
18
|
-
|
19
|
-
p {
|
20
|
-
color:#333333;
|
21
|
-
line-height:150%;
|
22
|
-
}
|
23
|
-
|
24
|
-
pre {
|
25
|
-
width: 100%;
|
26
|
-
line-height:130%;
|
27
|
-
white-space:pre;
|
28
|
-
}
|
29
|
-
|
30
|
-
.program {
|
31
|
-
border-style:solid;
|
32
|
-
border-width:1px;
|
33
|
-
border-color:#6699FF;
|
34
|
-
color:#333333;
|
35
|
-
background-color:#DDEEFF;
|
36
|
-
padding:8px 9px 8px 9px;
|
37
|
-
margin:0px;
|
38
|
-
word-break:break-all;
|
39
|
-
}
|
40
|
-
|
41
|
-
.terminal {
|
42
|
-
border-style:solid;
|
43
|
-
border-width:1;
|
44
|
-
border-color:#999999;
|
45
|
-
color:#333333;
|
46
|
-
background-color:#E0E0E0;
|
47
|
-
padding:9px 10px 9px 10px;
|
48
|
-
margin:0px;
|
49
|
-
word-break:break-all;
|
50
|
-
}
|
51
|
-
|
52
|
-
.output {
|
53
|
-
border-style:solid;
|
54
|
-
border-width:1px;
|
55
|
-
border-color:#CCCCCC;
|
56
|
-
color:#333333;
|
57
|
-
background-color:#FFFFFF;
|
58
|
-
padding:8px 9px 8px 9px;
|
59
|
-
margin:0px;
|
60
|
-
word-break:break-all;
|
61
|
-
}
|
62
|
-
|
63
|
-
|
64
|
-
.program_caption {
|
65
|
-
margin-top: 20px;
|
66
|
-
}
|
67
|
-
|
68
|
-
.terminal_caption {
|
69
|
-
margin-top: 20px;
|
70
|
-
}
|
71
|
-
|
72
|
-
.output_caption {
|
73
|
-
margin-top: 20px;
|
74
|
-
}
|
75
|
-
|
76
|
-
|
77
|
-
ul,ol,dl {
|
78
|
-
/* margin:0px; */
|
79
|
-
/* padding:0px; */
|
80
|
-
color:#333333;
|
81
|
-
line-height:140%;
|
82
|
-
}
|
83
|
-
|
84
|
-
.dt2, .dt3 {
|
85
|
-
font-weight:bold;
|
86
|
-
}
|
87
|
-
|
88
|
-
.table1 {
|
89
|
-
padding:2px;
|
90
|
-
color:#333333;
|
91
|
-
background-color:#DDDDCC;
|
92
|
-
line-height:130%;
|
93
|
-
/*
|
94
|
-
border-width:1px;
|
95
|
-
border-style:solid;
|
96
|
-
border-color:#FFFFFF;
|
97
|
-
*/
|
98
|
-
margin:5;
|
99
|
-
}
|
100
|
-
|
101
|
-
.th1, .th2 {
|
102
|
-
padding:1px;
|
103
|
-
color:#333333;
|
104
|
-
/* background-color:#DDDDCC; */
|
105
|
-
background-color:#CCCCBB;
|
106
|
-
line-height:130%;
|
107
|
-
}
|
108
|
-
|
109
|
-
.td1, .th2 {
|
110
|
-
padding:1px;
|
111
|
-
color:#333333;
|
112
|
-
background-color:#EEEEDD;
|
113
|
-
line-height:130%;
|
114
|
-
}
|
115
|
-
|
116
|
-
.caption1, .caption2 {
|
117
|
-
/* font-size:x-small; */
|
118
|
-
color:#333333;
|
119
|
-
}
|
120
|
-
|
121
|
-
.table2 {
|
122
|
-
padding:1px;
|
123
|
-
color:#333333;
|
124
|
-
background-color:#DDDDCC;
|
125
|
-
line-height:130%;
|
126
|
-
/*
|
127
|
-
border-width:1px;
|
128
|
-
border-style:solid;
|
129
|
-
border-color:#FFFFFF;
|
130
|
-
*/
|
131
|
-
margin:5;
|
132
|
-
}
|
133
|
-
|
134
|
-
h1, .chapter, .doctitle {
|
135
|
-
color:#333333;
|
136
|
-
font-weight:bold;
|
137
|
-
padding:30px 0px 10px 0px;
|
138
|
-
}
|
139
|
-
|
140
|
-
h2, .section {
|
141
|
-
color:#333333;
|
142
|
-
font-weight:bold;
|
143
|
-
border-style:solid;
|
144
|
-
border-color:#6699FF;
|
145
|
-
border-width:0px 0px 2px 30px;
|
146
|
-
padding:10px 20px 0px 5px;
|
147
|
-
}
|
148
|
-
|
149
|
-
h3, .subsection {
|
150
|
-
color:#333333;
|
151
|
-
font-weight:bold;
|
152
|
-
border-style:solid;
|
153
|
-
border-color:#6699FF;
|
154
|
-
border-width: 0px 0px 0px 15px;
|
155
|
-
padding: 10px 20px 0px 5px;
|
156
|
-
}
|
157
|
-
|
158
|
-
.em {
|
159
|
-
font-weight:bold;
|
160
|
-
}
|
161
|
-
|
162
|
-
.toc {
|
163
|
-
/* font-size:small; */
|
164
|
-
/* line-height:100%; */
|
165
|
-
}
|
166
|
-
|
167
|
-
.footnote {
|
168
|
-
font-size:small;
|
169
|
-
}
|
170
|
-
|
171
|
-
.note {
|
172
|
-
background-color:#FFFFDD;
|
173
|
-
border-style:solid;
|
174
|
-
border-width:0px 1px 0px 1px;
|
175
|
-
border-color:#DDDD66;
|
176
|
-
color:#333300;
|
177
|
-
/* font-size:small; */
|
178
|
-
line-height:120%;
|
179
|
-
padding: 5px 20px 5px 20px;
|
180
|
-
}
|
181
|
-
|
182
|
-
.figure {
|
183
|
-
/*
|
184
|
-
border-width:1px;
|
185
|
-
border-color:#DDDD66;
|
186
|
-
white-space:pre;
|
187
|
-
*/
|
188
|
-
}
|
@@ -1,3285 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html">
|
5
|
-
<title>Erubis Users' Guide</title>
|
6
|
-
<meta name="generator" content="kwaser">
|
7
|
-
<meta http-equiv="Content-Style-Type" content="text/css">
|
8
|
-
<link rel="stylesheet" href="docstyle.css" type="text/css">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
|
12
|
-
<blockquote>
|
13
|
-
<div class="mainbody">
|
14
|
-
|
15
|
-
<div align="left"><h1>Erubis Users' Guide</h1></div>
|
16
|
-
<div align="left">
|
17
|
-
last update: $Date: 2008-06-13 08:04:21 +0900 (Fri, 13 Jun 2008) $<br>
|
18
|
-
</div>
|
19
|
-
|
20
|
-
<p>release: 2.6.2
|
21
|
-
</p>
|
22
|
-
<a name="preface"></a>
|
23
|
-
<h2 class="section1">Preface</h2>
|
24
|
-
<p>Erubis is an implementation of eRuby.
|
25
|
-
It has the following features.
|
26
|
-
</p>
|
27
|
-
<ul type="disc">
|
28
|
-
<li>Very fast, almost three times faster than ERB and about ten percent faster than eruby (implemented in C)
|
29
|
-
</li>
|
30
|
-
<li>File caching of converted Ruby script support
|
31
|
-
</li>
|
32
|
-
<li>Auto escaping support
|
33
|
-
</li>
|
34
|
-
<li>Auto trimming spaces around '<% %>'
|
35
|
-
</li>
|
36
|
-
<li>Embedded pattern changeable (default '<% %>')
|
37
|
-
</li>
|
38
|
-
<li>Enable to handle Processing Instructions (PI) as embedded pattern (ex. '<?rb ... ?>')
|
39
|
-
</li>
|
40
|
-
<li>Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript)
|
41
|
-
</li>
|
42
|
-
<li>Context object available and easy to combine eRuby template with YAML datafile
|
43
|
-
</li>
|
44
|
-
<li>Print statement available
|
45
|
-
</li>
|
46
|
-
<li>Easy to expand and customize in subclass
|
47
|
-
</li>
|
48
|
-
<li><a href="#rails">Ruby on Rails support</a>
|
49
|
-
</li>
|
50
|
-
<li>mod_ruby support|#topcs-modruby
|
51
|
-
</li>
|
52
|
-
</ul>
|
53
|
-
<p>Erubis is implemented in pure Ruby. It requires Ruby 1.8 or higher.
|
54
|
-
Erubis now supports Ruby 1.9.
|
55
|
-
</p>
|
56
|
-
<a name="toc"></a>
|
57
|
-
<h3 class="section2">Table of Contents</h3>
|
58
|
-
<ul>
|
59
|
-
<li><a href="#preface">Preface</a>
|
60
|
-
<ul>
|
61
|
-
<li><a href="#toc">Table of Contents</a>
|
62
|
-
</li>
|
63
|
-
</ul>
|
64
|
-
</li>
|
65
|
-
<li><a href="#install">Installation</a>
|
66
|
-
</li>
|
67
|
-
<li><a href="#tutorial">Tutorial</a>
|
68
|
-
<ul>
|
69
|
-
<li><a href="#tut-basic">Basic Example</a>
|
70
|
-
</li>
|
71
|
-
<li><a href="#tut-trim">Trimming Spaces</a>
|
72
|
-
</li>
|
73
|
-
<li><a href="#tut-escape">Escape</a>
|
74
|
-
</li>
|
75
|
-
<li><a href="#tut-pattern">Embedded Pattern</a>
|
76
|
-
</li>
|
77
|
-
<li><a href="#tut-context">Context Object</a>
|
78
|
-
</li>
|
79
|
-
<li><a href="#tut-datafile">Context Data File</a>
|
80
|
-
</li>
|
81
|
-
<li><a href="#tut-datastr">Context Data String</a>
|
82
|
-
</li>
|
83
|
-
<li><a href="#tut-preamble">Preamble and Postamble</a>
|
84
|
-
</li>
|
85
|
-
<li><a href="#tut-pi">Processing Instruction (PI) Converter</a>
|
86
|
-
</li>
|
87
|
-
<li><a href="#tut-notext">Retrieve Ruby Code</a>
|
88
|
-
</li>
|
89
|
-
</ul>
|
90
|
-
</li>
|
91
|
-
<li><a href="#enhancer">Enhancer</a>
|
92
|
-
<ul>
|
93
|
-
<li><a href="#escape-enhancer">EscapeEnhancer</a>
|
94
|
-
</li>
|
95
|
-
<li><a href="#stdout-enhancer">StdoutEnhancer</a>
|
96
|
-
</li>
|
97
|
-
<li><a href="#printout-enhancer">PrintOutEnhancer</a>
|
98
|
-
</li>
|
99
|
-
<li><a href="#printenabled-enhancer">PrintEnabledEnhancer</a>
|
100
|
-
</li>
|
101
|
-
<li><a href="#array-enhancer">ArrayEnhancer</a>
|
102
|
-
</li>
|
103
|
-
<li><a href="#arraybuffer-enhancer">ArrayBufferEnhancer</a>
|
104
|
-
</li>
|
105
|
-
<li><a href="#stringbuffer-enhancer">StringBufferEnhancer</a>
|
106
|
-
</li>
|
107
|
-
<li><a href="#erbout-enhancer">ErboutEnhancer</a>
|
108
|
-
</li>
|
109
|
-
<li><a href="#notext-enhancer">NoTextEnhancer</a>
|
110
|
-
</li>
|
111
|
-
<li><a href="#nocode-enhancer">NoCodeEnhancer</a>
|
112
|
-
</li>
|
113
|
-
<li><a href="#simplify-enhancer">SimplifyEnhancer</a>
|
114
|
-
</li>
|
115
|
-
<li><a href="#bipattern-enhancer">BiPatternEnhancer</a>
|
116
|
-
</li>
|
117
|
-
<li><a href="#percentline-enhancer">PercentLineEnhancer</a>
|
118
|
-
</li>
|
119
|
-
<li><a href="#headerfooter-enhancer">HeaderFooterEnhancer</a>
|
120
|
-
</li>
|
121
|
-
<li><a href="#interpolation-enhancer">InterpolationEnhancer</a>
|
122
|
-
</li>
|
123
|
-
<li><a href="#deleteindent-enhancer">DeleteIndentEnhancer</a>
|
124
|
-
</li>
|
125
|
-
</ul>
|
126
|
-
</li>
|
127
|
-
<li><a href="#lang">Multi-Language Support</a>
|
128
|
-
<ul>
|
129
|
-
<li><a href="#lang-php">PHP</a>
|
130
|
-
</li>
|
131
|
-
<li><a href="#lang-c">C</a>
|
132
|
-
</li>
|
133
|
-
<li><a href="#lang-java">Java</a>
|
134
|
-
</li>
|
135
|
-
<li><a href="#lang-scheme">Scheme</a>
|
136
|
-
</li>
|
137
|
-
<li><a href="#lang-perl">Perl</a>
|
138
|
-
</li>
|
139
|
-
<li><a href="#lang-javascript">JavaScript</a>
|
140
|
-
</li>
|
141
|
-
</ul>
|
142
|
-
</li>
|
143
|
-
<li><a href="#rails">Ruby on Rails Support</a>
|
144
|
-
<ul>
|
145
|
-
<li><a href="#rails-settings">Settings</a>
|
146
|
-
</li>
|
147
|
-
<li><a href="#rails-preprocessing">Preprosessing</a>
|
148
|
-
</li>
|
149
|
-
<li><a href="#rails-formhelpers">Form Helpers for Preprocessing</a>
|
150
|
-
</li>
|
151
|
-
<li><a href="#rails-others">Others</a>
|
152
|
-
</li>
|
153
|
-
</ul>
|
154
|
-
</li>
|
155
|
-
<li><a href="#topics">Other Topics</a>
|
156
|
-
<ul>
|
157
|
-
<li><a href="#'<%= =%>' and '<%= -%>'">'<%= =%>' and '<%= -%>'</a>
|
158
|
-
</li>
|
159
|
-
<li><a href="#'<%% %>' and '<%%= %>'">'<%% %>' and '<%%= %>'</a>
|
160
|
-
</li>
|
161
|
-
<li><a href="#topics-context-vs-binding">evaluate(context) v.s. result(binding)</a>
|
162
|
-
</li>
|
163
|
-
<li><a href="#topics-fasteruby">Class Erubis::FastEruby</a>
|
164
|
-
</li>
|
165
|
-
<li><a href="#topics-syntax">Syntax Checking</a>
|
166
|
-
</li>
|
167
|
-
<li><a href="#topics-caching">File Caching</a>
|
168
|
-
</li>
|
169
|
-
<li><a href="#topics-tinyeruby">Erubis::TinyEruby class</a>
|
170
|
-
</li>
|
171
|
-
<li><a href="#topics-php">NoTextEnhancer and NoCodeEnhancer in PHP</a>
|
172
|
-
</li>
|
173
|
-
<li><a href="#topcs-modruby">Helper Class for mod_ruby</a>
|
174
|
-
</li>
|
175
|
-
<li><a href="#topics-defmethod">Define method</a>
|
176
|
-
</li>
|
177
|
-
<li><a href="#topics-benchmark">Benchmark</a>
|
178
|
-
</li>
|
179
|
-
</ul>
|
180
|
-
</li>
|
181
|
-
<li><a href="#command">Command Reference</a>
|
182
|
-
<ul>
|
183
|
-
<li><a href="#command-usage">Usage</a>
|
184
|
-
</li>
|
185
|
-
<li><a href="#command-options">Options</a>
|
186
|
-
</li>
|
187
|
-
<li><a href="#command-props">Properties</a>
|
188
|
-
</li>
|
189
|
-
</ul>
|
190
|
-
</li>
|
191
|
-
</ul>
|
192
|
-
<br>
|
193
|
-
|
194
|
-
|
195
|
-
<br>
|
196
|
-
|
197
|
-
|
198
|
-
<a name="install"></a>
|
199
|
-
<h2 class="section1">Installation</h2>
|
200
|
-
<ul type="disc">
|
201
|
-
<li>If you have installed RubyGems, just type <code>gem install --remote erubis</code>.
|
202
|
-
<pre class="terminal">$ sudo gem install --remote erubis
|
203
|
-
</pre>
|
204
|
-
</li>
|
205
|
-
</ul>
|
206
|
-
<ul type="disc">
|
207
|
-
<li>Else install <a href="http://rubyforge.org/projects/erubis/">abstract</a> at first,
|
208
|
-
and download erubis_X.X.X.tar.bz2 and install it by setup.rb.
|
209
|
-
<pre class="terminal">$ tar xjf abstract_X.X.X.tar.bz2
|
210
|
-
$ cd abstract_X.X.X/
|
211
|
-
$ sudo ruby setup.rb
|
212
|
-
$ cd ..
|
213
|
-
$ tar xjf erubis_X.X.X.tar.bz2
|
214
|
-
$ cd erubis_X.X.X/
|
215
|
-
$ sudo ruby setup.rb
|
216
|
-
</pre>
|
217
|
-
</li>
|
218
|
-
</ul>
|
219
|
-
<ul type="disc">
|
220
|
-
<li>(Optional) 'contrib/inline-require' enables you to merge 'lib/**/*.rb' into 'bin/erubis'.
|
221
|
-
<pre class="terminal">$ tar xjf erubis_X.X.X.tar.bz2
|
222
|
-
$ cd erubis_X.X.X/
|
223
|
-
$ unset RUBYLIB
|
224
|
-
$ contrib/inline-require -I lib bin/erubis > contrib/erubis
|
225
|
-
</pre>
|
226
|
-
</li>
|
227
|
-
</ul>
|
228
|
-
<br>
|
229
|
-
|
230
|
-
|
231
|
-
<a name="tutorial"></a>
|
232
|
-
<h2 class="section1">Tutorial</h2>
|
233
|
-
<a name="tut-basic"></a>
|
234
|
-
<h3 class="section2">Basic Example</h3>
|
235
|
-
<p>Here is a basic example of Erubis.
|
236
|
-
</p>
|
237
|
-
<a name="example1.eruby"></a>
|
238
|
-
<div class="program_caption">
|
239
|
-
example1.eruby</div>
|
240
|
-
<pre class="program"><ul>
|
241
|
-
<strong><% for item in list %></strong>
|
242
|
-
<li><strong><%= item %></strong></li>
|
243
|
-
<strong><% end %></strong>
|
244
|
-
<strong><%# here is ignored because starting with '#' %></strong>
|
245
|
-
</ul>
|
246
|
-
</pre>
|
247
|
-
<a name="example1.rb"></a>
|
248
|
-
<div class="program_caption">
|
249
|
-
example1.rb</div>
|
250
|
-
<pre class="program">require 'erubis'
|
251
|
-
input = File.read('example1.eruby')
|
252
|
-
eruby = <strong>Erubis::Eruby.new(input)</strong> # create Eruby object
|
253
|
-
|
254
|
-
puts "---------- script source ---"
|
255
|
-
puts <strong>eruby.src</strong> # print script source
|
256
|
-
|
257
|
-
puts "---------- result ----------"
|
258
|
-
list = ['aaa', 'bbb', 'ccc']
|
259
|
-
puts <strong>eruby.result(binding())</strong> # get result
|
260
|
-
## or puts eruby.result(<strong>:list=>list</strong>) # or pass Hash instead of Binding
|
261
|
-
|
262
|
-
## # or
|
263
|
-
## eruby = Erubis::Eruby.new
|
264
|
-
## input = File.read('example1.eruby')
|
265
|
-
## src = eruby.convert(input)
|
266
|
-
## eval src
|
267
|
-
</pre>
|
268
|
-
<a name="example1.result"></a>
|
269
|
-
<div class="terminal_caption">
|
270
|
-
output</div>
|
271
|
-
<pre class="terminal">$ ruby example1.rb
|
272
|
-
---------- script source ---
|
273
|
-
_buf = ''; _buf << '<ul>
|
274
|
-
'; for item in list
|
275
|
-
_buf << ' <li>'; _buf << ( item ).to_s; _buf << '</li>
|
276
|
-
'; end
|
277
|
-
|
278
|
-
_buf << '</ul>
|
279
|
-
';
|
280
|
-
_buf.to_s
|
281
|
-
---------- result ----------
|
282
|
-
<ul>
|
283
|
-
<li>aaa</li>
|
284
|
-
<li>bbb</li>
|
285
|
-
<li>ccc</li>
|
286
|
-
</ul>
|
287
|
-
</pre>
|
288
|
-
<p>Erubis has command 'erubis'. Command-line option '-x' shows the compiled source code of eRuby script.
|
289
|
-
</p>
|
290
|
-
<a name="example1_x.result"></a>
|
291
|
-
<div class="terminal_caption">
|
292
|
-
example of command-line option '-x'</div>
|
293
|
-
<pre class="terminal">$ erubis <strong>-x</strong> example1.eruby
|
294
|
-
_buf = ''; _buf << '<ul>
|
295
|
-
'; for item in list
|
296
|
-
_buf << ' <li>'; _buf << ( item ).to_s; _buf << '</li>
|
297
|
-
'; end
|
298
|
-
|
299
|
-
_buf << '</ul>
|
300
|
-
';
|
301
|
-
_buf.to_s
|
302
|
-
</pre>
|
303
|
-
<br>
|
304
|
-
|
305
|
-
|
306
|
-
<a name="tut-trim"></a>
|
307
|
-
<h3 class="section2">Trimming Spaces</h3>
|
308
|
-
<p>Erubis deletes spaces around '<% %>' automatically, while it leaves spaces around '<%= %>'.
|
309
|
-
</p>
|
310
|
-
<a name="example2.eruby.comment_filter"></a>
|
311
|
-
<div class="program_caption">
|
312
|
-
example2.eruby</div>
|
313
|
-
<pre class="program"><ul>
|
314
|
-
<% for item in list %> # trimmed
|
315
|
-
<li>
|
316
|
-
<%= item %> # not trimmed
|
317
|
-
</li>
|
318
|
-
<% end %> # trimmed
|
319
|
-
</ul>
|
320
|
-
</pre>
|
321
|
-
<a name="example2_x.result"></a>
|
322
|
-
<div class="terminal_caption">
|
323
|
-
compiled source code</div>
|
324
|
-
<pre class="terminal">$ erubis -x example2.eruby
|
325
|
-
_buf = ''; _buf << '<ul>
|
326
|
-
'; for item in list
|
327
|
-
_buf << ' <li>
|
328
|
-
'; _buf << ( item ).to_s; _buf << '
|
329
|
-
'; _buf << ' </li>
|
330
|
-
'; end
|
331
|
-
_buf << '</ul>
|
332
|
-
';
|
333
|
-
_buf.to_s
|
334
|
-
</pre>
|
335
|
-
<p>If you want leave spaces around '<% %>', add command-line property '--trim=false'.
|
336
|
-
</p>
|
337
|
-
<a name="example2_trim.result"></a>
|
338
|
-
<div class="terminal_caption">
|
339
|
-
compiled source code with command-line property '--trim=false'</div>
|
340
|
-
<pre class="terminal">$ erubis -x <strong>--trim=false</strong> example2.eruby
|
341
|
-
_buf = ''; _buf << '<ul>
|
342
|
-
'; _buf << ' '; for item in list ; _buf << '
|
343
|
-
'; _buf << ' <li>
|
344
|
-
'; _buf << ( item ).to_s; _buf << '
|
345
|
-
'; _buf << ' </li>
|
346
|
-
'; _buf << ' '; end ; _buf << '
|
347
|
-
'; _buf << '</ul>
|
348
|
-
';
|
349
|
-
_buf.to_s
|
350
|
-
</pre>
|
351
|
-
<p>Or add option <code>:trim=>false</code> to Erubis::Eruby.new().
|
352
|
-
</p>
|
353
|
-
<a name="example2.rb"></a>
|
354
|
-
<div class="program_caption">
|
355
|
-
example2.rb</div>
|
356
|
-
<pre class="program">require 'erubis'
|
357
|
-
input = File.read('example2.eruby')
|
358
|
-
eruby = Erubis::Eruby.new(input<strong>, :trim=>false</strong>)
|
359
|
-
|
360
|
-
puts "----- script source ---"
|
361
|
-
puts eruby.src # print script source
|
362
|
-
|
363
|
-
puts "----- result ----------"
|
364
|
-
list = ['aaa', 'bbb', 'ccc']
|
365
|
-
puts eruby.result(binding()) # get result
|
366
|
-
</pre>
|
367
|
-
<a name="example2.result"></a>
|
368
|
-
<div class="terminal_caption">
|
369
|
-
output</div>
|
370
|
-
<pre class="terminal">$ ruby example2.rb
|
371
|
-
----- script source ---
|
372
|
-
_buf = ''; _buf << '<ul>
|
373
|
-
'; <strong>_buf << ' ';</strong> for item in list ; _buf << '
|
374
|
-
'; _buf << ' <li>
|
375
|
-
'; _buf << ( item ).to_s; _buf << '
|
376
|
-
'; _buf << ' </li>
|
377
|
-
'; <strong>_buf << ' ';</strong> end ; _buf << '
|
378
|
-
'; _buf << '</ul>
|
379
|
-
';
|
380
|
-
_buf.to_s
|
381
|
-
----- result ----------
|
382
|
-
<ul>
|
383
|
-
|
384
|
-
<li>
|
385
|
-
aaa
|
386
|
-
</li>
|
387
|
-
|
388
|
-
<li>
|
389
|
-
bbb
|
390
|
-
</li>
|
391
|
-
|
392
|
-
<li>
|
393
|
-
ccc
|
394
|
-
</li>
|
395
|
-
|
396
|
-
</ul>
|
397
|
-
</pre>
|
398
|
-
<br>
|
399
|
-
|
400
|
-
|
401
|
-
<a name="tut-escape"></a>
|
402
|
-
<h3 class="section2">Escape</h3>
|
403
|
-
<p>Erubis has ability to escape (sanitize) expression.
|
404
|
-
Erubis::Eruby class act as the following:
|
405
|
-
</p>
|
406
|
-
<ul type="disc">
|
407
|
-
<li><code><%= <em>expr</em> %></code> - not escaped.
|
408
|
-
</li>
|
409
|
-
<li><code><%== <em>expr</em> %></code> - escaped.
|
410
|
-
</li>
|
411
|
-
<li><code><%=== <em>expr</em> %></code> - out to $stderr.
|
412
|
-
</li>
|
413
|
-
<li><code><%==== <em>expr</em> %></code> - ignored.
|
414
|
-
</li>
|
415
|
-
</ul>
|
416
|
-
<p>Erubis::EscapedEruby<sup>(<a href="#fnref:1" name="fnlink:1">*1</a>)</sup> class handle '<%= %>' as escaped and '<%== %>' as not escaped.
|
417
|
-
It means that using Erubis::EscapedEruby you can escape expression by default.
|
418
|
-
Also Erubis::XmlEruby class (which is equivalent to Erubis::EscapedEruby) is provided for compatibility with Erubis 1.1.
|
419
|
-
</p>
|
420
|
-
<a name="example3.eruby"></a>
|
421
|
-
<div class="program_caption">
|
422
|
-
example3.eruby</div>
|
423
|
-
<pre class="program"><% for item in list %>
|
424
|
-
<p><strong><%=</strong> item <strong>%></strong></p>
|
425
|
-
<p><strong><%==</strong> item <strong>%></strong></p>
|
426
|
-
<p><strong><%===</strong> item <strong>%></strong></p>
|
427
|
-
|
428
|
-
<% end %>
|
429
|
-
</pre>
|
430
|
-
<a name="example3.rb"></a>
|
431
|
-
<div class="program_caption">
|
432
|
-
example3.rb</div>
|
433
|
-
<pre class="program">require 'erubis'
|
434
|
-
input = File.read('example3.eruby')
|
435
|
-
eruby = Erubis::<strong>EscapedEruby</strong>.new(input) # or Erubis::XmlEruby
|
436
|
-
|
437
|
-
puts "----- script source ---"
|
438
|
-
puts eruby.src # print script source
|
439
|
-
|
440
|
-
puts "----- result ----------"
|
441
|
-
<strong>list = ['<aaa>', 'b&b', '"ccc"']</strong>
|
442
|
-
puts eruby.result(binding()) # get result
|
443
|
-
</pre>
|
444
|
-
<a name="example3.result.split_filter"></a>
|
445
|
-
<div class="terminal_caption">
|
446
|
-
output</div>
|
447
|
-
<pre class="terminal">$ ruby example3.rb 2> stderr.log
|
448
|
-
----- script source ---
|
449
|
-
_buf = ''; for item in list
|
450
|
-
_buf << ' <p>'; <strong>_buf << Erubis::XmlHelper.escape_xml( item )</strong>; _buf << '</p>
|
451
|
-
<p>'; <strong>_buf << ( item ).to_s</strong>; _buf << '</p>
|
452
|
-
<p>'; <strong>$stderr.puts("*** debug: item=#{(item).inspect}")</strong>; _buf << '</p>
|
453
|
-
|
454
|
-
'; end
|
455
|
-
_buf.to_s
|
456
|
-
----- result ----------
|
457
|
-
<p><strong>&lt;aaa&gt;</strong></p>
|
458
|
-
<p><aaa></p>
|
459
|
-
<p></p>
|
460
|
-
|
461
|
-
<p><strong>b&amp;b</strong></p>
|
462
|
-
<p>b&b</p>
|
463
|
-
<p></p>
|
464
|
-
|
465
|
-
<p><strong>&quot;ccc&quot;</strong></p>
|
466
|
-
<p>"ccc"</p>
|
467
|
-
<p></p>
|
468
|
-
|
469
|
-
$ cat stderr.log
|
470
|
-
*** debug: item="<aaa>"
|
471
|
-
*** debug: item="b&b"
|
472
|
-
*** debug: item="\"ccc\""
|
473
|
-
</pre>
|
474
|
-
<p>The command-line option '-e' will do the same action as Erubis::EscapedEruby.
|
475
|
-
This option is available for any language.
|
476
|
-
</p>
|
477
|
-
<a name="example3_e.result"></a>
|
478
|
-
<pre class="terminal">$ erubis -l ruby <strong>-e</strong> example3.eruby
|
479
|
-
_buf = ''; for item in list
|
480
|
-
_buf << ' <p>'; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</p>
|
481
|
-
<p>'; _buf << ( item ).to_s; _buf << '</p>
|
482
|
-
<p>'; $stderr.puts("*** debug: item=#{(item).inspect}"); _buf << '</p>
|
483
|
-
|
484
|
-
'; end
|
485
|
-
_buf.to_s
|
486
|
-
</pre>
|
487
|
-
<p>Escaping function (default 'Erubis::XmlHelper.escape_xml()') can be changed by command-line property '--escapefunc=xxx' or by overriding Erubis::Eruby#escaped_expr() in subclass.
|
488
|
-
</p>
|
489
|
-
<div class="program_caption">
|
490
|
-
example to override Erubis::Eruby#escaped_expr()</div>
|
491
|
-
<pre class="program">class CGIEruby < Erubis::Eruby
|
492
|
-
def <strong>escaped_expr(code)</strong>
|
493
|
-
return "CGI.escapeHTML((#{code.strip}).to_s)"
|
494
|
-
#return "h(#{code.strip})"
|
495
|
-
end
|
496
|
-
end
|
497
|
-
|
498
|
-
class LatexEruby < Erubi::Eruby
|
499
|
-
def <strong>escaped_expr(code)</strong>
|
500
|
-
return "(#{code}).gsub(/[%\\]/,'\\\\\&')"
|
501
|
-
end
|
502
|
-
end
|
503
|
-
</pre>
|
504
|
-
<div class="footnote">
|
505
|
-
<dl compact>
|
506
|
-
<dt>(<a name="fnref:1" href="#fnlink:1">*1</a>)</dt>
|
507
|
-
<dd>Erubis::EscapedEruby class includes Erubis::EscapeEnhancer which swtches the action of '<%= %>' and '<%== %>'.</dd>
|
508
|
-
</dl>
|
509
|
-
</div>
|
510
|
-
<br>
|
511
|
-
|
512
|
-
|
513
|
-
<a name="tut-pattern"></a>
|
514
|
-
<h3 class="section2">Embedded Pattern</h3>
|
515
|
-
<p>You can change embedded pattern '<code><% %></code>' to another by command-line option '-p' or option '<code>:pattern=>...</code>' of Erubis::Eruby.new().
|
516
|
-
</p>
|
517
|
-
<a name="example4.eruby"></a>
|
518
|
-
<div class="program_caption">
|
519
|
-
example4.eruby</div>
|
520
|
-
<pre class="program"><strong><!--%</strong> for item in list <strong>%--></strong>
|
521
|
-
<p><strong><!--%=</strong> item <strong>%--></strong></p>
|
522
|
-
<strong><!--%</strong> end <strong>%--></strong>
|
523
|
-
</pre>
|
524
|
-
<a name="example4_x.result"></a>
|
525
|
-
<div class="terminal_caption">
|
526
|
-
compiled source code with command-line option '-p'</div>
|
527
|
-
<pre class="terminal">$ erubis -x <strong>-p '<!--% %-->'</strong> example4.eruby
|
528
|
-
_buf = ''; for item in list
|
529
|
-
_buf << ' <p>'; _buf << ( item ).to_s; _buf << '</p>
|
530
|
-
'; end
|
531
|
-
_buf.to_s
|
532
|
-
</pre>
|
533
|
-
<a name="example4.rb"></a>
|
534
|
-
<div class="program_caption">
|
535
|
-
example4.rb</div>
|
536
|
-
<pre class="program">require 'erubis'
|
537
|
-
input = File.read('example4.eruby')
|
538
|
-
eruby = Erubis::Eruby.new(input<strong>, :pattern=>'<!--% %-->'</strong>)
|
539
|
-
# or '<(?:!--)?% %(?:--)?>'
|
540
|
-
|
541
|
-
puts "---------- script source ---"
|
542
|
-
puts eruby.src # print script source
|
543
|
-
|
544
|
-
puts "---------- result ----------"
|
545
|
-
list = ['aaa', 'bbb', 'ccc']
|
546
|
-
puts eruby.result(binding()) # get result
|
547
|
-
</pre>
|
548
|
-
<a name="example4.result"></a>
|
549
|
-
<div class="terminal_caption">
|
550
|
-
output</div>
|
551
|
-
<pre class="terminal">$ ruby example4.rb
|
552
|
-
---------- script source ---
|
553
|
-
_buf = ''; for item in list
|
554
|
-
_buf << ' <p>'; _buf << ( item ).to_s; _buf << '</p>
|
555
|
-
'; end
|
556
|
-
_buf.to_s
|
557
|
-
---------- result ----------
|
558
|
-
<p>aaa</p>
|
559
|
-
<p>bbb</p>
|
560
|
-
<p>ccc</p>
|
561
|
-
</pre>
|
562
|
-
<p>It is able to specify regular expression with :pattern option.
|
563
|
-
Notice that you must use '<code>(?: )</code>' instead of '<code>( )</code>' for grouping.
|
564
|
-
For example, '<code><(!--)?% %(--)?></code>' will not work while '<code><(?:!--)?% %(?:--)?></code>' will work.
|
565
|
-
</p>
|
566
|
-
<br>
|
567
|
-
|
568
|
-
|
569
|
-
<a name="tut-context"></a>
|
570
|
-
<h3 class="section2">Context Object</h3>
|
571
|
-
<p>Context object is a set of data which are used in eRuby script.
|
572
|
-
Using context object makes clear which data to be used.
|
573
|
-
In Erubis, Hash object and Erubis::Context object are available as context object.
|
574
|
-
</p>
|
575
|
-
<p>Context data can be accessible via instance variables in eRuby script.
|
576
|
-
</p>
|
577
|
-
<a name="example5.eruby"></a>
|
578
|
-
<div class="program_caption">
|
579
|
-
example5.eruby</div>
|
580
|
-
<pre class="program"><span><%= <strong>@val</strong> %></span>
|
581
|
-
<ul>
|
582
|
-
<% for item in <strong>@list</strong> %>
|
583
|
-
<li><%= item %></li>
|
584
|
-
<% end %>
|
585
|
-
</ul>
|
586
|
-
</pre>
|
587
|
-
<a name="example5.rb"></a>
|
588
|
-
<div class="program_caption">
|
589
|
-
example5.rb</div>
|
590
|
-
<pre class="program">require 'erubis'
|
591
|
-
input = File.read('example5.eruby')
|
592
|
-
eruby = Erubis::Eruby.new(input) # create Eruby object
|
593
|
-
|
594
|
-
## create context object
|
595
|
-
## (key means var name, which may be string or symbol.)
|
596
|
-
<strong>context = {
|
597
|
-
:val => 'Erubis Example',
|
598
|
-
'list' => ['aaa', 'bbb', 'ccc'],
|
599
|
-
}</strong>
|
600
|
-
## or
|
601
|
-
# context = Erubis::Context.new()
|
602
|
-
# context['val'] = 'Erubis Example'
|
603
|
-
# context[:list] = ['aaa', 'bbb', 'ccc'],
|
604
|
-
|
605
|
-
puts <strong>eruby.evaluate(context)</strong> # get result
|
606
|
-
</pre>
|
607
|
-
<a name="example5.result"></a>
|
608
|
-
<div class="terminal_caption">
|
609
|
-
output</div>
|
610
|
-
<pre class="terminal">$ ruby example5.rb
|
611
|
-
<span>Erubis Example</span>
|
612
|
-
<ul>
|
613
|
-
<li>aaa</li>
|
614
|
-
<li>bbb</li>
|
615
|
-
<li>ccc</li>
|
616
|
-
</ul>
|
617
|
-
</pre>
|
618
|
-
<p>The difference between Erubis#result(binding) and Erubis#evaluate(context) is that the former invokes 'eval @src, binding' and the latter invokes 'context.instance_eval @src'.
|
619
|
-
This means that data is passed into eRuby script via local variables when Eruby::binding() is called, or passed via instance variables when Eruby::evaluate() is called.
|
620
|
-
</p>
|
621
|
-
<p>Here is the definition of Erubis#result() and Erubis#evaluate().
|
622
|
-
</p>
|
623
|
-
<div class="program_caption">
|
624
|
-
definition of result(binding) and evaluate(context)</div>
|
625
|
-
<pre class="program">def result(_binding=TOPLEVEL_BINDING)
|
626
|
-
if _binding.is_a?(Hash)
|
627
|
-
# load hash data as local variable
|
628
|
-
_h = _binding
|
629
|
-
_binding = binding()
|
630
|
-
eval _h.collect{|k,v| "#{k} = _h[#{k.inspect}];"}.join, _binding
|
631
|
-
end
|
632
|
-
return <strong>eval(@src, _binding)</strong>
|
633
|
-
end
|
634
|
-
|
635
|
-
def evaluate(_context=Erubis::Context.new)
|
636
|
-
if _context.is_a?(Hash)
|
637
|
-
# convert hash object to Context object
|
638
|
-
_hash = _context
|
639
|
-
_context = Erubis::Context.new
|
640
|
-
_hash.each {|k, v| _context[k] = v }
|
641
|
-
end
|
642
|
-
return <strong>_context.instance_eval(@src)</strong>
|
643
|
-
end
|
644
|
-
</pre>
|
645
|
-
<p>instance_eval() is defined at Object class so it is able to use any object as a context object as well as Hash or Erubis::Context.
|
646
|
-
</p>
|
647
|
-
<a name="example6.rb"></a>
|
648
|
-
<div class="program_caption">
|
649
|
-
example6.rb</div>
|
650
|
-
<pre class="program">class MyData
|
651
|
-
attr_accessor :val, :list
|
652
|
-
end
|
653
|
-
|
654
|
-
## any object can be a context object
|
655
|
-
<strong>mydata = MyData.new</strong>
|
656
|
-
<strong>mydata.val = 'Erubis Example'</strong>
|
657
|
-
<strong>mydata.list = ['aaa', 'bbb', 'ccc']</strong>
|
658
|
-
|
659
|
-
require 'erubis'
|
660
|
-
eruby = Erubis::Eruby.new(File.read('example5.eruby'))
|
661
|
-
puts eruby.evaluate(<strong>mydata</strong>)
|
662
|
-
</pre>
|
663
|
-
<a name="example6.result"></a>
|
664
|
-
<div class="terminal_caption">
|
665
|
-
output</div>
|
666
|
-
<pre class="terminal">$ ruby example6.rb
|
667
|
-
<span>Erubis Example</span>
|
668
|
-
<ul>
|
669
|
-
<li>aaa</li>
|
670
|
-
<li>bbb</li>
|
671
|
-
<li>ccc</li>
|
672
|
-
</ul>
|
673
|
-
</pre>
|
674
|
-
<p>It is recommended to use 'Erubis::Eruby#evaluate(context)' rather than 'Erubis::Eruby#result(binding())' because the latter has some problems.
|
675
|
-
See <a href="#topics-context-vs-binding">evaluate(context) v.s. result(binding)</a> section for details.
|
676
|
-
</p>
|
677
|
-
<br>
|
678
|
-
|
679
|
-
|
680
|
-
<a name="tut-datafile"></a>
|
681
|
-
<h3 class="section2">Context Data File</h3>
|
682
|
-
<p>Command-line option '-f' specifies context data file.
|
683
|
-
Erubis load context data file and use it as context data.
|
684
|
-
Context data file can be YAML file ('*.yaml' or '*.yml') or Ruby script ('*.rb').
|
685
|
-
</p>
|
686
|
-
<a name="example7.eruby"></a>
|
687
|
-
<div class="program_caption">
|
688
|
-
example7.eruby</div>
|
689
|
-
<pre class="program"><h1><%= <strong>@title</strong> %></h1>
|
690
|
-
<ul>
|
691
|
-
<% for user in <strong>@users</strong> %>
|
692
|
-
<li>
|
693
|
-
<a href="mailto:<%= user['mail']%>"><%= user['name'] %></a>
|
694
|
-
</li>
|
695
|
-
<% end %>
|
696
|
-
</ul>
|
697
|
-
</pre>
|
698
|
-
<a name="context.yaml"></a>
|
699
|
-
<div class="program_caption">
|
700
|
-
context.yaml</div>
|
701
|
-
<pre class="program"><strong>title:</strong> Users List
|
702
|
-
<strong>users:</strong>
|
703
|
-
- name: foo
|
704
|
-
mail: foo@mail.com
|
705
|
-
- name: bar
|
706
|
-
mail: bar@mail.net
|
707
|
-
- name: baz
|
708
|
-
mail: baz@mail.org
|
709
|
-
</pre>
|
710
|
-
<a name="context.rb"></a>
|
711
|
-
<div class="program_caption">
|
712
|
-
context.rb</div>
|
713
|
-
<pre class="program">@title = 'Users List'
|
714
|
-
@users = [
|
715
|
-
{ 'name'=>'foo', 'mail'=>'foo@mail.com' },
|
716
|
-
{ 'name'=>'bar', 'mail'=>'bar@mail.net' },
|
717
|
-
{ 'name'=>'baz', 'mail'=>'baz@mail.org' },
|
718
|
-
]
|
719
|
-
</pre>
|
720
|
-
<a name="example7.result.split_filter"></a>
|
721
|
-
<div class="terminal_caption">
|
722
|
-
example of command-line option '-f'</div>
|
723
|
-
<pre class="terminal">$ erubis <strong>-f context.yaml</strong> example7.eruby
|
724
|
-
<h1>Users List</h1>
|
725
|
-
<ul>
|
726
|
-
<li>
|
727
|
-
<a href="mailto:foo@mail.com">foo</a>
|
728
|
-
</li>
|
729
|
-
<li>
|
730
|
-
<a href="mailto:bar@mail.net">bar</a>
|
731
|
-
</li>
|
732
|
-
<li>
|
733
|
-
<a href="mailto:baz@mail.org">baz</a>
|
734
|
-
</li>
|
735
|
-
</ul>
|
736
|
-
$ erubis <strong>-f context.rb</strong> example7.eruby
|
737
|
-
<h1>Users List</h1>
|
738
|
-
<ul>
|
739
|
-
<li>
|
740
|
-
<a href="mailto:foo@mail.com">foo</a>
|
741
|
-
</li>
|
742
|
-
<li>
|
743
|
-
<a href="mailto:bar@mail.net">bar</a>
|
744
|
-
</li>
|
745
|
-
<li>
|
746
|
-
<a href="mailto:baz@mail.org">baz</a>
|
747
|
-
</li>
|
748
|
-
</ul>
|
749
|
-
</pre>
|
750
|
-
<p>Command-line option '-S' converts keys of mapping in YAML data file from string into symbol.
|
751
|
-
Command-line option '-B' invokes 'Erubis::Eruby#result(binding())' instead of 'Erubis::Eruby#evaluate(context)'.
|
752
|
-
</p>
|
753
|
-
<br>
|
754
|
-
|
755
|
-
|
756
|
-
<a name="tut-datastr"></a>
|
757
|
-
<h3 class="section2">Context Data String</h3>
|
758
|
-
<p>Command-line option '-c <em>str</em>' enables you to specify context data in command-line.
|
759
|
-
<em>str</em> can be YAML flow-style or Ruby code.
|
760
|
-
</p>
|
761
|
-
<a name="example8.eruby"></a>
|
762
|
-
<div class="program_caption">
|
763
|
-
example8.eruby</div>
|
764
|
-
<pre class="program"><h1><%= @title %></h1>
|
765
|
-
<ul>
|
766
|
-
<% for item in @list %>
|
767
|
-
<li><%= item %></li>
|
768
|
-
<% end %>
|
769
|
-
</ul>
|
770
|
-
</pre>
|
771
|
-
<a name="example8_yaml.result"></a>
|
772
|
-
<div class="terminal_caption">
|
773
|
-
example of YAML flow style</div>
|
774
|
-
<pre class="terminal">$ erubis <strong>-c '{title: Example, list: [AAA, BBB, CCC]}'</strong> example8.eruby
|
775
|
-
<h1>Example</h1>
|
776
|
-
<ul>
|
777
|
-
<li>AAA</li>
|
778
|
-
<li>BBB</li>
|
779
|
-
<li>CCC</li>
|
780
|
-
</ul>
|
781
|
-
</pre>
|
782
|
-
<a name="example8_ruby.result"></a>
|
783
|
-
<div class="terminal_caption">
|
784
|
-
example of Ruby code</div>
|
785
|
-
<pre class="terminal">$ erubis <strong>-c '@title="Example"; @list=%w[AAA BBB CCC]'</strong> example8.eruby
|
786
|
-
<h1>Example</h1>
|
787
|
-
<ul>
|
788
|
-
<li>AAA</li>
|
789
|
-
<li>BBB</li>
|
790
|
-
<li>CCC</li>
|
791
|
-
</ul>
|
792
|
-
</pre>
|
793
|
-
<br>
|
794
|
-
|
795
|
-
|
796
|
-
<a name="tut-preamble"></a>
|
797
|
-
<h3 class="section2">Preamble and Postamble</h3>
|
798
|
-
<p>The first line ('_buf = '';') in the compiled source code is called preamble
|
799
|
-
and the last line ('_buf.to_s') is called postamble.
|
800
|
-
</p>
|
801
|
-
<p>Command-line option '-b' skips the output of preamble and postamble.
|
802
|
-
</p>
|
803
|
-
<a name="example9.eruby"></a>
|
804
|
-
<div class="program_caption">
|
805
|
-
example9.eruby</div>
|
806
|
-
<pre class="program"><% for item in @list %>
|
807
|
-
<b><%= item %></b>
|
808
|
-
<% end %>
|
809
|
-
</pre>
|
810
|
-
<a name="example9.result.split_filter"></a>
|
811
|
-
<div class="terminal_caption">
|
812
|
-
compiled source code with and without command-line option '-b'</div>
|
813
|
-
<pre class="terminal">$ erubis -x example9.eruby
|
814
|
-
<strong>_buf = '';</strong> for item in @list
|
815
|
-
_buf << ' <b>'; _buf << ( item ).to_s; _buf << '</b>
|
816
|
-
'; end
|
817
|
-
<strong>_buf.to_s</strong>
|
818
|
-
$ erubis -x <strong>-b</strong> example9.eruby
|
819
|
-
for item in @list
|
820
|
-
_buf << ' <b>'; _buf << ( item ).to_s; _buf << '</b>
|
821
|
-
'; end
|
822
|
-
</pre>
|
823
|
-
<p>Erubis::Eruby.new option '<code>:preamble=>false</code>' and '<code>:postamble=>false</code>' also suppress output of preamble or postamle.
|
824
|
-
</p>
|
825
|
-
<a name="example9.rb"></a>
|
826
|
-
<div class="program_caption">
|
827
|
-
example9.rb</div>
|
828
|
-
<pre class="program">require 'erubis'
|
829
|
-
input = File.read('example9.eruby')
|
830
|
-
eruby1 = Erubis::Eruby.new(input)
|
831
|
-
eruby2 = Erubis::Eruby.new(input, <strong>:preamble=>false, :postamble=>false</strong>)
|
832
|
-
|
833
|
-
puts eruby1.src # print preamble and postamble
|
834
|
-
puts "--------------"
|
835
|
-
puts eruby2.src # don't print preamble and postamble
|
836
|
-
</pre>
|
837
|
-
<a name="example9.result"></a>
|
838
|
-
<div class="terminal_caption">
|
839
|
-
output</div>
|
840
|
-
<pre class="terminal">$ ruby example9.rb
|
841
|
-
_buf = ''; for item in @list
|
842
|
-
_buf << ' <b>'; _buf << ( item ).to_s; _buf << '</b>
|
843
|
-
'; end
|
844
|
-
_buf.to_s
|
845
|
-
--------------
|
846
|
-
for item in @list
|
847
|
-
_buf << ' <b>'; _buf << ( item ).to_s; _buf << '</b>
|
848
|
-
'; end
|
849
|
-
</pre>
|
850
|
-
<br>
|
851
|
-
|
852
|
-
|
853
|
-
<a name="tut-pi"></a>
|
854
|
-
<h3 class="section2">Processing Instruction (PI) Converter</h3>
|
855
|
-
<p>Erubis can parse Processing Instructions (PI) as embedded pattern.
|
856
|
-
</p>
|
857
|
-
<ul type="disc">
|
858
|
-
<li>'<code><?rb <em>...</em> ?></code>' represents Ruby statement.
|
859
|
-
</li>
|
860
|
-
<li>'<code>@{<em>...</em>}@</code>' represents escaped expression value.
|
861
|
-
</li>
|
862
|
-
<li>'<code>@!{<em>...</em>}@</code>' represents normal expression value.
|
863
|
-
</li>
|
864
|
-
<li>'<code>@!!{<em>...</em>}@</code>' prints expression value to standard output.
|
865
|
-
</li>
|
866
|
-
<li>(experimental) '<code><%= <em>...</em> %></code>' is also available to print expression value.
|
867
|
-
</li>
|
868
|
-
</ul>
|
869
|
-
<p>This is more useful than basic embedded pattern ('<code><% ... ></code>') because PI doesn't break XML or HTML at all.
|
870
|
-
For example the following XHTML file is well-formed and HTML validator got no errors on this example.
|
871
|
-
</p>
|
872
|
-
<a name="example10.xhtml"></a>
|
873
|
-
<div class="program_caption">
|
874
|
-
example10.xhtml</div>
|
875
|
-
<pre class="program"><?xml version="1.0" ?>
|
876
|
-
<strong><?rb
|
877
|
-
lang = 'en'
|
878
|
-
list = ['<aaa>', 'b&b', '"ccc"']
|
879
|
-
?></strong>
|
880
|
-
<html lang="<strong>@!{lang}@</strong>">
|
881
|
-
<body>
|
882
|
-
<ul>
|
883
|
-
<strong><?rb for item in list ?></strong>
|
884
|
-
<li><strong>@{item}@</strong></li>
|
885
|
-
<strong><?rb end ?></strong>
|
886
|
-
</ul>
|
887
|
-
</body>
|
888
|
-
</html>
|
889
|
-
</pre>
|
890
|
-
<p>If the command-line property '--pi=<em>name</em>' is specified, erubis command parses input with PI converter.
|
891
|
-
If <em>name</em> is omitted then the following name is used according to '-l <em>lang</em>'.
|
892
|
-
</p>
|
893
|
-
<div align="center">
|
894
|
-
<table class="table1" border="1" cellspacing="0">
|
895
|
-
<tr class="tr1">
|
896
|
-
<th class="th1">'-l' option</th>
|
897
|
-
<th class="th1">PI name</th>
|
898
|
-
</tr>
|
899
|
-
<tr class="tr1">
|
900
|
-
<td class="td1">-l ruby</td>
|
901
|
-
<td class="td1"><?rb ... ?></td>
|
902
|
-
</tr>
|
903
|
-
<tr class="tr1">
|
904
|
-
<td class="td1">-l php</td>
|
905
|
-
<td class="td1"><?php ... ?></td>
|
906
|
-
</tr>
|
907
|
-
<tr class="tr1">
|
908
|
-
<td class="td1">-l perl</td>
|
909
|
-
<td class="td1"><?perl ... ?></td>
|
910
|
-
</tr>
|
911
|
-
<tr class="tr1">
|
912
|
-
<td class="td1">-l java</td>
|
913
|
-
<td class="td1"><?java ... ?></td>
|
914
|
-
</tr>
|
915
|
-
<tr class="tr1">
|
916
|
-
<td class="td1">-l javascript</td>
|
917
|
-
<td class="td1"><?js ... ?></td>
|
918
|
-
</tr>
|
919
|
-
<tr class="tr1">
|
920
|
-
<td class="td1">-l scheme</td>
|
921
|
-
<td class="td1"><?scheme ... ?></td>
|
922
|
-
</tr>
|
923
|
-
</table>
|
924
|
-
</div>
|
925
|
-
<a name="example10_x.result"></a>
|
926
|
-
<div class="terminal_caption">
|
927
|
-
output</div>
|
928
|
-
<pre class="terminal">$ erubis -x <strong>--pi</strong> example10.xhtml
|
929
|
-
_buf = ''; _buf << '<?xml version="1.0" ?>
|
930
|
-
';
|
931
|
-
lang = 'en'
|
932
|
-
list = ['<aaa>', 'b&b', '"ccc"']
|
933
|
-
|
934
|
-
_buf << '<html lang="'; _buf << (lang).to_s; _buf << '">
|
935
|
-
<body>
|
936
|
-
<ul>
|
937
|
-
'; for item in list
|
938
|
-
_buf << ' <li>'; _buf << Erubis::XmlHelper.escape_xml(item); _buf << '</li>
|
939
|
-
'; end
|
940
|
-
_buf << ' </ul>
|
941
|
-
</body>
|
942
|
-
</html>
|
943
|
-
';
|
944
|
-
_buf.to_s
|
945
|
-
</pre>
|
946
|
-
<p>Expression character can be changeable by command-line property '--embchar=<em>char</em>. Default is '<code>@</code>'.
|
947
|
-
</p>
|
948
|
-
<p>Use Erubis::PI::Eruby instead of Erubis::Eruby if you want to use PI as embedded pattern.
|
949
|
-
</p>
|
950
|
-
<a name="example10.rb"></a>
|
951
|
-
<div class="program_caption">
|
952
|
-
example10.rb</div>
|
953
|
-
<pre class="program">require 'erubis'
|
954
|
-
input = File.read('example10.xhtml')
|
955
|
-
eruby = Erubis::PI::Eruby.new(input)
|
956
|
-
print eruby.src
|
957
|
-
</pre>
|
958
|
-
<a name="example10.result"></a>
|
959
|
-
<div class="terminal_caption">
|
960
|
-
output</div>
|
961
|
-
<pre class="terminal">$ ruby example10.rb
|
962
|
-
_buf = ''; _buf << '<?xml version="1.0" ?>
|
963
|
-
';
|
964
|
-
lang = 'en'
|
965
|
-
list = ['<aaa>', 'b&b', '"ccc"']
|
966
|
-
|
967
|
-
_buf << '<html lang="'; _buf << (lang).to_s; _buf << '">
|
968
|
-
<body>
|
969
|
-
<ul>
|
970
|
-
'; for item in list
|
971
|
-
_buf << ' <li>'; _buf << Erubis::XmlHelper.escape_xml(item); _buf << '</li>
|
972
|
-
'; end
|
973
|
-
_buf << ' </ul>
|
974
|
-
</body>
|
975
|
-
</html>
|
976
|
-
';
|
977
|
-
_buf.to_s
|
978
|
-
</pre>
|
979
|
-
<p><strong>(experimental)</strong> Erubis supports '<%= ... %>' pattern with PI pattern.
|
980
|
-
</p>
|
981
|
-
<div class="program_caption">
|
982
|
-
example of Rails view template</div>
|
983
|
-
<pre class="program"><table>
|
984
|
-
<tr>
|
985
|
-
<?rb for item in @list ?>
|
986
|
-
<td>@{item.id}@</td>
|
987
|
-
<td>@{item.name}@</td>
|
988
|
-
<td>
|
989
|
-
<strong><%=</strong> link_to 'Destroy', {:action=>'destroy', :id=>item.id},
|
990
|
-
:confirm=>'Are you OK?' <strong>%></strong>
|
991
|
-
</td>
|
992
|
-
<?rb end ?>
|
993
|
-
</tr>
|
994
|
-
</table>
|
995
|
-
</pre>
|
996
|
-
<br>
|
997
|
-
|
998
|
-
|
999
|
-
<a name="tut-notext"></a>
|
1000
|
-
<h3 class="section2">Retrieve Ruby Code</h3>
|
1001
|
-
<p>Similar to '-x', ommand-line option '-X' shows converted Ruby source code.
|
1002
|
-
The difference between '-x' and 'X' is that the former converts text part but the latter ignores it.
|
1003
|
-
It means that you can retrieve Ruby code from eRuby script by '-X' option.
|
1004
|
-
</p>
|
1005
|
-
<p>For example, see the following eRuby script.
|
1006
|
-
This is some complex, so it is difficult to grasp the program code.
|
1007
|
-
</p>
|
1008
|
-
<a name="example11.rhtml"></a>
|
1009
|
-
<div class="program_caption">
|
1010
|
-
example11.rhtml</div>
|
1011
|
-
<pre class="program"><?xml version="1.0" encoding="UTF-8"?>
|
1012
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
1013
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
1014
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
1015
|
-
<body>
|
1016
|
-
<h3>List</h3>
|
1017
|
-
<% if @list.nil? || @list.empty? %>
|
1018
|
-
<p>not found.</p>
|
1019
|
-
<% else %>
|
1020
|
-
<table>
|
1021
|
-
<tbody>
|
1022
|
-
<% @list.each_with_index do |item, i| %>
|
1023
|
-
<tr bgcolor="<%= i % 2 == 0 ? '#FCC' : '#CCF' %>">
|
1024
|
-
<td><%= item %></td>
|
1025
|
-
</tr>
|
1026
|
-
<% end %>
|
1027
|
-
</tbody>
|
1028
|
-
</table>
|
1029
|
-
<% end %>
|
1030
|
-
</body>
|
1031
|
-
</html>
|
1032
|
-
</pre>
|
1033
|
-
<p>Command-line option '-X' extracts only the ruby code from eRuby script.
|
1034
|
-
</p>
|
1035
|
-
<a name="example11.result"></a>
|
1036
|
-
<div class="terminal_caption">
|
1037
|
-
result</div>
|
1038
|
-
<pre class="terminal">$ erubis <strong>-X</strong> example11.rhtml
|
1039
|
-
_buf = '';
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
if @list.nil? || @list.empty?
|
1046
|
-
|
1047
|
-
else
|
1048
|
-
|
1049
|
-
|
1050
|
-
@list.each_with_index do |item, i|
|
1051
|
-
_buf << ( i % 2 == 0 ? '#FCC' : '#CCF' ).to_s;
|
1052
|
-
_buf << ( item ).to_s;
|
1053
|
-
|
1054
|
-
end
|
1055
|
-
|
1056
|
-
|
1057
|
-
end
|
1058
|
-
|
1059
|
-
|
1060
|
-
_buf.to_s
|
1061
|
-
</pre>
|
1062
|
-
<p>Command-line option '-C' (<strong>c</strong>mpact) deletes empty lines.
|
1063
|
-
</p>
|
1064
|
-
<a name="example11_C.result"></a>
|
1065
|
-
<div class="terminal_caption">
|
1066
|
-
result</div>
|
1067
|
-
<pre class="terminal">$ erubis <strong>-XC</strong> example11.rhtml
|
1068
|
-
_buf = '';
|
1069
|
-
if @list.nil? || @list.empty?
|
1070
|
-
else
|
1071
|
-
@list.each_with_index do |item, i|
|
1072
|
-
_buf << ( i % 2 == 0 ? '#FCC' : '#CCF' ).to_s;
|
1073
|
-
_buf << ( item ).to_s;
|
1074
|
-
end
|
1075
|
-
end
|
1076
|
-
_buf.to_s
|
1077
|
-
</pre>
|
1078
|
-
<p>Option '-U' (<strong>u</strong>nique) converts empty lines into a line.
|
1079
|
-
</p>
|
1080
|
-
<a name="example11_U.result"></a>
|
1081
|
-
<div class="terminal_caption">
|
1082
|
-
result</div>
|
1083
|
-
<pre class="terminal">$ erubis <strong>-XU</strong> example11.rhtml
|
1084
|
-
_buf = '';
|
1085
|
-
|
1086
|
-
if @list.nil? || @list.empty?
|
1087
|
-
|
1088
|
-
else
|
1089
|
-
|
1090
|
-
@list.each_with_index do |item, i|
|
1091
|
-
_buf << ( i % 2 == 0 ? '#FCC' : '#CCF' ).to_s;
|
1092
|
-
_buf << ( item ).to_s;
|
1093
|
-
|
1094
|
-
end
|
1095
|
-
|
1096
|
-
end
|
1097
|
-
|
1098
|
-
_buf.to_s
|
1099
|
-
</pre>
|
1100
|
-
<p>Option '-N' (<strong>n</strong>umber) adds line number.
|
1101
|
-
It is available with '-C' or '-U'.
|
1102
|
-
</p>
|
1103
|
-
<a name="example11_N.result"></a>
|
1104
|
-
<div class="terminal_caption">
|
1105
|
-
result</div>
|
1106
|
-
<pre class="terminal">$ erubis <strong>-XNU</strong> example11.rhtml
|
1107
|
-
1: _buf = '';
|
1108
|
-
|
1109
|
-
7: if @list.nil? || @list.empty?
|
1110
|
-
|
1111
|
-
9: else
|
1112
|
-
|
1113
|
-
12: @list.each_with_index do |item, i|
|
1114
|
-
13: _buf << ( i % 2 == 0 ? '#FCC' : '#CCF' ).to_s;
|
1115
|
-
14: _buf << ( item ).to_s;
|
1116
|
-
|
1117
|
-
16: end
|
1118
|
-
|
1119
|
-
19: end
|
1120
|
-
|
1121
|
-
22: _buf.to_s
|
1122
|
-
</pre>
|
1123
|
-
<p>Command-line option '-X' is available with PHP script.
|
1124
|
-
</p>
|
1125
|
-
<a name="example11.php"></a>
|
1126
|
-
<div class="program_caption">
|
1127
|
-
example11.php</div>
|
1128
|
-
<pre class="program"><?xml version="1.0"?>
|
1129
|
-
<html>
|
1130
|
-
<body>
|
1131
|
-
<h3>List</h3>
|
1132
|
-
<?php if (!$list) { ?>
|
1133
|
-
<p>not found.</p>
|
1134
|
-
<?php } else { ?>
|
1135
|
-
<table>
|
1136
|
-
<tbody>
|
1137
|
-
<?php $i = 0; ?>
|
1138
|
-
<?php foreach ($list as $item) { ?>
|
1139
|
-
<tr bgcolor="<?php echo ++$i % 2 == 1 ? '#FCC' : '#CCF'; ?>">
|
1140
|
-
<td><?php echo $item; ?></td>
|
1141
|
-
</tr>
|
1142
|
-
<?php } ?>
|
1143
|
-
</tbody>
|
1144
|
-
</table>
|
1145
|
-
<?php } ?>
|
1146
|
-
</body>
|
1147
|
-
</html>
|
1148
|
-
</pre>
|
1149
|
-
<a name="example11_php.result"></a>
|
1150
|
-
<div class="terminal_caption">
|
1151
|
-
result</div>
|
1152
|
-
<pre class="terminal">$ erubis -XNU <strong>-l php</strong> <strong>--pi=php</strong> --trim=false example11.php
|
1153
|
-
|
1154
|
-
5: <?php if (!$list) { ?>
|
1155
|
-
|
1156
|
-
7: <?php } else { ?>
|
1157
|
-
|
1158
|
-
10: <?php $i = 0; ?>
|
1159
|
-
11: <?php foreach ($list as $item) { ?>
|
1160
|
-
12: <?php echo ++$i % 2 == 1 ? '#FCC' : '#CCF'; ?>
|
1161
|
-
13: <?php echo $item; ?>
|
1162
|
-
|
1163
|
-
15: <?php } ?>
|
1164
|
-
|
1165
|
-
18: <?php } ?>
|
1166
|
-
|
1167
|
-
</pre>
|
1168
|
-
<br>
|
1169
|
-
|
1170
|
-
|
1171
|
-
<br>
|
1172
|
-
|
1173
|
-
|
1174
|
-
<a name="enhancer"></a>
|
1175
|
-
<h2 class="section1">Enhancer</h2>
|
1176
|
-
<p>Enhancer is a module to add a certain feature into Erubis::Eruby class.
|
1177
|
-
Enhancer may be language-independent or only for Erubis::Eruby class.
|
1178
|
-
</p>
|
1179
|
-
<p>To use enhancers, define subclass and include them.
|
1180
|
-
The folloing is an example to use <a href="#escape-enhancer">EscapeEnhancer</a>, <a href="#percentline-enhancer">PercentLineEnhancer</a>, and <a href="#bipattern-enhancer">BiPatternEnhancer</a>.
|
1181
|
-
</p>
|
1182
|
-
<pre class="program">class MyEruby < Erubis::Eruby
|
1183
|
-
include EscapeEnhancer
|
1184
|
-
include PercentLineEnhancer
|
1185
|
-
include BiPatternEnhancer
|
1186
|
-
end
|
1187
|
-
</pre>
|
1188
|
-
<p>You can specify enhancers in command-line with option '-E'.
|
1189
|
-
The following is an example to use some enhancers in command-line.
|
1190
|
-
</p>
|
1191
|
-
<pre class="terminal">$ erubis -xE Escape,PercentLine,BiPattern example.eruby
|
1192
|
-
</pre>
|
1193
|
-
<p>The following is the list of enhancers.
|
1194
|
-
</p>
|
1195
|
-
<dl class="dl1">
|
1196
|
-
<dt class="dt1">
|
1197
|
-
<a href="#escape-enhancer">EscapeEnhander</a> (language-independent)</dt>
|
1198
|
-
<dd class="dd1">
|
1199
|
-
Switch '<%= %>' to escaped and '<%== %>' to unescaped.
|
1200
|
-
</dd>
|
1201
|
-
<dt class="dt1">
|
1202
|
-
<a href="#stdout-enhancer">StdoutEnhancer</a> (only for Eruby)</dt>
|
1203
|
-
<dd class="dd1">
|
1204
|
-
Use $stdout instead of array buffer.
|
1205
|
-
</dd>
|
1206
|
-
<dt class="dt1">
|
1207
|
-
<a href="#printout-enhancer">PrintOutEnhancer</a> (only for Eruby)</dt>
|
1208
|
-
<dd class="dd1">
|
1209
|
-
Use "print(...)" statement insead of "_buf << ...".
|
1210
|
-
</dd>
|
1211
|
-
<dt class="dt1">
|
1212
|
-
<a href="#printenabled-enhancer">PrintEnabledEnhancer</a> (only for Eruby)</dt>
|
1213
|
-
<dd class="dd1">
|
1214
|
-
Enable to use print() in '<% ... %>'.
|
1215
|
-
</dd>
|
1216
|
-
<dt class="dt1">
|
1217
|
-
<a href="#array-enhancer">ArrayEnhancer</a> (only for Eruby)</dt>
|
1218
|
-
<dd class="dd1">
|
1219
|
-
Return array of string instead of returning string.
|
1220
|
-
</dd>
|
1221
|
-
<dt class="dt1">
|
1222
|
-
<a href="#arraybuffer-enhancer">ArrayBufferEnhancer</a> (only for Eruby)</dt>
|
1223
|
-
<dd class="dd1">
|
1224
|
-
Use array buffer. It is a little slower than StringBufferEnhancer.
|
1225
|
-
</dd>
|
1226
|
-
<dt class="dt1">
|
1227
|
-
<a href="#stringbuffer-enhancer">StringBufferEnhancer</a> (only for Eruby)</dt>
|
1228
|
-
<dd class="dd1">
|
1229
|
-
Use string buffer. This is included in Erubis::Eruby by default.
|
1230
|
-
</dd>
|
1231
|
-
<dt class="dt1">
|
1232
|
-
<a href="#erbout-enhancer">ErboutEnhancer</a> (only for Eruby)</dt>
|
1233
|
-
<dd class="dd1">
|
1234
|
-
Set '_erbout = _buf = "";' to be compatible with ERB.
|
1235
|
-
</dd>
|
1236
|
-
<dt class="dt1">
|
1237
|
-
<a href="#notext-enhancer">NoTextEnhancer</a> (language-independent)</dt>
|
1238
|
-
<dd class="dd1">
|
1239
|
-
Print embedded code only and ignore normal text.
|
1240
|
-
</dd>
|
1241
|
-
<dt class="dt1">
|
1242
|
-
<a href="#nocode-enhancer">NoCodeEnhancer</a> (language-independent)</dt>
|
1243
|
-
<dd class="dd1">
|
1244
|
-
Print normal text only and ignore code.
|
1245
|
-
</dd>
|
1246
|
-
<dt class="dt1">
|
1247
|
-
<a href="#simplify-enhancer">SimplifyEnhancer</a> (language-independent)</dt>
|
1248
|
-
<dd class="dd1">
|
1249
|
-
Make compile faster but don't trim spaces around '<% %>'.
|
1250
|
-
</dd>
|
1251
|
-
<dt class="dt1">
|
1252
|
-
<a href="#bipattern-enhancer">BiPatternEnhancer</a> (language-independent)</dt>
|
1253
|
-
<dd class="dd1">
|
1254
|
-
[experimental] Enable to use another embedded pattern with '<% %>'.
|
1255
|
-
</dd>
|
1256
|
-
<dt class="dt1">
|
1257
|
-
<a href="#percentline-enhancer">PercentLineEnhancer</a> (language-independent)</dt>
|
1258
|
-
<dd class="dd1">
|
1259
|
-
Regard lines starting with '%' as Ruby code. This is for compatibility with eruby and ERB.
|
1260
|
-
</dd>
|
1261
|
-
<dt class="dt1">
|
1262
|
-
<a href="#headerfooter-enhancer">HeaderFooterEnhancer</a> (language-independent)</dt>
|
1263
|
-
<dd class="dd1">
|
1264
|
-
[experimental] Enable you to add header and footer in eRuby script.
|
1265
|
-
</dd>
|
1266
|
-
<dt class="dt1">
|
1267
|
-
<a href="#interpolation-enhancer">InterpolationEnhancer</a> (only for Eruby)</dt>
|
1268
|
-
<dd class="dd1">
|
1269
|
-
[experimental] convert '<p><%= text %></p>' into '_buf << %Q`<p>#{text}</p>`'.
|
1270
|
-
</dd>
|
1271
|
-
<dt class="dt1">
|
1272
|
-
<a href="#deleteindent-enhancer">DeleteIndentEnhancer</a> (language-independent)</dt>
|
1273
|
-
<dd class="dd1">
|
1274
|
-
[experimental] delete indentation of HTML file and eliminate page size.
|
1275
|
-
</dd>
|
1276
|
-
</dl>
|
1277
|
-
<p>If you required 'erubis/engine/enhanced', Eruby subclasses which include each enhancers are defined.
|
1278
|
-
For example, class BiPatternEruby includes BiPatternEnhancer.
|
1279
|
-
</p>
|
1280
|
-
<a name="escape-enhancer"></a>
|
1281
|
-
<h3 class="section2">EscapeEnhancer</h3>
|
1282
|
-
<p>EscapeEnhancer switches '<%= ... %>' to escaped and '<%== ... %>' to unescaped.
|
1283
|
-
</p>
|
1284
|
-
<a name="example.eruby"></a>
|
1285
|
-
<div class="program_caption">
|
1286
|
-
example.eruby</div>
|
1287
|
-
<pre class="program"><div>
|
1288
|
-
<% for item in list %>
|
1289
|
-
<p><%= item %></p>
|
1290
|
-
<p><%== item %></p>
|
1291
|
-
<% end %>
|
1292
|
-
</div>
|
1293
|
-
</pre>
|
1294
|
-
<a name="escape_example.result"></a>
|
1295
|
-
<div class="terminal_caption">
|
1296
|
-
compiled source code</div>
|
1297
|
-
<pre class="terminal">$ erubis -xE Escape example.eruby
|
1298
|
-
_buf = ''; _buf << '<div>
|
1299
|
-
'; for item in list
|
1300
|
-
_buf << ' <p>'; <strong>_buf << Erubis::XmlHelper.escape_xml( item );</strong> _buf << '</p>
|
1301
|
-
<p>'; <strong>_buf << ( item ).to_s;</strong> _buf << '</p>
|
1302
|
-
'; end
|
1303
|
-
_buf << '</div>
|
1304
|
-
';
|
1305
|
-
_buf.to_s
|
1306
|
-
</pre>
|
1307
|
-
<p>EscapeEnhancer is language-independent.
|
1308
|
-
</p>
|
1309
|
-
<br>
|
1310
|
-
|
1311
|
-
|
1312
|
-
<a name="stdout-enhancer"></a>
|
1313
|
-
<h3 class="section2">StdoutEnhancer</h3>
|
1314
|
-
<p>StdoutEnhancer use $sdtdout instead of array buffer.
|
1315
|
-
Therefore, you can use 'print' statement in embedded ruby code.
|
1316
|
-
</p>
|
1317
|
-
<a name="stdout_exmple.result"></a>
|
1318
|
-
<div class="terminal_caption">
|
1319
|
-
compiled source code</div>
|
1320
|
-
<pre class="terminal">$ erubis -xE Stdout example.eruby
|
1321
|
-
<strong>_buf = $stdout;</strong> _buf << '<div>
|
1322
|
-
'; for item in list
|
1323
|
-
_buf << ' <p>'; _buf << ( item ).to_s; _buf << '</p>
|
1324
|
-
<p>'; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</p>
|
1325
|
-
'; end
|
1326
|
-
_buf << '</div>
|
1327
|
-
';
|
1328
|
-
<strong>''</strong>
|
1329
|
-
</pre>
|
1330
|
-
<p>StdoutEnhancer is only for Eruby.
|
1331
|
-
</p>
|
1332
|
-
<br>
|
1333
|
-
|
1334
|
-
|
1335
|
-
<a name="printout-enhancer"></a>
|
1336
|
-
<h3 class="section2">PrintOutEnhancer</h3>
|
1337
|
-
<p>PrintOutEnhancer makes compiled source code to use 'print(...)' instead of '_buf << ...'.
|
1338
|
-
</p>
|
1339
|
-
<a name="printstatement_example.result"></a>
|
1340
|
-
<div class="terminal_caption">
|
1341
|
-
compiled source code</div>
|
1342
|
-
<pre class="terminal">$ erubis -xE PrintOut example.eruby
|
1343
|
-
<strong>print</strong> '<div>
|
1344
|
-
'; for item in list
|
1345
|
-
<strong>print</strong> ' <p>'; <strong>print</strong>(( item ).to_s); <strong>print</strong> '</p>
|
1346
|
-
<p>'; <strong>print</strong> Erubis::XmlHelper.escape_xml( item ); <strong>print</strong> '</p>
|
1347
|
-
'; end
|
1348
|
-
<strong>print</strong> '</div>
|
1349
|
-
';
|
1350
|
-
</pre>
|
1351
|
-
<p>PrintOutEnhancer is only for Eruby.
|
1352
|
-
</p>
|
1353
|
-
<br>
|
1354
|
-
|
1355
|
-
|
1356
|
-
<a name="printenabled-enhancer"></a>
|
1357
|
-
<h3 class="section2">PrintEnabledEnhancer</h3>
|
1358
|
-
<p>PrintEnabledEnhancer enables you to use print() method in '<% ... %>'.
|
1359
|
-
</p>
|
1360
|
-
<a name="printenabled-example.eruby"></a>
|
1361
|
-
<div class="program_caption">
|
1362
|
-
printenabled-example.eruby</div>
|
1363
|
-
<pre class="program"><% for item in @list %>
|
1364
|
-
<b><strong><% print item %></strong></b>
|
1365
|
-
<% end %>
|
1366
|
-
</pre>
|
1367
|
-
<a name="printenabled-example.rb"></a>
|
1368
|
-
<div class="program_caption">
|
1369
|
-
printenabled-example.rb</div>
|
1370
|
-
<pre class="program">require 'erubis'
|
1371
|
-
class PrintEnabledEruby < Erubis::Eruby
|
1372
|
-
include Erubis::PrintEnabledEnhancer
|
1373
|
-
end
|
1374
|
-
input = File.read('printenabled-example.eruby')
|
1375
|
-
eruby = PrintEnabledEruby.new(input)
|
1376
|
-
list = ['aaa', 'bbb', 'ccc']
|
1377
|
-
print eruby.evaluate(:list=>list)
|
1378
|
-
</pre>
|
1379
|
-
<a name="printenable_example.result"></a>
|
1380
|
-
<div class="terminal_caption">
|
1381
|
-
output result</div>
|
1382
|
-
<pre class="terminal">$ ruby printenabled-example.rb
|
1383
|
-
<b>aaa</b>
|
1384
|
-
<b>bbb</b>
|
1385
|
-
<b>ccc</b>
|
1386
|
-
</pre>
|
1387
|
-
<p>Notice to use Eruby#evaluate() and not to use Eruby#result(),
|
1388
|
-
because print() method in '<% ... %>' invokes not Kernel#print() but PrintEnabledEnhancer#print().
|
1389
|
-
</p>
|
1390
|
-
<p>PrintEnabledEnhancer is only for Eruby.
|
1391
|
-
</p>
|
1392
|
-
<br>
|
1393
|
-
|
1394
|
-
|
1395
|
-
<a name="array-enhancer"></a>
|
1396
|
-
<h3 class="section2">ArrayEnhancer</h3>
|
1397
|
-
<p>ArrayEnhancer makes Eruby to return an array of strings.
|
1398
|
-
</p>
|
1399
|
-
<a name="array_example.result"></a>
|
1400
|
-
<div class="terminal_caption">
|
1401
|
-
compiled source code</div>
|
1402
|
-
<pre class="terminal">$ erubis -xE Array example.eruby
|
1403
|
-
<strong>_buf = [];</strong> _buf << '<div>
|
1404
|
-
'; for item in list
|
1405
|
-
_buf << ' <p>'; _buf << ( item ).to_s; _buf << '</p>
|
1406
|
-
<p>'; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</p>
|
1407
|
-
'; end
|
1408
|
-
_buf << '</div>
|
1409
|
-
';
|
1410
|
-
<strong>_buf</strong>
|
1411
|
-
</pre>
|
1412
|
-
<p>ArrayEnhancer is only for Eruby.
|
1413
|
-
</p>
|
1414
|
-
<br>
|
1415
|
-
|
1416
|
-
|
1417
|
-
<a name="arraybuffer-enhancer"></a>
|
1418
|
-
<h3 class="section2">ArrayBufferEnhancer</h3>
|
1419
|
-
<p>ArrayBufferEnhancer makes Eruby to use array buffer.
|
1420
|
-
Array buffer is a litte slower than String buffer.
|
1421
|
-
</p>
|
1422
|
-
<p>ArrayBufferEnhancer is only for Eruby.
|
1423
|
-
</p>
|
1424
|
-
<a name="arraybuffer_example.result"></a>
|
1425
|
-
<div class="terminal_caption">
|
1426
|
-
compiled source code</div>
|
1427
|
-
<pre class="terminal">$ erubis -xE ArrayBuffer example.eruby
|
1428
|
-
<strong>_buf = [];</strong> _buf << '<div>
|
1429
|
-
'; for item in list
|
1430
|
-
_buf << ' <p>'; _buf << ( item ).to_s; _buf << '</p>
|
1431
|
-
<p>'; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</p>
|
1432
|
-
'; end
|
1433
|
-
_buf << '</div>
|
1434
|
-
';
|
1435
|
-
<strong>_buf.join</strong>
|
1436
|
-
</pre>
|
1437
|
-
<br>
|
1438
|
-
|
1439
|
-
|
1440
|
-
<a name="stringbuffer-enhancer"></a>
|
1441
|
-
<h3 class="section2">StringBufferEnhancer</h3>
|
1442
|
-
<p>StringBufferEnhancer makes Eruby to use string buffer.
|
1443
|
-
String buffer is a little faster than array buffer.
|
1444
|
-
Erubis::Eruby includes this enhancer by default.
|
1445
|
-
</p>
|
1446
|
-
<a name="stringbuffer_example.result"></a>
|
1447
|
-
<div class="terminal_caption">
|
1448
|
-
compiled source code</div>
|
1449
|
-
<pre class="terminal">$ erubis -xE StringBuffer example.eruby
|
1450
|
-
<strong>_buf = '';</strong> _buf << '<div>
|
1451
|
-
'; for item in list
|
1452
|
-
_buf << ' <p>'; _buf << ( item ).to_s; _buf << '</p>
|
1453
|
-
<p>'; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</p>
|
1454
|
-
'; end
|
1455
|
-
_buf << '</div>
|
1456
|
-
';
|
1457
|
-
<strong>_buf.to_s</strong>
|
1458
|
-
</pre>
|
1459
|
-
<p>StringBufferEnhancer is only for Eruby.
|
1460
|
-
</p>
|
1461
|
-
<br>
|
1462
|
-
|
1463
|
-
|
1464
|
-
<a name="erbout-enhancer"></a>
|
1465
|
-
<h3 class="section2">ErboutEnhancer</h3>
|
1466
|
-
<p>ErboutEnhancer makes Eruby to be compatible with ERB.
|
1467
|
-
This is useful especially for Ruby on Rails.
|
1468
|
-
</p>
|
1469
|
-
<div class="terminal_caption">
|
1470
|
-
compiled source code</div>
|
1471
|
-
<pre class="terminal">$ erubis -xE Erbout example.eruby
|
1472
|
-
<strong>_erbout = _buf = '';</strong> _buf << '<div>
|
1473
|
-
'; for item in list
|
1474
|
-
_buf << ' <p>'; _buf << ( item ).to_s; _buf << '</p>
|
1475
|
-
<p>'; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</p>
|
1476
|
-
'; end
|
1477
|
-
_buf << '</div>
|
1478
|
-
';
|
1479
|
-
_buf.to_s
|
1480
|
-
</pre>
|
1481
|
-
<p>ErboutEnhancer is only for Eruby.
|
1482
|
-
</p>
|
1483
|
-
<br>
|
1484
|
-
|
1485
|
-
|
1486
|
-
<a name="notext-enhancer"></a>
|
1487
|
-
<h3 class="section2">NoTextEnhancer</h3>
|
1488
|
-
<p>NoTextEnhancer suppress output of text and prints only embedded code.
|
1489
|
-
This is useful especially when debugging a complex eRuby script.
|
1490
|
-
</p>
|
1491
|
-
<a name="notext-example.eruby"></a>
|
1492
|
-
<div class="program_caption">
|
1493
|
-
notext-example.eruby</div>
|
1494
|
-
<pre class="program"><h3>List</h3>
|
1495
|
-
<% if !@list || @list.empty? %>
|
1496
|
-
<p>not found.</p>
|
1497
|
-
<% else %>
|
1498
|
-
<table>
|
1499
|
-
<tbody>
|
1500
|
-
<% @list.each_with_index do |item, i| %>
|
1501
|
-
<tr bgcolor="<%= i%2 == 0 ? '#FFCCCC' : '#CCCCFF' %>">
|
1502
|
-
<td><%= item %></td>
|
1503
|
-
</tr>
|
1504
|
-
<% end %>
|
1505
|
-
</tbody>
|
1506
|
-
</table>
|
1507
|
-
<% end %>
|
1508
|
-
</pre>
|
1509
|
-
<a name="notext_example.result"></a>
|
1510
|
-
<div class="terminal_caption">
|
1511
|
-
output example of NoTextEnhancer</div>
|
1512
|
-
<pre class="terminal">$ erubis -xE NoText notext-example.eruby
|
1513
|
-
_buf = '';
|
1514
|
-
if !@list || @list.empty?
|
1515
|
-
|
1516
|
-
else
|
1517
|
-
|
1518
|
-
|
1519
|
-
@list.each_with_index do |item, i|
|
1520
|
-
_buf << ( i%2 == 0 ? '#FFCCCC' : '#CCCCFF' ).to_s;
|
1521
|
-
_buf << ( item ).to_s;
|
1522
|
-
|
1523
|
-
end
|
1524
|
-
|
1525
|
-
|
1526
|
-
end
|
1527
|
-
_buf.to_s
|
1528
|
-
</pre>
|
1529
|
-
<p>NoTextEnhancer is language-independent. It is useful even if you are PHP user, see <a href="#topics-php">this section</a>.
|
1530
|
-
</p>
|
1531
|
-
<br>
|
1532
|
-
|
1533
|
-
|
1534
|
-
<a name="nocode-enhancer"></a>
|
1535
|
-
<h3 class="section2">NoCodeEnhancer</h3>
|
1536
|
-
<p>NoCodeEnhancer suppress output of embedded code and prints only normal text.
|
1537
|
-
This is useful especially when validating HTML tags.
|
1538
|
-
</p>
|
1539
|
-
<a name="nocode-example.eruby"></a>
|
1540
|
-
<div class="program_caption">
|
1541
|
-
nocode-example.eruby</div>
|
1542
|
-
<pre class="program"><h3>List</h3>
|
1543
|
-
<% if !@list || @list.empty? %>
|
1544
|
-
<p>not found.</p>
|
1545
|
-
<% else %>
|
1546
|
-
<table>
|
1547
|
-
<tbody>
|
1548
|
-
<% @list.each_with_index do |item, i| %>
|
1549
|
-
<tr bgcolor="<%= i%2 == 0 ? '#FFCCCC' : '#CCCCFF' %>">
|
1550
|
-
<td><%= item %></td>
|
1551
|
-
</tr>
|
1552
|
-
<% end %>
|
1553
|
-
</tbody>
|
1554
|
-
</table>
|
1555
|
-
<% end %>
|
1556
|
-
</pre>
|
1557
|
-
<a name="nocode_example.result"></a>
|
1558
|
-
<div class="terminal_caption">
|
1559
|
-
output example of NoCodeEnhancer</div>
|
1560
|
-
<pre class="terminal">$ erubis -xE NoCode notext-example.eruby
|
1561
|
-
<h3>List</h3>
|
1562
|
-
|
1563
|
-
<p>not found.</p>
|
1564
|
-
|
1565
|
-
<table>
|
1566
|
-
<tbody>
|
1567
|
-
|
1568
|
-
<tr bgcolor="">
|
1569
|
-
<td></td>
|
1570
|
-
</tr>
|
1571
|
-
|
1572
|
-
</tbody>
|
1573
|
-
</table>
|
1574
|
-
|
1575
|
-
</pre>
|
1576
|
-
<p>NoCodeEnhancer is language-independent. It is useful even if you are PHP user, see <a href="#topics-php">this section</a>.
|
1577
|
-
</p>
|
1578
|
-
<br>
|
1579
|
-
|
1580
|
-
|
1581
|
-
<a name="simplify-enhancer"></a>
|
1582
|
-
<h3 class="section2">SimplifyEnhancer</h3>
|
1583
|
-
<p>SimplifyEnhancer makes compiling a little faster but don't trim spaces around '<% %>'.
|
1584
|
-
</p>
|
1585
|
-
<a name="simplify_example.result"></a>
|
1586
|
-
<div class="terminal_caption">
|
1587
|
-
compiled source code</div>
|
1588
|
-
<pre class="terminal">$ erubis -xE Simplify example.eruby
|
1589
|
-
_buf = ''; _buf << '<div>
|
1590
|
-
'; for item in list ; _buf << '
|
1591
|
-
<p>'; _buf << ( item ).to_s; _buf << '</p>
|
1592
|
-
<p>'; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</p>
|
1593
|
-
'; end ; _buf << '
|
1594
|
-
</div>
|
1595
|
-
';
|
1596
|
-
_buf.to_s
|
1597
|
-
</pre>
|
1598
|
-
<p>SimplifyEnhancer is language-independent.
|
1599
|
-
</p>
|
1600
|
-
<br>
|
1601
|
-
|
1602
|
-
|
1603
|
-
<a name="bipattern-enhancer"></a>
|
1604
|
-
<h3 class="section2">BiPatternEnhancer</h3>
|
1605
|
-
<p>BiPatternEnhancer enables to use another embedded pattern with '<% %>'.
|
1606
|
-
By Default, '[= ... =]' is available for expression.
|
1607
|
-
You can specify pattern by :bipattern property.
|
1608
|
-
</p>
|
1609
|
-
<a name="bipattern-example.rhtml"></a>
|
1610
|
-
<div class="program_caption">
|
1611
|
-
bipattern-example.rhtml</div>
|
1612
|
-
<pre class="program"><% for item in list %>
|
1613
|
-
<b><strong>[= item =]</strong></b>
|
1614
|
-
<b><strong>[== item =]</strong></b>
|
1615
|
-
<% end %>
|
1616
|
-
</pre>
|
1617
|
-
<a name="bipattern_example.result"></a>
|
1618
|
-
<div class="terminal_caption">
|
1619
|
-
compiled source code</div>
|
1620
|
-
<pre class="terminal">$ erubis -xE BiPattern bipattern-example.rhtml
|
1621
|
-
_buf = ''; for item in list
|
1622
|
-
_buf << ' <b>'; <strong>_buf << ( item ).to_s;</strong> _buf << '</b>
|
1623
|
-
<b>'; <strong>_buf << Erubis::XmlHelper.escape_xml( item );</strong> _buf << '</b>
|
1624
|
-
'; end
|
1625
|
-
_buf.to_s
|
1626
|
-
</pre>
|
1627
|
-
<p>BiPatternEnhancer is language-independent.
|
1628
|
-
</p>
|
1629
|
-
<br>
|
1630
|
-
|
1631
|
-
|
1632
|
-
<a name="percentline-enhancer"></a>
|
1633
|
-
<h3 class="section2">PercentLineEnhancer</h3>
|
1634
|
-
<p>PercentLineEnhancer regards lines starting with '%' as Ruby code.
|
1635
|
-
This is for compatibility with eruby and ERB.
|
1636
|
-
</p>
|
1637
|
-
<a name="percentline-example.rhtml"></a>
|
1638
|
-
<div class="program_caption">
|
1639
|
-
percentline-example.rhtml</div>
|
1640
|
-
<pre class="program"><strong>% for item in list</strong>
|
1641
|
-
<b><%= item %></b>
|
1642
|
-
<strong>% end</strong>
|
1643
|
-
%% lines with '%%'
|
1644
|
-
</pre>
|
1645
|
-
<a name="percentline_example.result"></a>
|
1646
|
-
<div class="terminal_caption">
|
1647
|
-
compiled source code</div>
|
1648
|
-
<pre class="terminal">$ erubis -xE PercentLine percentline-example.rhtml
|
1649
|
-
_buf = ''; <strong>for item in list</strong>
|
1650
|
-
_buf << ' <b>'; _buf << ( item ).to_s; _buf << '</b>
|
1651
|
-
'; <strong>end</strong>
|
1652
|
-
_buf << '% lines with \'%%\'
|
1653
|
-
';
|
1654
|
-
_buf.to_s
|
1655
|
-
</pre>
|
1656
|
-
<p>PercentLineEnhancer is language-independent.
|
1657
|
-
</p>
|
1658
|
-
<br>
|
1659
|
-
|
1660
|
-
|
1661
|
-
<a name="headerfooter-enhancer"></a>
|
1662
|
-
<h3 class="section2">HeaderFooterEnhancer</h3>
|
1663
|
-
<p>[experimental]
|
1664
|
-
</p>
|
1665
|
-
<p>HeaderFooterEnhancer enables you to add header and footer in eRuby script.
|
1666
|
-
</p>
|
1667
|
-
<a name="headerfooter-example.eruby"></a>
|
1668
|
-
<div class="program_caption">
|
1669
|
-
headerfooter-example.eruby</div>
|
1670
|
-
<pre class="program"><strong><!--#header:</strong>
|
1671
|
-
<strong>def list_items(items)</strong>
|
1672
|
-
<strong>#--></strong>
|
1673
|
-
<% for item in items %>
|
1674
|
-
<b><%= item %></b>
|
1675
|
-
<% end %>
|
1676
|
-
<strong><!--#footer:</strong>
|
1677
|
-
<strong>end</strong>
|
1678
|
-
<strong>#--></strong>
|
1679
|
-
</pre>
|
1680
|
-
<a name="headerfooter_example.result"></a>
|
1681
|
-
<div class="terminal_caption">
|
1682
|
-
compiled source code</div>
|
1683
|
-
<pre class="terminal">$ erubis -xE HeaderFooter headerfooter-example.eruby
|
1684
|
-
|
1685
|
-
<strong>def list_items(items)</strong>
|
1686
|
-
|
1687
|
-
_buf = ''; for item in items
|
1688
|
-
_buf << ' <b>'; _buf << ( item ).to_s; _buf << '</b>
|
1689
|
-
'; end
|
1690
|
-
_buf.to_s
|
1691
|
-
|
1692
|
-
<strong>end</strong>
|
1693
|
-
|
1694
|
-
</pre>
|
1695
|
-
<p>Compare to the following:
|
1696
|
-
</p>
|
1697
|
-
<a name="normal-eruby-test.eruby"></a>
|
1698
|
-
<div class="program_caption">
|
1699
|
-
normal-eruby-test.eruby</div>
|
1700
|
-
<pre class="program"><strong><%</strong>
|
1701
|
-
<strong>def list_items(items)</strong>
|
1702
|
-
<strong>%></strong>
|
1703
|
-
<% for item in items %>
|
1704
|
-
<li><%= item %></li>
|
1705
|
-
<% end %>
|
1706
|
-
<strong><%</strong>
|
1707
|
-
<strong>end</strong>
|
1708
|
-
<strong>%></strong>
|
1709
|
-
</pre>
|
1710
|
-
<a name="normal_eruby_test.result"></a>
|
1711
|
-
<div class="terminal_caption">
|
1712
|
-
compiled source code</div>
|
1713
|
-
<pre class="terminal">$ erubis -x normal-eruby-test.eruby
|
1714
|
-
_buf = '';
|
1715
|
-
<strong>def list_items(items)</strong>
|
1716
|
-
|
1717
|
-
for item in items
|
1718
|
-
_buf << '<li>'; _buf << ( item ).to_s; _buf << '</li>
|
1719
|
-
'; end
|
1720
|
-
|
1721
|
-
<strong>end</strong>
|
1722
|
-
|
1723
|
-
_buf.to_s
|
1724
|
-
</pre>
|
1725
|
-
<p>Header and footer can be in any position in eRuby script,
|
1726
|
-
that is, header is no need to be in the head of eRuby script.
|
1727
|
-
</p>
|
1728
|
-
<a name="headerfooter-example2.rhtml"></a>
|
1729
|
-
<div class="program_caption">
|
1730
|
-
headerfooter-example2.rhtml</div>
|
1731
|
-
<pre class="program"><?xml version="1.0"?>
|
1732
|
-
<html>
|
1733
|
-
<strong><!--#header:</strong>
|
1734
|
-
<strong>def page(list)</strong>
|
1735
|
-
<strong>#--></strong>
|
1736
|
-
:
|
1737
|
-
<strong><!--#footer:</strong>
|
1738
|
-
<strong>end</strong>
|
1739
|
-
<strong>#--></strong>
|
1740
|
-
</html>
|
1741
|
-
</pre>
|
1742
|
-
<a name="headerfooter_example2.result"></a>
|
1743
|
-
<div class="terminal_caption">
|
1744
|
-
compiled source code</div>
|
1745
|
-
<pre class="terminal">$ erubis -xE HeaderFooter headerfooter-example2.rhtml
|
1746
|
-
|
1747
|
-
<strong>def page(list)</strong>
|
1748
|
-
|
1749
|
-
_buf = ''; _buf << '<?xml version="1.0"?>
|
1750
|
-
<html>
|
1751
|
-
'; _buf << ' :
|
1752
|
-
'; _buf << '</html>
|
1753
|
-
';
|
1754
|
-
_buf.to_s
|
1755
|
-
|
1756
|
-
<strong>end</strong>
|
1757
|
-
|
1758
|
-
</pre>
|
1759
|
-
<p>HeaderFooterEnhancer is experimental and is language-independent.
|
1760
|
-
</p>
|
1761
|
-
<br>
|
1762
|
-
|
1763
|
-
|
1764
|
-
<a name="interpolation-enhancer"></a>
|
1765
|
-
<h3 class="section2">InterpolationEnhancer</h3>
|
1766
|
-
<p>[experimental]
|
1767
|
-
</p>
|
1768
|
-
<p>InterpolationEnhancer converts "<h1><%= title %></h1>" into
|
1769
|
-
"_buf << %Q`<h1>#{ title }</h1>`".
|
1770
|
-
This makes Eruby a litter faster because method call of String#<< are eliminated
|
1771
|
-
by expression interpolations.
|
1772
|
-
</p>
|
1773
|
-
<div class="program_caption">
|
1774
|
-
InterpolationEnhancer elmininates method call of String#<<.</div>
|
1775
|
-
<pre class="program">## Assume that input is '<a href="<%=url%>"><%=name%></a>'.
|
1776
|
-
## Eruby convert input into the following code. String#<< is called 5 times.
|
1777
|
-
_buf << '<a href="'; _buf << (url).to_s; _buf << '">'; _buf << (name).to_s; _buf << '</a>';
|
1778
|
-
|
1779
|
-
## If InterpolationEnhancer is used, String#<< is called only once.
|
1780
|
-
_buf << %Q`<a href="#{url}">#{name}</a>`;
|
1781
|
-
</pre>
|
1782
|
-
<a name="interpolation_example.result"></a>
|
1783
|
-
<div class="terminal_caption">
|
1784
|
-
compiled source code</div>
|
1785
|
-
<pre class="terminal">$ erubis -xE Interpolation example.eruby
|
1786
|
-
_buf = ''; _buf << <strong>%Q`</strong><div>\n<strong>`</strong>
|
1787
|
-
for item in list
|
1788
|
-
_buf << <strong>%Q`</strong> <p><strong>#{ item }</strong></p>
|
1789
|
-
<p><strong>#{Erubis::XmlHelper.escape_xml( item )}</strong></p>\n<strong>`</strong>
|
1790
|
-
end
|
1791
|
-
_buf << <strong>%Q`</strong></div>\n<strong>`</strong>
|
1792
|
-
_buf.to_s
|
1793
|
-
</pre>
|
1794
|
-
<p>Erubis provides Erubis::FastEruby class which includes InterpolationEnhancer.
|
1795
|
-
You can use Erubis::FastEruby class instead of Erubis::Eruby class.
|
1796
|
-
</p>
|
1797
|
-
<p>InterpolationEnhancer is only for Eruby.
|
1798
|
-
</p>
|
1799
|
-
<br>
|
1800
|
-
|
1801
|
-
|
1802
|
-
<a name="deleteindent-enhancer"></a>
|
1803
|
-
<h3 class="section2">DeleteIndentEnhancer</h3>
|
1804
|
-
<p>[experimental]
|
1805
|
-
DeleteIndentEnhancer deletes indentation of HTML file.
|
1806
|
-
</p>
|
1807
|
-
<a name="interpolation_example.result"></a>
|
1808
|
-
<div class="terminal_caption">
|
1809
|
-
compiled source code</div>
|
1810
|
-
<pre class="terminal">$ erubis -xE DeleteIndent example.eruby
|
1811
|
-
_buf = ''; _buf << '<div>
|
1812
|
-
'; for item in list
|
1813
|
-
_buf << '<p>'; _buf << ( item ).to_s; _buf << '</p>
|
1814
|
-
<p>'; _buf << Erubis::XmlHelper.escape_xml( item ); _buf << '</p>
|
1815
|
-
'; end
|
1816
|
-
_buf << '</div>
|
1817
|
-
';
|
1818
|
-
_buf.to_s
|
1819
|
-
</pre>
|
1820
|
-
<p>Notice that DeleteIndentEnhancer isn't intelligent.
|
1821
|
-
It deletes indentations even if they are in <PRE></PRE>.
|
1822
|
-
</p>
|
1823
|
-
<p>DeleteIndentEnhancer is language-independent.
|
1824
|
-
</p>
|
1825
|
-
<br>
|
1826
|
-
|
1827
|
-
|
1828
|
-
<br>
|
1829
|
-
|
1830
|
-
|
1831
|
-
<a name="lang"></a>
|
1832
|
-
<h2 class="section1">Multi-Language Support</h2>
|
1833
|
-
<p>Erubis supports the following languages<sup>(<a href="#fnref:2" name="fnlink:2">*2</a>)</sup>:
|
1834
|
-
</p>
|
1835
|
-
<ul type="disc">
|
1836
|
-
<li>Ruby
|
1837
|
-
</li>
|
1838
|
-
<li><a href="#lang-php">PHP</a>
|
1839
|
-
</li>
|
1840
|
-
<li><a href="#lang-c">C</a>
|
1841
|
-
</li>
|
1842
|
-
<li><a href="#lang-java">Java</a>
|
1843
|
-
</li>
|
1844
|
-
<li><a href="#lang-scheme">Scheme</a>
|
1845
|
-
</li>
|
1846
|
-
<li><a href="#lang-perl">Perl</a>
|
1847
|
-
</li>
|
1848
|
-
<li><a href="#lang-javascript">JavaScript</a>
|
1849
|
-
</li>
|
1850
|
-
</ul>
|
1851
|
-
<div class="footnote">
|
1852
|
-
<dl compact>
|
1853
|
-
<dt>(<a name="fnref:2" href="#fnlink:2">*2</a>)</dt>
|
1854
|
-
<dd>If you need template engine in pure PHP/Perl/JavaScript, try <a href="http://www.kuwata-lab.com/tenjin/">Tenjin</a> (<a href="http://www.kuwata-lab.com/tenjin/">http://www.kuwata-lab.com/tenjin/</a>). Tenjin is a very fast and full-featured template engine implemented in pure PHP/Perl/JavaScript.</dd>
|
1855
|
-
</dl>
|
1856
|
-
</div>
|
1857
|
-
<a name="lang-php"></a>
|
1858
|
-
<h3 class="section2">PHP</h3>
|
1859
|
-
<a name="example.ephp"></a>
|
1860
|
-
<div class="program_caption">
|
1861
|
-
example.ephp</div>
|
1862
|
-
<pre class="program"><?xml version="1.0"?>
|
1863
|
-
<html>
|
1864
|
-
<body>
|
1865
|
-
<p>Hello <strong><%= $user %></strong>!</p>
|
1866
|
-
<table>
|
1867
|
-
<tbody>
|
1868
|
-
<strong><% $i = 0; %></strong>
|
1869
|
-
<strong><% foreach ($list as $item) { %></strong>
|
1870
|
-
<strong><% $i++; %></strong>
|
1871
|
-
<tr bgcolor=<strong>"<%= $i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %>"</strong>>
|
1872
|
-
<td><strong><%= $i %></strong></td>
|
1873
|
-
<td><strong><%== $item %></strong></td>
|
1874
|
-
</tr>
|
1875
|
-
<strong><% } %></strong>
|
1876
|
-
</tbody>
|
1877
|
-
</table>
|
1878
|
-
</body>
|
1879
|
-
</html>
|
1880
|
-
</pre>
|
1881
|
-
<a name="example_php.result"></a>
|
1882
|
-
<div class="terminal_caption">
|
1883
|
-
compiled source code</div>
|
1884
|
-
<pre class="terminal">$ erubis -l php example.ephp
|
1885
|
-
<<?php ?>?xml version="1.0"?>
|
1886
|
-
<html>
|
1887
|
-
<body>
|
1888
|
-
<p>Hello <?php echo $user; ?>!</p>
|
1889
|
-
<table>
|
1890
|
-
<tbody>
|
1891
|
-
<?php $i = 0; ?>
|
1892
|
-
<?php foreach ($list as $item) { ?>
|
1893
|
-
<?php $i++; ?>
|
1894
|
-
<tr bgcolor="<?php echo $i % 2 == 0 ? '#FFCCCC' : '#CCCCFF'; ?>">
|
1895
|
-
<td><?php echo $i; ?></td>
|
1896
|
-
<td><?php echo htmlspecialchars($item); ?></td>
|
1897
|
-
</tr>
|
1898
|
-
<?php } ?>
|
1899
|
-
</tbody>
|
1900
|
-
</table>
|
1901
|
-
</body>
|
1902
|
-
</html>
|
1903
|
-
</pre>
|
1904
|
-
<br>
|
1905
|
-
|
1906
|
-
|
1907
|
-
<a name="lang-c"></a>
|
1908
|
-
<h3 class="section2">C</h3>
|
1909
|
-
<a name="example.ec"></a>
|
1910
|
-
<div class="program_caption">
|
1911
|
-
example.ec</div>
|
1912
|
-
<pre class="program"><strong><%
|
1913
|
-
#include <stdio.h>
|
1914
|
-
|
1915
|
-
int main(int argc, char *argv[])
|
1916
|
-
{
|
1917
|
-
int i;
|
1918
|
-
|
1919
|
-
%></strong>
|
1920
|
-
<html>
|
1921
|
-
<body>
|
1922
|
-
<p>Hello <strong><%= "%s", argv[0] %></strong>!</p>
|
1923
|
-
<table>
|
1924
|
-
<tbody>
|
1925
|
-
<strong><% for (i = 1; i < argc; i++) { %></strong>
|
1926
|
-
<tr bgcolor="<strong><%= i % 2 == 0 ? "#FFCCCC" : "#CCCCFF" %></strong>">
|
1927
|
-
<td><strong><%= "%d", i %></strong></td>
|
1928
|
-
<td><strong><%= "%s", argv[i] %></strong></td>
|
1929
|
-
</tr>
|
1930
|
-
<strong><% } %></strong>
|
1931
|
-
</tbody>
|
1932
|
-
</table>
|
1933
|
-
</body>
|
1934
|
-
</html>
|
1935
|
-
<strong><%
|
1936
|
-
return 0;
|
1937
|
-
}
|
1938
|
-
%></strong>
|
1939
|
-
</pre>
|
1940
|
-
<a name="example_c.result"></a>
|
1941
|
-
<div class="terminal_caption">
|
1942
|
-
compiled source code</div>
|
1943
|
-
<pre class="terminal">$ erubis -l c example.ec
|
1944
|
-
#line 1 "example.ec"
|
1945
|
-
|
1946
|
-
#include <stdio.h>
|
1947
|
-
|
1948
|
-
int main(int argc, char *argv[])
|
1949
|
-
{
|
1950
|
-
int i;
|
1951
|
-
|
1952
|
-
|
1953
|
-
fputs("<html>\n"
|
1954
|
-
" <body>\n"
|
1955
|
-
" <p>Hello ", stdout); fprintf(stdout, "%s", argv[0]); fputs("!</p>\n"
|
1956
|
-
" <table>\n"
|
1957
|
-
" <tbody>\n", stdout);
|
1958
|
-
for (i = 1; i < argc; i++) {
|
1959
|
-
fputs(" <tr bgcolor=\"", stdout); fprintf(stdout, i % 2 == 0 ? "#FFCCCC" : "#CCCCFF"); fputs("\">\n"
|
1960
|
-
" <td>", stdout); fprintf(stdout, "%d", i); fputs("</td>\n"
|
1961
|
-
" <td>", stdout); fprintf(stdout, "%s", argv[i]); fputs("</td>\n"
|
1962
|
-
" </tr>\n", stdout);
|
1963
|
-
}
|
1964
|
-
fputs(" </tbody>\n"
|
1965
|
-
" </table>\n"
|
1966
|
-
" </body>\n"
|
1967
|
-
"</html>\n", stdout);
|
1968
|
-
|
1969
|
-
return 0;
|
1970
|
-
}
|
1971
|
-
|
1972
|
-
</pre>
|
1973
|
-
<br>
|
1974
|
-
|
1975
|
-
|
1976
|
-
<a name="lang-java"></a>
|
1977
|
-
<h3 class="section2">Java</h3>
|
1978
|
-
<a name="Example.ejava"></a>
|
1979
|
-
<div class="program_caption">
|
1980
|
-
Example.ejava</div>
|
1981
|
-
<pre class="program"><strong><%
|
1982
|
-
import java.util.*;
|
1983
|
-
|
1984
|
-
public class Example {
|
1985
|
-
private String user;
|
1986
|
-
private String[] list;
|
1987
|
-
public example(String user, String[] list) {
|
1988
|
-
this.user = user;
|
1989
|
-
this.list = list;
|
1990
|
-
}
|
1991
|
-
|
1992
|
-
public String view() {
|
1993
|
-
StringBuffer _buf = new StringBuffer();
|
1994
|
-
%></strong>
|
1995
|
-
<html>
|
1996
|
-
<body>
|
1997
|
-
<p>Hello <strong><%= user %></strong>!</p>
|
1998
|
-
<table>
|
1999
|
-
<tbody>
|
2000
|
-
<strong><% for (int i = 0; i < list.length; i++) { %></strong>
|
2001
|
-
<tr bgcolor=<strong>"<%= i % 2 == 0 ? "#FFCCCC" : "#CCCCFF" %>"</strong>>
|
2002
|
-
<td><strong><%= i + 1 %></strong></td>
|
2003
|
-
<td><strong><%== list[i] %></strong></td>
|
2004
|
-
</tr>
|
2005
|
-
<strong><% } %></strong>
|
2006
|
-
</tbody>
|
2007
|
-
</table>
|
2008
|
-
<body>
|
2009
|
-
</html>
|
2010
|
-
<strong><%
|
2011
|
-
return _buf.toString();
|
2012
|
-
}
|
2013
|
-
|
2014
|
-
public static void main(String[] args) {
|
2015
|
-
String[] list = { "<aaa>", "b&b", "\"ccc\"" };
|
2016
|
-
Example ex = Example.new("Erubis", list);
|
2017
|
-
System.out.print(ex.view());
|
2018
|
-
}
|
2019
|
-
|
2020
|
-
public static String escape(String s) {
|
2021
|
-
StringBuffer sb = new StringBuffer();
|
2022
|
-
for (int i = 0; i < s.length(); i++) {
|
2023
|
-
char ch = s.charAt(i);
|
2024
|
-
switch (ch) {
|
2025
|
-
case '<': sb.append("&lt;"); break;
|
2026
|
-
case '>': sb.append("&gt;"); break;
|
2027
|
-
case '&': sb.append("&amp;"); break;
|
2028
|
-
case '"': sb.append("&quot;"); break;
|
2029
|
-
default: sb.append(ch);
|
2030
|
-
}
|
2031
|
-
}
|
2032
|
-
return sb.toString();
|
2033
|
-
}
|
2034
|
-
}
|
2035
|
-
%></strong>
|
2036
|
-
</pre>
|
2037
|
-
<a name="example_java.result"></a>
|
2038
|
-
<div class="terminal_caption">
|
2039
|
-
compiled source code</div>
|
2040
|
-
<pre class="terminal">$ erubis -b -l java example.ejava
|
2041
|
-
|
2042
|
-
import java.util.*;
|
2043
|
-
|
2044
|
-
public class Example {
|
2045
|
-
private String user;
|
2046
|
-
private String[] list;
|
2047
|
-
public example(String user, String[] list) {
|
2048
|
-
this.user = user;
|
2049
|
-
this.list = list;
|
2050
|
-
}
|
2051
|
-
|
2052
|
-
public String view() {
|
2053
|
-
StringBuffer _buf = new StringBuffer();
|
2054
|
-
|
2055
|
-
_buf.append("<html>\n"
|
2056
|
-
+ " <body>\n"
|
2057
|
-
+ " <p>Hello "); _buf.append(user); _buf.append("!</p>\n"
|
2058
|
-
+ " <table>\n"
|
2059
|
-
+ " <tbody>\n");
|
2060
|
-
for (int i = 0; i < list.length; i++) {
|
2061
|
-
_buf.append(" <tr bgcolor=\""); _buf.append(i % 2 == 0 ? "#FFCCCC" : "#CCCCFF"); _buf.append("\">\n"
|
2062
|
-
+ " <td>"); _buf.append(i + 1); _buf.append("</td>\n"
|
2063
|
-
+ " <td>"); _buf.append(escape(list[i])); _buf.append("</td>\n"
|
2064
|
-
+ " </tr>\n");
|
2065
|
-
}
|
2066
|
-
_buf.append(" </tbody>\n"
|
2067
|
-
+ " </table>\n"
|
2068
|
-
+ " <body>\n"
|
2069
|
-
+ "</html>\n");
|
2070
|
-
|
2071
|
-
return _buf.toString();
|
2072
|
-
}
|
2073
|
-
|
2074
|
-
public static void main(String[] args) {
|
2075
|
-
String[] list = { "<aaa>", "b&b", "\"ccc\"" };
|
2076
|
-
Example ex = Example.new("Erubis", list);
|
2077
|
-
System.out.print(ex.view());
|
2078
|
-
}
|
2079
|
-
|
2080
|
-
public static String escape(String s) {
|
2081
|
-
StringBuffer sb = new StringBuffer();
|
2082
|
-
for (int i = 0; i < s.length(); i++) {
|
2083
|
-
char ch = s.charAt(i);
|
2084
|
-
switch (ch) {
|
2085
|
-
case '<': sb.append("&lt;"); break;
|
2086
|
-
case '>': sb.append("&gt;"); break;
|
2087
|
-
case '&': sb.append("&amp;"); break;
|
2088
|
-
case '"': sb.append("&quot;"); break;
|
2089
|
-
default: sb.append(ch);
|
2090
|
-
}
|
2091
|
-
}
|
2092
|
-
return sb.toString();
|
2093
|
-
}
|
2094
|
-
}
|
2095
|
-
|
2096
|
-
</pre>
|
2097
|
-
<br>
|
2098
|
-
|
2099
|
-
|
2100
|
-
<a name="lang-scheme"></a>
|
2101
|
-
<h3 class="section2">Scheme</h3>
|
2102
|
-
<a name="example.escheme"></a>
|
2103
|
-
<div class="program_caption">
|
2104
|
-
example.escheme</div>
|
2105
|
-
<pre class="program"><html>
|
2106
|
-
<body>
|
2107
|
-
<strong><%
|
2108
|
-
(let ((user "Erubis")
|
2109
|
-
(items '("<aaa>" "b&b" "\"ccc\""))
|
2110
|
-
(i 0))
|
2111
|
-
%></strong>
|
2112
|
-
<p>Hello <strong><%= user %></strong>!</p>
|
2113
|
-
<table>
|
2114
|
-
<strong><%
|
2115
|
-
(for-each
|
2116
|
-
(lambda (item)
|
2117
|
-
(set! i (+ i 1))
|
2118
|
-
%></strong>
|
2119
|
-
<tr bgcolor="<strong><%= (if (= (modulo i 2) 0) "#FFCCCC" "#CCCCFF") %></strong>">
|
2120
|
-
<td><strong><%= i %></strong></td>
|
2121
|
-
<td><strong><%= item %></strong></td>
|
2122
|
-
</tr>
|
2123
|
-
<strong><%
|
2124
|
-
) ; lambda end
|
2125
|
-
items) ; for-each end
|
2126
|
-
%></strong>
|
2127
|
-
</table>
|
2128
|
-
<strong><%
|
2129
|
-
) ; let end
|
2130
|
-
%></strong>
|
2131
|
-
</body>
|
2132
|
-
</html>
|
2133
|
-
</pre>
|
2134
|
-
<a name="example_scheme.result"></a>
|
2135
|
-
<div class="terminal_caption">
|
2136
|
-
compiled source code</div>
|
2137
|
-
<pre class="terminal">$ erubis -l scheme example.escheme
|
2138
|
-
(let ((_buf '())) (define (_add x) (set! _buf (cons x _buf))) (_add "<html>
|
2139
|
-
<body>\n")
|
2140
|
-
|
2141
|
-
(let ((user "Erubis")
|
2142
|
-
(items '("<aaa>" "b&b" "\"ccc\""))
|
2143
|
-
(i 0))
|
2144
|
-
|
2145
|
-
(_add " <p>Hello ")(_add user)(_add "!</p>
|
2146
|
-
<table>\n")
|
2147
|
-
|
2148
|
-
(for-each
|
2149
|
-
(lambda (item)
|
2150
|
-
(set! i (+ i 1))
|
2151
|
-
|
2152
|
-
(_add " <tr bgcolor=\"")(_add (if (= (modulo i 2) 0) "#FFCCCC" "#CCCCFF"))(_add "\">
|
2153
|
-
<td>")(_add i)(_add "</td>
|
2154
|
-
<td>")(_add item)(_add "</td>
|
2155
|
-
</tr>\n")
|
2156
|
-
|
2157
|
-
) ; lambda end
|
2158
|
-
items) ; for-each end
|
2159
|
-
|
2160
|
-
(_add " </table>\n")
|
2161
|
-
|
2162
|
-
) ; let end
|
2163
|
-
|
2164
|
-
(_add " </body>
|
2165
|
-
</html>\n")
|
2166
|
-
(reverse _buf))
|
2167
|
-
</pre>
|
2168
|
-
<a name="example_scheme_display.result"></a>
|
2169
|
-
<div class="terminal_caption">
|
2170
|
-
compiled source code (with <code>--func=display</code> property)</div>
|
2171
|
-
<pre class="terminal">$ erubis -l scheme --func=display example.escheme
|
2172
|
-
(display "<html>
|
2173
|
-
<body>\n")
|
2174
|
-
|
2175
|
-
(let ((user "Erubis")
|
2176
|
-
(items '("<aaa>" "b&b" "\"ccc\""))
|
2177
|
-
(i 0))
|
2178
|
-
|
2179
|
-
(display " <p>Hello ")(display user)(display "!</p>
|
2180
|
-
<table>\n")
|
2181
|
-
|
2182
|
-
(for-each
|
2183
|
-
(lambda (item)
|
2184
|
-
(set! i (+ i 1))
|
2185
|
-
|
2186
|
-
(display " <tr bgcolor=\"")(display (if (= (modulo i 2) 0) "#FFCCCC" "#CCCCFF"))(display "\">
|
2187
|
-
<td>")(display i)(display "</td>
|
2188
|
-
<td>")(display item)(display "</td>
|
2189
|
-
</tr>\n")
|
2190
|
-
|
2191
|
-
) ; lambda end
|
2192
|
-
items) ; for-each end
|
2193
|
-
|
2194
|
-
(display " </table>\n")
|
2195
|
-
|
2196
|
-
) ; let end
|
2197
|
-
|
2198
|
-
(display " </body>
|
2199
|
-
</html>\n")
|
2200
|
-
</pre>
|
2201
|
-
<br>
|
2202
|
-
|
2203
|
-
|
2204
|
-
<a name="lang-perl"></a>
|
2205
|
-
<h3 class="section2">Perl</h3>
|
2206
|
-
<a name="example.eperl"></a>
|
2207
|
-
<div class="program_caption">
|
2208
|
-
example.eprl</div>
|
2209
|
-
<pre class="program"><strong><%
|
2210
|
-
my $user = 'Erubis';
|
2211
|
-
my @list = ('<aaa>', 'b&b', '"ccc"');
|
2212
|
-
%></strong>
|
2213
|
-
<html>
|
2214
|
-
<body>
|
2215
|
-
<p>Hello <strong><%= $user %></strong>!</p>
|
2216
|
-
<table>
|
2217
|
-
<strong><% $i = 0; %></strong>
|
2218
|
-
<strong><% for $item (@list) { %></strong>
|
2219
|
-
<tr bgcolor=<strong><%= ++$i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %></strong>">
|
2220
|
-
<td><strong><%= $i %></strong></td>
|
2221
|
-
<td><strong><%= $item %></strong></td>
|
2222
|
-
</tr>
|
2223
|
-
<strong><% } %></strong>
|
2224
|
-
</table>
|
2225
|
-
</body>
|
2226
|
-
</html>
|
2227
|
-
</pre>
|
2228
|
-
<a name="example_perl.result"></a>
|
2229
|
-
<div class="terminal_caption">
|
2230
|
-
compiled source code</div>
|
2231
|
-
<pre class="terminal">$ erubis -l perl example.eperl
|
2232
|
-
use HTML::Entities;
|
2233
|
-
my $user = 'Erubis';
|
2234
|
-
my @list = ('<aaa>', 'b&b', '"ccc"');
|
2235
|
-
|
2236
|
-
print('<html>
|
2237
|
-
<body>
|
2238
|
-
<p>Hello '); print($user); print('!</p>
|
2239
|
-
<table>
|
2240
|
-
'); $i = 0;
|
2241
|
-
for $item (@list) {
|
2242
|
-
print(' <tr bgcolor='); print(++$i % 2 == 0 ? '#FFCCCC' : '#CCCCFF'); print('">
|
2243
|
-
<td>'); print($i); print('</td>
|
2244
|
-
<td>'); print($item); print('</td>
|
2245
|
-
</tr>
|
2246
|
-
'); }
|
2247
|
-
print(' </table>
|
2248
|
-
</body>
|
2249
|
-
</html>
|
2250
|
-
');
|
2251
|
-
</pre>
|
2252
|
-
<br>
|
2253
|
-
|
2254
|
-
|
2255
|
-
<a name="lang-javascript"></a>
|
2256
|
-
<h3 class="section2">JavaScript</h3>
|
2257
|
-
<a name="example.ejs"></a>
|
2258
|
-
<div class="program_caption">
|
2259
|
-
example.ejs</div>
|
2260
|
-
<pre class="program"><strong><%
|
2261
|
-
var user = 'Erubis';
|
2262
|
-
var list = ['<aaa>', 'b&b', '"ccc"'];
|
2263
|
-
%></strong>
|
2264
|
-
<html>
|
2265
|
-
<body>
|
2266
|
-
<p>Hello <strong><%= user %></strong>!</p>
|
2267
|
-
<table>
|
2268
|
-
<tbody>
|
2269
|
-
<strong><% var i; %></strong>
|
2270
|
-
<strong><% for (i = 0; i < list.length; i++) { %></strong>
|
2271
|
-
<tr bgcolor="<strong><%= i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %></strong>">
|
2272
|
-
<td><strong><%= i + 1 %></strong></td>
|
2273
|
-
<td><strong><%= list[i] %></strong></td>
|
2274
|
-
</tr>
|
2275
|
-
<strong><% } %></strong>
|
2276
|
-
</tbody>
|
2277
|
-
</table>
|
2278
|
-
</body>
|
2279
|
-
</html>
|
2280
|
-
</pre>
|
2281
|
-
<a name="example_js.result"></a>
|
2282
|
-
<div class="terminal_caption">
|
2283
|
-
compiled source code</div>
|
2284
|
-
<pre class="terminal">$ erubis -l js example.ejs
|
2285
|
-
var _buf = [];
|
2286
|
-
var user = 'Erubis';
|
2287
|
-
var list = ['<aaa>', 'b&b', '"ccc"'];
|
2288
|
-
|
2289
|
-
_buf.push("<html>\n\
|
2290
|
-
<body>\n\
|
2291
|
-
<p>Hello "); _buf.push(user); _buf.push("!</p>\n\
|
2292
|
-
<table>\n\
|
2293
|
-
<tbody>\n");
|
2294
|
-
var i;
|
2295
|
-
for (i = 0; i < list.length; i++) {
|
2296
|
-
_buf.push(" <tr bgcolor=\""); _buf.push(i % 2 == 0 ? '#FFCCCC' : '#CCCCFF'); _buf.push("\">\n\
|
2297
|
-
<td>"); _buf.push(i + 1); _buf.push("</td>\n\
|
2298
|
-
<td>"); _buf.push(list[i]); _buf.push("</td>\n\
|
2299
|
-
</tr>\n");
|
2300
|
-
}
|
2301
|
-
_buf.push(" </tbody>\n\
|
2302
|
-
</table>\n\
|
2303
|
-
</body>\n\
|
2304
|
-
</html>\n");
|
2305
|
-
document.write(_buf.join(""));
|
2306
|
-
</pre>
|
2307
|
-
<p>If command-line option '<code>--docwrite=false</code>' is specified,
|
2308
|
-
'<code>_buf.join("");</code>' is used instead of '<code>document.write(_buf.join(""));</code>'.
|
2309
|
-
This is useful when passing converted source code to eval() function in JavaScript.
|
2310
|
-
</p>
|
2311
|
-
<p>You can pass <code>:docwrite=>false</code> to Erubis::Ejavascript.new() in your Ruby script.
|
2312
|
-
</p>
|
2313
|
-
<pre class="program">s = File.read('example.jshtml')
|
2314
|
-
engine = Erubis::Ejavascript.new(s, <code>:docwrite=>false</code>)
|
2315
|
-
</pre>
|
2316
|
-
<p>If you want to specify any JavaScript code, use '--postamble=...'.
|
2317
|
-
</p>
|
2318
|
-
<p>Notice that default value of 'docwrite' property will be false in the future release.
|
2319
|
-
</p>
|
2320
|
-
<br>
|
2321
|
-
|
2322
|
-
|
2323
|
-
<br>
|
2324
|
-
|
2325
|
-
|
2326
|
-
<a name="rails"></a>
|
2327
|
-
<h2 class="section1">Ruby on Rails Support</h2>
|
2328
|
-
<p>Erubis supports Ruby on Rails.
|
2329
|
-
This section describes how to use Erubis with Ruby on Rails.
|
2330
|
-
</p>
|
2331
|
-
<a name="rails-settings"></a>
|
2332
|
-
<h3 class="section2">Settings</h3>
|
2333
|
-
<p>Add the following code to your 'config/environment.rb' and restart web server.
|
2334
|
-
This replaces ERB in Rails by Erubis entirely.
|
2335
|
-
</p>
|
2336
|
-
<div class="program_caption">
|
2337
|
-
config/environment.rb</div>
|
2338
|
-
<pre class="program">require 'erubis/helpers/rails_helper'
|
2339
|
-
#Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby # or Erubis::FastEruby
|
2340
|
-
#Erubis::Helpers::RailsHelper.init_properties = {}
|
2341
|
-
#Erubis::Helpers::RailsHelper.show_src = nil
|
2342
|
-
#Erubis::Helpers::RailsHelper.preprocessing = false
|
2343
|
-
</pre>
|
2344
|
-
<p>Options:
|
2345
|
-
</p>
|
2346
|
-
<dl class="dl2">
|
2347
|
-
<dt class="dt2">
|
2348
|
-
Erubis::Helpers::RailsHelper.engine_class (=Erubis::Eruby)</dt>
|
2349
|
-
<dd class="dd2">
|
2350
|
-
<p> Erubis engine class (default Erubis::Eruby).
|
2351
|
-
</p>
|
2352
|
-
</dd>
|
2353
|
-
<dt class="dt2">
|
2354
|
-
Erubis::Helpers::RailsHelper.init_properties (={})</dt>
|
2355
|
-
<dd class="dd2">
|
2356
|
-
<p> Optional arguments for Erubis::Eruby#initialize() method (default {}).
|
2357
|
-
</p>
|
2358
|
-
</dd>
|
2359
|
-
<dt class="dt2">
|
2360
|
-
Erubis::Helpers::RailsHelper.show_src (=nil)</dt>
|
2361
|
-
<dd class="dd2">
|
2362
|
-
<p> Whether to print converted Ruby code into log file.
|
2363
|
-
If true, Erubis prints coverted code into log file.
|
2364
|
-
If false, Erubis doesn't.
|
2365
|
-
If nil, Erubis prints when ENV['RAILS_ENV'] == 'development'.
|
2366
|
-
Default is nil.
|
2367
|
-
</p>
|
2368
|
-
</dd>
|
2369
|
-
<dt class="dt2">
|
2370
|
-
Erubis::Helpers::RailsHelper.preprocessing (=false)</dt>
|
2371
|
-
<dd class="dd2">
|
2372
|
-
<p> Enable preprocessing if true (default false).
|
2373
|
-
</p>
|
2374
|
-
</dd>
|
2375
|
-
</dl>
|
2376
|
-
<br>
|
2377
|
-
|
2378
|
-
|
2379
|
-
<a name="rails-preprocessing"></a>
|
2380
|
-
<h3 class="section2">Preprosessing</h3>
|
2381
|
-
<p>Erubis supports preprocessing of template files.
|
2382
|
-
Preprocessing make your Ruby on Rails application about 20-40 percent faster.
|
2383
|
-
To enable preprocessing, set Erubis::Helpers::RailsHelper.preprocessing to true in your 'environment.rb' file.
|
2384
|
-
</p>
|
2385
|
-
<p>For example, assume the following template.
|
2386
|
-
This is slow because link_to() method is called every time when template is rendered.
|
2387
|
-
</p>
|
2388
|
-
<pre class="program"><%= link_to 'Create', :action=>'create' %>
|
2389
|
-
</pre>
|
2390
|
-
<p>The following is faster than the above, but not flexible because url is fixed.
|
2391
|
-
</p>
|
2392
|
-
<pre class="program"><a href="/users/create">Create</a>
|
2393
|
-
</pre>
|
2394
|
-
<p>Preprocessing solves this problem.
|
2395
|
-
If you use '[%= %]' instead of '<%= %>', preprocessor evaluate it only once when template is loaded.
|
2396
|
-
</p>
|
2397
|
-
<pre class="program"><strong>[%= link_to 'Create', :action=>'create'%]</strong>
|
2398
|
-
</pre>
|
2399
|
-
<p>The above is evaluated by preprocessor and replaced to the following code automatically.
|
2400
|
-
</p>
|
2401
|
-
<pre class="program"><a href="/users/create">Create</a>
|
2402
|
-
</pre>
|
2403
|
-
<p>Notice that this is done only once when template file is loaded.
|
2404
|
-
It means that link_to() method is not called when template is rendered.
|
2405
|
-
</p>
|
2406
|
-
<p>If link_to() method have variable arguments, use <code>_?()</code> helper method.
|
2407
|
-
</p>
|
2408
|
-
<pre class="program"><% for user in @users %>
|
2409
|
-
[%= link_to <strong>_?('user.name')</strong>, :action=>'show', :id=><strong>_?('user.id')</strong> %]
|
2410
|
-
<% end %>
|
2411
|
-
</pre>
|
2412
|
-
<p>The above is evaluated by preprocessor when template is loaded and expanded into the following code.
|
2413
|
-
This will be much faster because link_to() method is not called when rendering.
|
2414
|
-
</p>
|
2415
|
-
<pre class="program"><% for user in @users %>
|
2416
|
-
<a href="/users/show/<strong><%=user.id%></strong>"><strong><%=user.name%></strong></a>
|
2417
|
-
<% end %>
|
2418
|
-
</pre>
|
2419
|
-
<p>Preprocessing statement (<code>[% %]</code>) is also available as well as preprocessing expression (<code>[%= %]</code>).
|
2420
|
-
</p>
|
2421
|
-
<pre class="program"><select name="state">
|
2422
|
-
<option value="">-</option>
|
2423
|
-
<strong>[% for code in states.keys.sort %]</strong>
|
2424
|
-
<option value="<strong>[%= code %]</strong>"><strong>[%= states[code] %]</strong></option>
|
2425
|
-
<strong>[% end %]</strong>
|
2426
|
-
</select>
|
2427
|
-
</pre>
|
2428
|
-
<p>The above will be evaluated by preprocessor and expanded into the following when template is loaded.
|
2429
|
-
In the result, rendering speed will be much faster because for-loop is not executed when rendering.
|
2430
|
-
</p>
|
2431
|
-
<pre class="program"><select name="state">
|
2432
|
-
<option value="">-</option>
|
2433
|
-
<option value="AK">Alaska</option>
|
2434
|
-
<option value="AL">Alabama</option>
|
2435
|
-
<option value="AR">Arkansas</option>
|
2436
|
-
<option value="AS">American Samoa</option>
|
2437
|
-
<option value="AZ">Arizona</option>
|
2438
|
-
<option value="CA">California</option>
|
2439
|
-
<option value="CO">Colorado</option>
|
2440
|
-
....
|
2441
|
-
</select>
|
2442
|
-
</pre>
|
2443
|
-
<p>Notice that it is not recommended to use preprocessing with tag helpers,
|
2444
|
-
because tag helpers generate different html code when form parameter has errors or not.
|
2445
|
-
</p>
|
2446
|
-
<p>Helper methods of Ruby on Rails are divided into two groups.
|
2447
|
-
</p>
|
2448
|
-
<ul type="disc">
|
2449
|
-
<li>link_to() or _() (method of gettext package) are not need to call for every time
|
2450
|
-
as template is rendered because it returns same value when same arguments are passed.
|
2451
|
-
These methods can be got faster by preprocessing.
|
2452
|
-
</li>
|
2453
|
-
<li>Tag helper methods should be called for every time as template is rendered
|
2454
|
-
because it may return differrent value even if the same arguments are passed.
|
2455
|
-
Preprocessing is not available with these methods.
|
2456
|
-
</li>
|
2457
|
-
</ul>
|
2458
|
-
<p>In Ruby on Rails 2.0, <code>_?('user_id')</code> is OK but <code>_?('user.id')</code> is NG
|
2459
|
-
because the latter contains period ('.') character.
|
2460
|
-
</p>
|
2461
|
-
<pre class="program"><!-- NG in Rails 2.0, because _?('') contains period -->
|
2462
|
-
[%= link_to 'Edit', edit_user_path(<strong>_?('@user.id')</strong>) %]
|
2463
|
-
[%= link_to 'Show', <strong>@user</strong> %]
|
2464
|
-
[%= link_to 'Delete', <strong>@user</strong>, :confirm=>'OK?', :method=>:delete %]
|
2465
|
-
|
2466
|
-
<!-- OK in Rails 2.0 -->
|
2467
|
-
<strong><%= user_id = @user.id %></strong>
|
2468
|
-
[%= link_to 'Edit', edit_user_path(<strong>_?('user_id')</strong>) %]
|
2469
|
-
[%= link_to 'Show', <strong>:action=>'show', :id=>_?('user_id')</strong> %]
|
2470
|
-
[%= link_to 'Delete', <strong>{:action=>'destroy', :id=>_?('user_id')}</strong>,
|
2471
|
-
{:confirm=>'OK?', :method=>:delete} %]
|
2472
|
-
</pre>
|
2473
|
-
<br>
|
2474
|
-
|
2475
|
-
|
2476
|
-
<a name="rails-formhelpers"></a>
|
2477
|
-
<h3 class="section2">Form Helpers for Preprocessing</h3>
|
2478
|
-
<p><strong>(Experimental)</strong>
|
2479
|
-
</p>
|
2480
|
-
<p>Erubis provides form helper methods for preprocessing.
|
2481
|
-
These are defined in 'erubis/helpers/rails_form_helper.rb'.
|
2482
|
-
If you want to use it, require it and include Erubis::Helpers::RailsFormHelper in 'app/helpers/applition_helper.rb'
|
2483
|
-
</p>
|
2484
|
-
<div class="program_caption">
|
2485
|
-
app/helpers/xxx_helper.rb</div>
|
2486
|
-
<pre class="program">require 'erubis/helpers/rails_form_helper'
|
2487
|
-
module ApplicationHelper
|
2488
|
-
include Erubis::Helpers::RailsFormHelper
|
2489
|
-
end
|
2490
|
-
</pre>
|
2491
|
-
<p>Form helper methods defined in Erubis::Helpers::RailsFormHelper are named as 'pp_xxxx'
|
2492
|
-
('pp' represents preprocessing).
|
2493
|
-
</p>
|
2494
|
-
<p>Assume the following view template:
|
2495
|
-
</p>
|
2496
|
-
<div class="program_caption">
|
2497
|
-
_form.rhtml</div>
|
2498
|
-
<pre class="program"> <p>
|
2499
|
-
Name: <%= text_field :user, :name %>
|
2500
|
-
</p>
|
2501
|
-
<p>
|
2502
|
-
Name: <strong>[%= pp_text_field :user, :name %]</strong>
|
2503
|
-
</p>
|
2504
|
-
</pre>
|
2505
|
-
<p>Erubis preprocessor converts it to the following eRuby string:
|
2506
|
-
</p>
|
2507
|
-
<div class="program_caption">
|
2508
|
-
preprocessed</div>
|
2509
|
-
<pre class="program"> <p>
|
2510
|
-
Name: <%= text_field :user, :name %>
|
2511
|
-
</p>
|
2512
|
-
<p>
|
2513
|
-
Name: <strong><input id="stock_name" name="stock[name]" size="30" type="text" value="<%=h @stock.name%>" /></strong>
|
2514
|
-
</p>
|
2515
|
-
</pre>
|
2516
|
-
<p>Erubis converts it to the following Ruby code:
|
2517
|
-
</p>
|
2518
|
-
<div class="program_caption">
|
2519
|
-
Ruby code</div>
|
2520
|
-
<pre class="program"> _buf << ' <p>
|
2521
|
-
Name: '; _buf << ( text_field :stock, :name ).to_s; _buf << '
|
2522
|
-
'; _buf << ' </p>
|
2523
|
-
<p>
|
2524
|
-
Name: <input id="stock_name" name="stock[name]" size="30" type="text" value="'; _buf << (h @stock.name).to_s; _buf << '" />
|
2525
|
-
</p>
|
2526
|
-
';
|
2527
|
-
</pre>
|
2528
|
-
<p>The above Ruby code shows that text_field() is called everytime when rendering,
|
2529
|
-
but pp_text_field() is called only once when template is loaded.
|
2530
|
-
This means that pp_text_field() with preprocessing makes view layer very fast.
|
2531
|
-
</p>
|
2532
|
-
<p>Module Erubis::Helpers::RailsFormHelper defines the following form helper methods.
|
2533
|
-
</p>
|
2534
|
-
<ul type="disc">
|
2535
|
-
<li>pp_render_partial(basename)
|
2536
|
-
</li>
|
2537
|
-
<li>pp_form_tag(url_for_options={}, options={}, *parameters_for_url, &block)
|
2538
|
-
</li>
|
2539
|
-
<li>pp_text_field(object_name, method, options={})
|
2540
|
-
</li>
|
2541
|
-
<li>pp_password_field(object_name, method, options={})
|
2542
|
-
</li>
|
2543
|
-
<li>pp_hidden_field(object_name, method, options={})
|
2544
|
-
</li>
|
2545
|
-
<li>pp_file_field(object_name, method, options={})
|
2546
|
-
</li>
|
2547
|
-
<li>pp_text_area(object_name, method, options={})
|
2548
|
-
</li>
|
2549
|
-
<li>pp_check_box(object_name, method, options={}, checked_value="1", unchecked_value="0")
|
2550
|
-
</li>
|
2551
|
-
<li>pp_radio_button(object_name, method, tag_value, options={})
|
2552
|
-
</li>
|
2553
|
-
<li>pp_select(object, method, collection, options={}, html_options={})
|
2554
|
-
</li>
|
2555
|
-
<li>pp_collection_select(object, method, collection, value_method, text_method, options={}, html_options={})
|
2556
|
-
</li>
|
2557
|
-
<li>pp_country_select(object, method, priority_countries=nil, options={}, html_options={})
|
2558
|
-
</li>
|
2559
|
-
<li>pp_time_zone_select(object, method, priority_zones=nil, options={}, html_options={})
|
2560
|
-
</li>
|
2561
|
-
<li>pp_submit_tag(value="Save changes", options={})
|
2562
|
-
</li>
|
2563
|
-
<li>pp_image_submit_tag(source, options={})
|
2564
|
-
</li>
|
2565
|
-
</ul>
|
2566
|
-
<p>Notice that pp_form_for() is not provided.
|
2567
|
-
</p>
|
2568
|
-
<p><span style="color:#FF0000">CAUTION:</span> These are experimental and may not work in Ruby on Rails 2.0.
|
2569
|
-
</p>
|
2570
|
-
<br>
|
2571
|
-
|
2572
|
-
|
2573
|
-
<a name="rails-others"></a>
|
2574
|
-
<h3 class="section2">Others</h3>
|
2575
|
-
<ul type="disc">
|
2576
|
-
<li>ActionView::Helpers::CaptureHelper#capture() and ActionView::Helpers::Texthelper#concat() are available.
|
2577
|
-
</li>
|
2578
|
-
</ul>
|
2579
|
-
<ul type="disc">
|
2580
|
-
<li>Form helper methods are not tested in Ruby on Rails 2.0.
|
2581
|
-
</li>
|
2582
|
-
</ul>
|
2583
|
-
<ul type="disc">
|
2584
|
-
<li>ERB::Util.h() is redefined if you require 'erubis/helpers/rails_helper.rb'.
|
2585
|
-
Original definition of ERB::Util.h() is the following and it is slow
|
2586
|
-
because it scans string four times.
|
2587
|
-
<pre class="program"> def html_escape(s)
|
2588
|
-
s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
|
2589
|
-
end
|
2590
|
-
alias h html_escape
|
2591
|
-
</pre>
|
2592
|
-
<p> New definition in 'erubis/helpers/rails_helper.rb' is faster than the above
|
2593
|
-
because it scans string only once.
|
2594
|
-
</p>
|
2595
|
-
<pre class="program"> ESCAPE_TABLE = { '&'=>'&amp;', '<'=>'&lt;', '>'=>'&gt;', '"'=>'&quot;', "'"=>'&#039;', }
|
2596
|
-
def h(value)
|
2597
|
-
value.to_s.gsub(/[&<>"]/) { |s| ESCAPE_TABLE[s] }
|
2598
|
-
end
|
2599
|
-
</pre>
|
2600
|
-
<p> Notice that the new definition may be slow if string contains
|
2601
|
-
many '< > & "' characters because block is call many time.
|
2602
|
-
You should use ERB::Util.html_hscape() if string contains a lot of '< > & "'
|
2603
|
-
characters.
|
2604
|
-
</p>
|
2605
|
-
</li>
|
2606
|
-
</ul>
|
2607
|
-
<br>
|
2608
|
-
|
2609
|
-
|
2610
|
-
<br>
|
2611
|
-
|
2612
|
-
|
2613
|
-
<a name="topics"></a>
|
2614
|
-
<h2 class="section1">Other Topics</h2>
|
2615
|
-
<a name="'<%= =%>' and '<%= -%>'"></a>
|
2616
|
-
<h3 class="section2">'<%= =%>' and '<%= -%>'</h3>
|
2617
|
-
<p>Since 2.6.0, '<%= -%>' remove tail spaces and newline.
|
2618
|
-
This is for compatibiliy with ERB when trim mode is '-'.
|
2619
|
-
'<%= =%>' also removes tail spaces and newlines, and this is
|
2620
|
-
Erubis-original enhancement (cooler than '<%= -%>', isn't it?).
|
2621
|
-
</p>
|
2622
|
-
<a name="tailnewline.rhtml.comment_filter"></a>
|
2623
|
-
<div class="program_caption">
|
2624
|
-
tailnewline.rhtml</div>
|
2625
|
-
<pre class="program"><div>
|
2626
|
-
<%= @var -%> # or <%= @var =%>
|
2627
|
-
</div>
|
2628
|
-
</pre>
|
2629
|
-
<div class="terminal_caption">
|
2630
|
-
result (version 2.5.0):</div>
|
2631
|
-
<pre class="terminal">$ erubis -c '{var: "AAA\n"}' tailnewline.rhtml
|
2632
|
-
<div>
|
2633
|
-
AAA
|
2634
|
-
|
2635
|
-
</div>
|
2636
|
-
</pre>
|
2637
|
-
<a name="tail_260.result"></a>
|
2638
|
-
<div class="terminal_caption">
|
2639
|
-
result (version 2.6.0):</div>
|
2640
|
-
<pre class="terminal">$ erubis -c '{var: "AAA\n"}' tailnewline.rhtml
|
2641
|
-
<div>
|
2642
|
-
AAA
|
2643
|
-
</div>
|
2644
|
-
</pre>
|
2645
|
-
<br>
|
2646
|
-
|
2647
|
-
|
2648
|
-
<a name="'<%% %>' and '<%%= %>'"></a>
|
2649
|
-
<h3 class="section2">'<%% %>' and '<%%= %>'</h3>
|
2650
|
-
<p>Since 2.6.0, '<%% %>' and '<%%= %>' are converted into '<% %>' and '<%= %>' respectively.
|
2651
|
-
This is for compatibility with ERB.
|
2652
|
-
</p>
|
2653
|
-
<div class="program_caption">
|
2654
|
-
doublepercent.rhtml:</div>
|
2655
|
-
<pre class="program"><ul>
|
2656
|
-
<%% for item in @list %>
|
2657
|
-
<li><%%= item %></li>
|
2658
|
-
<%% end %>
|
2659
|
-
</ul>
|
2660
|
-
</pre>
|
2661
|
-
<div class="terminal_caption">
|
2662
|
-
result:</div>
|
2663
|
-
<pre class="terminal">$ erubis doublepercent.rhtml
|
2664
|
-
<ul>
|
2665
|
-
<% for item in @list %>
|
2666
|
-
<li><%= item %></li>
|
2667
|
-
<% end %>
|
2668
|
-
</ul>
|
2669
|
-
</pre>
|
2670
|
-
<br>
|
2671
|
-
|
2672
|
-
|
2673
|
-
<a name="topics-context-vs-binding"></a>
|
2674
|
-
<h3 class="section2">evaluate(context) v.s. result(binding)</h3>
|
2675
|
-
<p>It is recommended to use 'Erubis::Eruby#evaluate(context)' instead of 'Erubis::Eruby#result(binding)' because Ruby's Binding object has some problems.
|
2676
|
-
</p>
|
2677
|
-
<ul type="disc">
|
2678
|
-
<li>It is not able to specify variables to use.
|
2679
|
-
Using binding() method, all of local variables are passed to templates.
|
2680
|
-
</li>
|
2681
|
-
<li>Changing local variables in templates may affect to varialbes in main program.
|
2682
|
-
If you assign '10' to local variable 'x' in templates, it may change variable 'x' in main program unintendedly.
|
2683
|
-
</li>
|
2684
|
-
</ul>
|
2685
|
-
<p>The following example shows that assignment of some values into variable 'x' in templates affect to local variable 'x' in main program unintendedly.
|
2686
|
-
</p>
|
2687
|
-
<a name="template1.rhtml"></a>
|
2688
|
-
<div class="program_caption">
|
2689
|
-
template1.rhtml (intended to be passed 'items' from main program)</div>
|
2690
|
-
<pre class="program"><% for <strong>x</strong> in <strong>items</strong> %>
|
2691
|
-
item = <%= x %>
|
2692
|
-
<% end %>
|
2693
|
-
** debug: local variables=<%= local_variables().inspect() %>
|
2694
|
-
</pre>
|
2695
|
-
<a name="main_program1.rb"></a>
|
2696
|
-
<div class="program_caption">
|
2697
|
-
main_program1.rb (intended to pass 'items' to template)</div>
|
2698
|
-
<pre class="program">require 'erubis'
|
2699
|
-
eruby = Erubis::Eruby.new(File.read('template1.rhtml'))
|
2700
|
-
items = ['foo', 'bar', 'baz']
|
2701
|
-
x = 1
|
2702
|
-
## local variable 'x' and 'eruby' are passed to template as well as 'items'!
|
2703
|
-
print <strong>eruby.result(binding())</strong>
|
2704
|
-
## local variable 'x' is changed unintendedly because it is changed in template!
|
2705
|
-
puts "** debug: x=#{x.inspect}" #=> "baz"
|
2706
|
-
</pre>
|
2707
|
-
<a name="main_program1.result"></a>
|
2708
|
-
<div class="terminal_caption">
|
2709
|
-
Result:</div>
|
2710
|
-
<pre class="terminal">$ ruby main_program1.rb
|
2711
|
-
item = foo
|
2712
|
-
item = bar
|
2713
|
-
item = baz
|
2714
|
-
** debug: local variables=["eruby", "items", "x", "_buf"]
|
2715
|
-
** debug: x="baz"
|
2716
|
-
</pre>
|
2717
|
-
<p>This problem is caused because Ruby's Binding class is poor to use in template engine.
|
2718
|
-
Binding class should support the following features.
|
2719
|
-
</p>
|
2720
|
-
<pre class="program">b = Binding.new # create empty Binding object
|
2721
|
-
b['x'] = 1 # set local variables using binding object
|
2722
|
-
</pre>
|
2723
|
-
<p>But the above features are not implemented in Ruby.
|
2724
|
-
</p>
|
2725
|
-
<p>A pragmatic solution is to use 'Erubis::Eruby#evaluate(context)' instead of 'Erubis::Eruby#result(binding)'.
|
2726
|
-
'evaluate(context)' uses Erubis::Context object and instance variables instead of Binding object and local variables.
|
2727
|
-
</p>
|
2728
|
-
<a name="template2.rhtml"></a>
|
2729
|
-
<div class="program_caption">
|
2730
|
-
template2.rhtml (intended to be passed '@items' from main program)</div>
|
2731
|
-
<pre class="program"><% for <strong>x</strong> in <strong>@items</strong> %>
|
2732
|
-
item = <%= x %>
|
2733
|
-
<% end %>
|
2734
|
-
** debug: local variables=<%= local_variables().inspect() %>
|
2735
|
-
</pre>
|
2736
|
-
<a name="main_program2.rb"></a>
|
2737
|
-
<div class="program_caption">
|
2738
|
-
main_program2.rb (intended to pass '@items' to template)</div>
|
2739
|
-
<pre class="program">require 'erubis'
|
2740
|
-
eruby = Erubis::Eruby.new(File.read('template2.rhtml'))
|
2741
|
-
items = ['foo', 'bar', 'baz']
|
2742
|
-
x = 1
|
2743
|
-
## only 'items' are passed to template
|
2744
|
-
print <strong>eruby.evaluate(:items=>items)</strong>
|
2745
|
-
## local variable 'x' is not changed!
|
2746
|
-
puts "** debug: x=#{x.inspect}" #=> 1
|
2747
|
-
</pre>
|
2748
|
-
<a name="main_program2.result"></a>
|
2749
|
-
<div class="terminal_caption">
|
2750
|
-
Result:</div>
|
2751
|
-
<pre class="terminal">$ ruby main_program2.rb
|
2752
|
-
item = foo
|
2753
|
-
item = bar
|
2754
|
-
item = baz
|
2755
|
-
** debug: local variables=["_context", "x", "_buf"]
|
2756
|
-
** debug: x=1
|
2757
|
-
</pre>
|
2758
|
-
<br>
|
2759
|
-
|
2760
|
-
|
2761
|
-
<a name="topics-fasteruby"></a>
|
2762
|
-
<h3 class="section2">Class Erubis::FastEruby</h3>
|
2763
|
-
<p>[experimental]
|
2764
|
-
</p>
|
2765
|
-
<p>Erubis provides Erubis::FastEruby class which includes <a href="#interpolation-enhancer">InterpolationEnhancer</a> and <a href="#topics-benchmark">works faster than Erubis::Eruby class</a>.
|
2766
|
-
If you desire more speed, try Erubis::FastEruby class.
|
2767
|
-
</p>
|
2768
|
-
<a name="fasteruby.rhtml"></a>
|
2769
|
-
<div class="program_caption">
|
2770
|
-
File 'fasteruby.rhtml':</div>
|
2771
|
-
<pre class="program"><html>
|
2772
|
-
<body>
|
2773
|
-
<h1><%== @title %></h1>
|
2774
|
-
<table>
|
2775
|
-
<% i = 0 %>
|
2776
|
-
<% for item in @list %>
|
2777
|
-
<% i += 1 %>
|
2778
|
-
<tr>
|
2779
|
-
<td><%= i %></td>
|
2780
|
-
<td><%== item %></td>
|
2781
|
-
</tr>
|
2782
|
-
<% end %>
|
2783
|
-
</table>
|
2784
|
-
</body>
|
2785
|
-
</html>
|
2786
|
-
</pre>
|
2787
|
-
<a name="fasteruby.rb"></a>
|
2788
|
-
<div class="program_caption">
|
2789
|
-
File 'fasteruby.rb':</div>
|
2790
|
-
<pre class="program">require 'erubis'
|
2791
|
-
input = File.read('fasteruby.rhtml')
|
2792
|
-
eruby = <strong>Erubis::FastEruby.new(input)</strong> # create Eruby object
|
2793
|
-
|
2794
|
-
puts "---------- script source ---"
|
2795
|
-
puts eruby.src
|
2796
|
-
|
2797
|
-
puts "---------- result ----------"
|
2798
|
-
context = { :title=>'Example', :list=>['aaa', 'bbb', 'ccc'] }
|
2799
|
-
output = eruby.evaluate(context)
|
2800
|
-
print output
|
2801
|
-
</pre>
|
2802
|
-
<a name="fasteruby.result"></a>
|
2803
|
-
<div class="terminal_caption">
|
2804
|
-
output</div>
|
2805
|
-
<pre class="terminal">$ ruby fasteruby.rb
|
2806
|
-
---------- script source ---
|
2807
|
-
_buf = ''; _buf << <strong>%Q`</strong><html>
|
2808
|
-
<body>
|
2809
|
-
<h1><strong>#{Erubis::XmlHelper.escape_xml( @title )}</strong></h1>
|
2810
|
-
<table>\n<strong>`</strong>
|
2811
|
-
i = 0
|
2812
|
-
for item in @list
|
2813
|
-
i += 1
|
2814
|
-
_buf << <strong>%Q`</strong> <tr>
|
2815
|
-
<td><strong>#{ i }</strong></td>
|
2816
|
-
<td><strong>#{Erubis::XmlHelper.escape_xml( item )}</strong></td>
|
2817
|
-
</tr>\n<strong>`</strong>
|
2818
|
-
end
|
2819
|
-
_buf << <strong>%Q`</strong> </table>
|
2820
|
-
</body>
|
2821
|
-
</html>\n<strong>`</strong>
|
2822
|
-
_buf.to_s
|
2823
|
-
---------- result ----------
|
2824
|
-
<html>
|
2825
|
-
<body>
|
2826
|
-
<h1>Example</h1>
|
2827
|
-
<table>
|
2828
|
-
<tr>
|
2829
|
-
<td>1</td>
|
2830
|
-
<td>aaa</td>
|
2831
|
-
</tr>
|
2832
|
-
<tr>
|
2833
|
-
<td>2</td>
|
2834
|
-
<td>bbb</td>
|
2835
|
-
</tr>
|
2836
|
-
<tr>
|
2837
|
-
<td>3</td>
|
2838
|
-
<td>ccc</td>
|
2839
|
-
</tr>
|
2840
|
-
</table>
|
2841
|
-
</body>
|
2842
|
-
</html>
|
2843
|
-
</pre>
|
2844
|
-
<br>
|
2845
|
-
|
2846
|
-
|
2847
|
-
<a name="topics-syntax"></a>
|
2848
|
-
<h3 class="section2">Syntax Checking</h3>
|
2849
|
-
<p>Command-line option '-z' checks syntax. It is similar to 'erubis -x file.rhtml | ruby -wc', but it can take several file names.
|
2850
|
-
</p>
|
2851
|
-
<div class="terminal_caption">
|
2852
|
-
example of command-line option '-z'</div>
|
2853
|
-
<pre class="terminal">$ erubis <strong>-z</strong> app/views/*/*.rhtml
|
2854
|
-
Syntax OK
|
2855
|
-
</pre>
|
2856
|
-
<br>
|
2857
|
-
|
2858
|
-
|
2859
|
-
<a name="topics-caching"></a>
|
2860
|
-
<h3 class="section2">File Caching</h3>
|
2861
|
-
<p>Erubis::Eruby.load_file(filename) convert file into Ruby script and return Eruby object.
|
2862
|
-
In addition, it caches converted Ruby script into cache file (filename + '.cache') if cache file is old or not exist.
|
2863
|
-
If cache file exists and is newer than eruby file, Erubis::Eruby.load_file() loads cache file.
|
2864
|
-
</p>
|
2865
|
-
<div class="program_caption">
|
2866
|
-
example of Erubis::Eruby.load_file()</div>
|
2867
|
-
<pre class="program">require 'erubis'
|
2868
|
-
filename = 'example.rhtml'
|
2869
|
-
eruby = <strong>Erubis::Eruby.load_file(filename)</strong>
|
2870
|
-
cachename = filename + '.cache'
|
2871
|
-
if test(?f, cachename)
|
2872
|
-
puts "*** cache file '#{cachename}' created."
|
2873
|
-
end
|
2874
|
-
</pre>
|
2875
|
-
<p>Since 2.6.0, it is able to specify cache filename.
|
2876
|
-
</p>
|
2877
|
-
<div class="program_caption">
|
2878
|
-
specify cache filename.</div>
|
2879
|
-
<pre class="program">filename = 'example.rhtml'
|
2880
|
-
eruby = Erubis::Eruby.load_file(filename, :cachename=>filename+'.cache')
|
2881
|
-
</pre>
|
2882
|
-
<p>Caching makes Erubis about 40-50 percent faster than no-caching.
|
2883
|
-
See <a href="#topics-benchmark">benchmark</a> for details.
|
2884
|
-
</p>
|
2885
|
-
<br>
|
2886
|
-
|
2887
|
-
|
2888
|
-
<a name="topics-tinyeruby"></a>
|
2889
|
-
<h3 class="section2">Erubis::TinyEruby class</h3>
|
2890
|
-
<p>Erubis::TinyEruby class in 'erubis/tiny.rb' is the smallest implementation of eRuby.
|
2891
|
-
If you don't need any enhancements of Erubis and only require simple eRuby implementation,
|
2892
|
-
try Erubis::TinyEruby class.
|
2893
|
-
</p>
|
2894
|
-
<br>
|
2895
|
-
|
2896
|
-
|
2897
|
-
<a name="topics-php"></a>
|
2898
|
-
<h3 class="section2">NoTextEnhancer and NoCodeEnhancer in PHP</h3>
|
2899
|
-
<p>NoTextEnhancer and NoCodEnahncer are quite useful not only for eRuby but also for PHP.
|
2900
|
-
The former "drops" HTML text and show up embedded Ruby/PHP code
|
2901
|
-
and the latter drops embedded Ruby/PHP code and leave HTML text.
|
2902
|
-
</p>
|
2903
|
-
<p>For example, see the following PHP script.
|
2904
|
-
</p>
|
2905
|
-
<a name="notext-example.php"></a>
|
2906
|
-
<div class="program_caption">
|
2907
|
-
notext-example.php</div>
|
2908
|
-
<pre class="program"><html>
|
2909
|
-
<body>
|
2910
|
-
<h3>List</h3>
|
2911
|
-
<?php if (!$list || count($list) == 0) { ?>
|
2912
|
-
<p>not found.</p>
|
2913
|
-
<?php } else { ?>
|
2914
|
-
<table>
|
2915
|
-
<tbody>
|
2916
|
-
<?php $i = 0; ?>
|
2917
|
-
<?php foreach ($list as $item) { ?>
|
2918
|
-
<tr bgcolor="<?php echo ++$i % 2 == 1 ? '#FFCCCC' : '#CCCCFF'; ?>">
|
2919
|
-
<td><?php echo $item; ?></td>
|
2920
|
-
</tr>
|
2921
|
-
<?php } ?>
|
2922
|
-
</tbody>
|
2923
|
-
</table>
|
2924
|
-
<?php } ?>
|
2925
|
-
</body>
|
2926
|
-
</html>
|
2927
|
-
</pre>
|
2928
|
-
<p>This is complex because PHP code and HTML document are mixed.
|
2929
|
-
NoTextEnhancer can separate PHP code from HTML document.
|
2930
|
-
</p>
|
2931
|
-
<a name="notext-php.result"></a>
|
2932
|
-
<div class="terminal_caption">
|
2933
|
-
example of using NoTextEnhancer with PHP file</div>
|
2934
|
-
<pre class="terminal">$ erubis -l php --pi=php -N -E NoText --trim=false notext-example.php
|
2935
|
-
1:
|
2936
|
-
2:
|
2937
|
-
3:
|
2938
|
-
4: <?php if (!$list || count($list) == 0) { ?>
|
2939
|
-
5:
|
2940
|
-
6: <?php } else { ?>
|
2941
|
-
7:
|
2942
|
-
8:
|
2943
|
-
9: <?php $i = 0; ?>
|
2944
|
-
10: <?php foreach ($list as $item) { ?>
|
2945
|
-
11: <?php echo ++$i % 2 == 1 ? '#FFCCCC' : '#CCCCFF'; ?>
|
2946
|
-
12: <?php echo $item; ?>
|
2947
|
-
13:
|
2948
|
-
14: <?php } ?>
|
2949
|
-
15:
|
2950
|
-
16:
|
2951
|
-
17: <?php } ?>
|
2952
|
-
18:
|
2953
|
-
19:
|
2954
|
-
</pre>
|
2955
|
-
<p>In the same way, NoCodeEnhancer can extract HTML tags.
|
2956
|
-
</p>
|
2957
|
-
<a name="nocode-php.result"></a>
|
2958
|
-
<div class="terminal_caption">
|
2959
|
-
example of using NoCodeEnhancer with PHP file</div>
|
2960
|
-
<pre class="terminal">$ erubis -l php --pi=php -N -E NoCode --trim=false notext-example.php
|
2961
|
-
1: <html>
|
2962
|
-
2: <body>
|
2963
|
-
3: <h3>List</h3>
|
2964
|
-
4:
|
2965
|
-
5: <p>not found.</p>
|
2966
|
-
6:
|
2967
|
-
7: <table>
|
2968
|
-
8: <tbody>
|
2969
|
-
9:
|
2970
|
-
10:
|
2971
|
-
11: <tr bgcolor="">
|
2972
|
-
12: <td></td>
|
2973
|
-
13: </tr>
|
2974
|
-
14:
|
2975
|
-
15: </tbody>
|
2976
|
-
16: </table>
|
2977
|
-
17:
|
2978
|
-
18: </body>
|
2979
|
-
19: </html>
|
2980
|
-
</pre>
|
2981
|
-
<br>
|
2982
|
-
|
2983
|
-
|
2984
|
-
<a name="topcs-modruby"></a>
|
2985
|
-
<h3 class="section2">Helper Class for mod_ruby</h3>
|
2986
|
-
<p>Thanks Andrew R Jackson, he developed 'erubis-run.rb' which enables you to use Erubis with mod_ruby.
|
2987
|
-
</p>
|
2988
|
-
<ol type="1">
|
2989
|
-
<li>Copy 'erubis-2.6.2/contrib/erubis-run.rb' to the 'RUBYLIBDIR/apache' directory (for example '/usr/local/lib/ruby/1.8/apache') which contains 'ruby-run.rb', 'eruby-run.rb', and so on.
|
2990
|
-
<pre class="terminal">$ cd erubis-2.6.2/
|
2991
|
-
$ sudo copy contrib/erubis-run.rb /usr/local/lib/ruby/1.8/apache/
|
2992
|
-
</pre>
|
2993
|
-
</li>
|
2994
|
-
<li>Add the following example to your 'httpd.conf' (for example '/usr/local/apache2/conf/httpd.conf')
|
2995
|
-
<pre class="program">LoadModule ruby_module modules/mod_ruby.so
|
2996
|
-
<IfModule mod_ruby.c>
|
2997
|
-
RubyRequire apache/ruby-run
|
2998
|
-
RubyRequire apache/eruby-run
|
2999
|
-
RubyRequire apache/erubis-run
|
3000
|
-
<Location /erubis>
|
3001
|
-
SetHandler ruby-object
|
3002
|
-
RubyHandler Apache::ErubisRun.instance
|
3003
|
-
</Location>
|
3004
|
-
<Files *.rhtml>
|
3005
|
-
SetHandler ruby-object
|
3006
|
-
RubyHandler Apache::ErubisRun.instance
|
3007
|
-
</Files>
|
3008
|
-
</IfModule>
|
3009
|
-
</pre>
|
3010
|
-
</li>
|
3011
|
-
<li>Restart Apache web server.
|
3012
|
-
<pre class="terminal">$ sudo /usr/local/apache2/bin/apachectl stop
|
3013
|
-
$ sudo /usr/local/apache2/bin/apachectl start
|
3014
|
-
</pre>
|
3015
|
-
</li>
|
3016
|
-
<li>Create *.rhtml file, for example:
|
3017
|
-
<pre class="program"><html>
|
3018
|
-
<body>
|
3019
|
-
Now is <%= Time.now %>
|
3020
|
-
Erubis version is <%= Erubis::VERSION %>
|
3021
|
-
</body>
|
3022
|
-
</html>
|
3023
|
-
</pre>
|
3024
|
-
</li>
|
3025
|
-
<li>Change mode of your directory to be writable by web server process.
|
3026
|
-
<pre class="terminal">$ cd /usr/local/apache2/htdocs/erubis
|
3027
|
-
$ sudo chgrp daemon .
|
3028
|
-
$ sudo chmod 775 .
|
3029
|
-
</pre>
|
3030
|
-
</li>
|
3031
|
-
<li>Access the *.rhtml file and you'll get the web page.
|
3032
|
-
</li>
|
3033
|
-
</ol>
|
3034
|
-
<p>You must set your directories to be writable by web server process, because
|
3035
|
-
Apache::ErubisRun calls Erubis::Eruby.load_file() internally which creates cache files
|
3036
|
-
in the same directory in which '*.rhtml' file exists.
|
3037
|
-
</p>
|
3038
|
-
<br>
|
3039
|
-
|
3040
|
-
|
3041
|
-
<a name="topics-defmethod"></a>
|
3042
|
-
<h3 class="section2">Define method</h3>
|
3043
|
-
<p>Erubis::Eruby#def_method() defines instance method or singleton method.
|
3044
|
-
</p>
|
3045
|
-
<a name="def_method.rb"></a>
|
3046
|
-
<pre class="program">require 'erubis'
|
3047
|
-
s = "hello <%= name %>"
|
3048
|
-
eruby = Erubis::Eruby.new(s)
|
3049
|
-
filename = 'hello.rhtml'
|
3050
|
-
|
3051
|
-
## define instance method to Dummy class (or module)
|
3052
|
-
class Dummy; end
|
3053
|
-
<strong>eruby.def_method(Dummy, 'render(name)', filename)</strong> # filename is optional
|
3054
|
-
p Dummy.new.render('world') #=> "hello world"
|
3055
|
-
|
3056
|
-
## define singleton method to dummy object
|
3057
|
-
obj = Object.new
|
3058
|
-
<strong>eruby.def_method(obj, 'render(name)', filename)</strong> # filename is optional
|
3059
|
-
p obj.render('world') #=> "hello world"
|
3060
|
-
</pre>
|
3061
|
-
<br>
|
3062
|
-
|
3063
|
-
|
3064
|
-
<a name="topics-benchmark"></a>
|
3065
|
-
<h3 class="section2">Benchmark</h3>
|
3066
|
-
<p>A benchmark script is included in Erubis package at 'erubis-2.6.2/benchark/' directory.
|
3067
|
-
Here is an example result of benchmark.
|
3068
|
-
</p>
|
3069
|
-
<div class="terminal_caption">
|
3070
|
-
MacOS X 10.4 Tiger, Intel CoreDuo 1.83GHz, Ruby1.8.6, eruby1.0.5, gcc4.0.1</div>
|
3071
|
-
<pre class="terminal">$ cd erubis-2.6.2/benchmark/
|
3072
|
-
$ ruby bench.rb -n 10000 -m execute
|
3073
|
-
*** ntimes=10000, testmode=execute
|
3074
|
-
user system total real
|
3075
|
-
eruby 12.720000 0.240000 <strong>12.960000</strong> ( 12.971888)
|
3076
|
-
ERB 36.760000 0.350000 <strong>37.110000</strong> ( 37.112019)
|
3077
|
-
ERB(cached) 11.990000 0.440000 <strong>12.430000</strong> ( 12.430375)
|
3078
|
-
Erubis::Eruby 10.840000 0.300000 <strong>11.140000</strong> ( 11.144426)
|
3079
|
-
Erubis::Eruby(cached) 7.540000 0.410000 <strong>7.950000</strong> ( 7.969305)
|
3080
|
-
Erubis::FastEruby 10.440000 0.300000 <strong>10.740000</strong> ( 10.737808)
|
3081
|
-
Erubis::FastEruby(cached) 6.940000 0.410000 <strong>7.350000</strong> ( 7.353666)
|
3082
|
-
Erubis::TinyEruby 9.550000 0.290000 9.840000 ( 9.851729)
|
3083
|
-
Erubis::ArrayBufferEruby 11.010000 0.300000 11.310000 ( 11.314339)
|
3084
|
-
Erubis::PrintOutEruby 11.640000 0.290000 11.930000 ( 11.942141)
|
3085
|
-
Erubis::StdoutEruby 11.590000 0.300000 11.890000 ( 11.886512)
|
3086
|
-
</pre>
|
3087
|
-
<p>This shows that...
|
3088
|
-
</p>
|
3089
|
-
<ul type="disc">
|
3090
|
-
<li>Erubis::Eruby runs more than 10 percent faster than eruby.
|
3091
|
-
</li>
|
3092
|
-
<li>Erubis::Eruby runs about 3 times faster than ERB.
|
3093
|
-
</li>
|
3094
|
-
<li>Caching (by Erubis::Eruby.load_file()) makes Erubis about 40-50 percent faster.
|
3095
|
-
</li>
|
3096
|
-
<li>Erubis::FastEruby is a litte faster than Erubis::Eruby.
|
3097
|
-
</li>
|
3098
|
-
<li>Array buffer (ArrayBufferEnhancer) is a little slower than string buffer (StringBufferEnhancer which Erubis::Eruby includes)
|
3099
|
-
</li>
|
3100
|
-
<li>$stdout and print() make Erubis a little slower.
|
3101
|
-
</li>
|
3102
|
-
<li>Erubis::TinyEruby (at 'erubis/tiny.rb') is the fastest in all eRuby implementations when no caching.
|
3103
|
-
</li>
|
3104
|
-
</ul>
|
3105
|
-
<p>Escaping HTML characters (such as '< > & "') makes Erubis more faster than eruby and ERB,
|
3106
|
-
because Erubis::XmlHelper#escape_xml() works faster than CGI.escapeHTML() and ERB::Util#h().
|
3107
|
-
The following shows that Erubis runs more than 40 percent (when no-cached) or 90 percent (when cached) faster than eruby if HTML characters are escaped.
|
3108
|
-
</p>
|
3109
|
-
<div class="terminal_caption">
|
3110
|
-
When escaping HTML characters with option '-e'</div>
|
3111
|
-
<pre class="terminal">$ ruby bench.rb -n 10000 -m execute -ep
|
3112
|
-
*** ntimes=10000, testmode=execute
|
3113
|
-
user system total real
|
3114
|
-
eruby 21.700000 0.290000 <strong>21.990000</strong> ( 22.050687)
|
3115
|
-
ERB 45.140000 0.390000 <strong>45.530000</strong> ( 45.536976)
|
3116
|
-
ERB(cached) 20.340000 0.470000 <strong>20.810000</strong> ( 20.822653)
|
3117
|
-
Erubis::Eruby 14.830000 0.310000 <strong>15.140000</strong> ( 15.147930)
|
3118
|
-
Erubis::Eruby(cached) 11.090000 0.420000 <strong>11.510000</strong> ( 11.514954)
|
3119
|
-
Erubis::FastEruby 14.850000 0.310000 <strong>15.160000</strong> ( 15.172499)
|
3120
|
-
Erubis::FastEruby(cached) 10.970000 0.430000 <strong>11.400000</strong> ( 11.399605)
|
3121
|
-
Erubis::ArrayBufferEruby 14.970000 0.300000 15.270000 ( 15.281061)
|
3122
|
-
Erubis::PrintOutEruby 15.780000 0.300000 16.080000 ( 16.088289)
|
3123
|
-
Erubis::StdoutEruby 15.840000 0.310000 16.150000 ( 16.235338)
|
3124
|
-
</pre>
|
3125
|
-
<br>
|
3126
|
-
|
3127
|
-
|
3128
|
-
<br>
|
3129
|
-
|
3130
|
-
|
3131
|
-
<a name="command"></a>
|
3132
|
-
<h2 class="section1">Command Reference</h2>
|
3133
|
-
<a name="command-usage"></a>
|
3134
|
-
<h3 class="section2">Usage</h3>
|
3135
|
-
<p>erubis [..options..] [<em>file</em> ...]
|
3136
|
-
</p>
|
3137
|
-
<br>
|
3138
|
-
|
3139
|
-
|
3140
|
-
<a name="command-options"></a>
|
3141
|
-
<h3 class="section2">Options</h3>
|
3142
|
-
<dl class="dl3" compact>
|
3143
|
-
<dt class="dt3"><b>
|
3144
|
-
-h, --help </b></dt>
|
3145
|
-
<dd class="dd3">
|
3146
|
-
Help.
|
3147
|
-
</dd>
|
3148
|
-
<dt class="dt3"><b>
|
3149
|
-
-v </b></dt>
|
3150
|
-
<dd class="dd3">
|
3151
|
-
Release version.
|
3152
|
-
</dd>
|
3153
|
-
<dt class="dt3"><b>
|
3154
|
-
-x </b></dt>
|
3155
|
-
<dd class="dd3">
|
3156
|
-
Show compiled source.
|
3157
|
-
</dd>
|
3158
|
-
<dt class="dt3"><b>
|
3159
|
-
-X </b></dt>
|
3160
|
-
<dd class="dd3">
|
3161
|
-
Show compiled source but only Ruby code.
|
3162
|
-
This is equivarent to '-E NoText'.
|
3163
|
-
</dd>
|
3164
|
-
<dt class="dt3"><b>
|
3165
|
-
-N </b></dt>
|
3166
|
-
<dd class="dd3">
|
3167
|
-
Numbering: add line numbers. (for '-x/-X')
|
3168
|
-
</dd>
|
3169
|
-
<dt class="dt3"><b>
|
3170
|
-
-U </b></dt>
|
3171
|
-
<dd class="dd3">
|
3172
|
-
Unique mode: zip empty lines into a line. (for '-x/-X')
|
3173
|
-
</dd>
|
3174
|
-
<dt class="dt3"><b>
|
3175
|
-
-C </b></dt>
|
3176
|
-
<dd class="dd3">
|
3177
|
-
Compact: remove empty lines. (for '-x/-X')
|
3178
|
-
</dd>
|
3179
|
-
<dt class="dt3"><b>
|
3180
|
-
-b </b></dt>
|
3181
|
-
<dd class="dd3">
|
3182
|
-
Body only: no preamble nor postamble. (for '-x/-X')
|
3183
|
-
This is equivarent to '--preamble=false --postamble=false'.
|
3184
|
-
</dd>
|
3185
|
-
<dt class="dt3"><b>
|
3186
|
-
-z </b></dt>
|
3187
|
-
<dd class="dd3">
|
3188
|
-
Syntax checking.
|
3189
|
-
</dd>
|
3190
|
-
<dt class="dt3"><b>
|
3191
|
-
-e </b></dt>
|
3192
|
-
<dd class="dd3">
|
3193
|
-
Escape. This is equivarent to '-E Escape'.
|
3194
|
-
</dd>
|
3195
|
-
<dt class="dt3"><b>
|
3196
|
-
-p pattern </b></dt>
|
3197
|
-
<dd class="dd3">
|
3198
|
-
Embedded pattern (default '<% %>').
|
3199
|
-
This is equivarent to '--pattern=<em>pattern</em>'.
|
3200
|
-
</dd>
|
3201
|
-
<dt class="dt3"><b>
|
3202
|
-
-l lang </b></dt>
|
3203
|
-
<dd class="dd3">
|
3204
|
-
Language name.
|
3205
|
-
This option makes erubis command to compile script but no execute.
|
3206
|
-
</dd>
|
3207
|
-
<dt class="dt3"><b>
|
3208
|
-
-E enhacers </b></dt>
|
3209
|
-
<dd class="dd3">
|
3210
|
-
Enhancer name (Escape, PercentLine, ...).
|
3211
|
-
It is able to specify several enhancer name separating with ','
|
3212
|
-
(ex. -f Escape,PercentLine,HeaderFooter).
|
3213
|
-
</dd>
|
3214
|
-
<dt class="dt3"><b>
|
3215
|
-
-I path </b></dt>
|
3216
|
-
<dd class="dd3">
|
3217
|
-
Require library path ($:).
|
3218
|
-
It is able to specify several paths separating with ','
|
3219
|
-
(ex. -f path1,path2,path3).
|
3220
|
-
</dd>
|
3221
|
-
<dt class="dt3"><b>
|
3222
|
-
-K kanji </b></dt>
|
3223
|
-
<dd class="dd3">
|
3224
|
-
Kanji code (euc, sjis, utf8, or none) (default none).
|
3225
|
-
</dd>
|
3226
|
-
<dt class="dt3"><b>
|
3227
|
-
-f datafile </b></dt>
|
3228
|
-
<dd class="dd3">
|
3229
|
-
Context data file in YAML format ('*.yaml', '*.yml') or
|
3230
|
-
Ruby script ('*.rb').
|
3231
|
-
It is able to specify several filenames separating with ','
|
3232
|
-
(ex. -f file1,file2,file3).
|
3233
|
-
</dd>
|
3234
|
-
<dt class="dt3"><b>
|
3235
|
-
-c context </b></dt>
|
3236
|
-
<dd class="dd3">
|
3237
|
-
Context data string in YAML inline style or Ruby code.
|
3238
|
-
</dd>
|
3239
|
-
<dt class="dt3"><b>
|
3240
|
-
-T </b></dt>
|
3241
|
-
<dd class="dd3">
|
3242
|
-
Don't expand tab characters in YAML file.
|
3243
|
-
</dd>
|
3244
|
-
<dt class="dt3"><b>
|
3245
|
-
-S </b></dt>
|
3246
|
-
<dd class="dd3">
|
3247
|
-
Convert mapping key from string to symbol in YAML file.
|
3248
|
-
</dd>
|
3249
|
-
<dt class="dt3"><b>
|
3250
|
-
-B </b></dt>
|
3251
|
-
<dd class="dd3">
|
3252
|
-
invoke Eruby#result() instead of Eruby#evaluate()
|
3253
|
-
</dd>
|
3254
|
-
<dt class="dt3"><b>
|
3255
|
-
--pi[=name] </b></dt>
|
3256
|
-
<dd class="dd3">
|
3257
|
-
parse '<?name ... ?>' instead of '<% ... %>'
|
3258
|
-
</dd>
|
3259
|
-
<dt class="dt3"><b>
|
3260
|
-
--trim=false </b></dt>
|
3261
|
-
<dd class="dd3">
|
3262
|
-
No trimming spaces around '<% %>'.
|
3263
|
-
</dd>
|
3264
|
-
</dl>
|
3265
|
-
<br>
|
3266
|
-
|
3267
|
-
|
3268
|
-
<a name="command-props"></a>
|
3269
|
-
<h3 class="section2">Properties</h3>
|
3270
|
-
<p>Some Eruby classes can take optional properties to change it's compile option.
|
3271
|
-
For example, property '--indent=" "' may change indentation of compiled source code.
|
3272
|
-
Try 'erubis -h' for details.
|
3273
|
-
</p>
|
3274
|
-
<br>
|
3275
|
-
|
3276
|
-
|
3277
|
-
<br>
|
3278
|
-
|
3279
|
-
|
3280
|
-
|
3281
|
-
</div>
|
3282
|
-
</blockquote>
|
3283
|
-
|
3284
|
-
</body>
|
3285
|
-
</html>
|