1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/bin/console
David Heinemeier Hansson cc88e5a615 Renamed script/envcon to script/console
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 15:47:04 +00:00

30 lines
No EOL
918 B
Ruby

#!/usr/local/bin/ruby
if ARGV[0]
ENV['RAILS_ENV'] = ARGV[0]
puts "Loading environment..."
exec "irb -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