diff options
author | Marcel Molina <marcel@vernix.org> | 2006-03-21 20:07:41 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2006-03-21 20:07:41 +0000 |
commit | 330823687bbae1c05af6545912377d317300c1bb (patch) | |
tree | 17e75ff504d53ab55fcba14462016ec18172f6f4 /railties/lib | |
parent | 6fbf40823851c9f99c86c1287af0cfca725776e0 (diff) | |
download | rails-330823687bbae1c05af6545912377d317300c1bb.tar.gz rails-330823687bbae1c05af6545912377d317300c1bb.tar.bz2 rails-330823687bbae1c05af6545912377d317300c1bb.zip |
Make all ActionView helpers available in the console for debugging purposes.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4008 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/commands/console.rb | 1 | ||||
-rw-r--r-- | railties/lib/console_with_helpers.rb | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/railties/lib/commands/console.rb b/railties/lib/commands/console.rb index 3ea1107445..3cc9fcbdb1 100644 --- a/railties/lib/commands/console.rb +++ b/railties/lib/commands/console.rb @@ -13,6 +13,7 @@ libs = " -r irb/completion" libs << " -r #{RAILS_ROOT}/config/environment" libs << " -r console_app" libs << " -r console_sandbox" if options[:sandbox] +libs << " -r console_with_helpers" ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development' if options[:sandbox] diff --git a/railties/lib/console_with_helpers.rb b/railties/lib/console_with_helpers.rb new file mode 100644 index 0000000000..cb317583e3 --- /dev/null +++ b/railties/lib/console_with_helpers.rb @@ -0,0 +1,15 @@ +module Kernel + def include_all_modules_from(parent_module) + parent_module.constants.each do |const| + mod = parent_module.const_get(const) + if mod.class == Module + send(:include, mod) + include_all_modules_from(mod) + end + end + end +end + +require 'application' +@controller = ApplicationController.new +include_all_modules_from ActionView |