diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-17 19:36:49 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-17 19:36:49 +0000 |
commit | 7cac2b5e73165d17eb42f0031deb6485513b980b (patch) | |
tree | 9f42e16805ed74bbc85238c6c00c996f72650f84 /railties/bin | |
parent | bc574a86ac3b19108341af9deb2d23609d44d5c0 (diff) | |
download | rails-7cac2b5e73165d17eb42f0031deb6485513b980b.tar.gz rails-7cac2b5e73165d17eb42f0031deb6485513b980b.tar.bz2 rails-7cac2b5e73165d17eb42f0031deb6485513b980b.zip |
Changed script/console to default to development environment and drop --no-inspect (I caed) #650 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/bin')
-rw-r--r-- | railties/bin/console | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/railties/bin/console b/railties/bin/console index f381c7e964..a946d1a08a 100644 --- a/railties/bin/console +++ b/railties/bin/console @@ -1,35 +1,5 @@ #!/usr/local/bin/ruby - -if ARGV[0] - ENV['RAILS_ENV'] = ARGV[0] - puts "Loading environment..." - if RUBY_PLATFORM =~ /mswin32/ - irb_name = "irb.bat" - else - irb_name = 'irb' - end - exec "#{irb_name} -r config/environment.rb -r irb/completion --noinspect" -else - puts <<-HELP - -NAME - console - interact with the domain model through a environment console (on IRB) - -SYNOPSIS - console [environment] - -DESCRIPTION - Starts an environment console using IRB that lets you manipulate and interrogate - the domain model or even trigger controller actions. The database connection and - configuration available to the web application is already setup. - - Tab completion is available to see classes and methods on individual objects. - -EXAMPLE - console production - - This will initialize the production environment (as setup in config/database.yml - and config/environments/production.rb). You would now be ready to start requiring - models using require_dependency. -HELP -end +ENV['RAILS_ENV'] = ARGV[0] || 'development' +puts "Loading environment: #{ENV['RAILS_ENV']}" +irb = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb' +exec "#{irb} -r config/environment.rb -r irb/completion" |