aboutsummaryrefslogtreecommitdiffstats
path: root/railties/bin/console
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-16 15:47:04 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-16 15:47:04 +0000
commitcc88e5a61562d7421190c97cda89474bcadad382 (patch)
tree4782c82ea6105d6ef335e0bcedeb8aaa43328894 /railties/bin/console
parentb8f8776f0cffc1b73719f16513a5721d77b19186 (diff)
downloadrails-cc88e5a61562d7421190c97cda89474bcadad382.tar.gz
rails-cc88e5a61562d7421190c97cda89474bcadad382.tar.bz2
rails-cc88e5a61562d7421190c97cda89474bcadad382.zip
Renamed script/envcon to script/console
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/bin/console')
-rw-r--r--railties/bin/console30
1 files changed, 30 insertions, 0 deletions
diff --git a/railties/bin/console b/railties/bin/console
new file mode 100644
index 0000000000..c64e2a3966
--- /dev/null
+++ b/railties/bin/console
@@ -0,0 +1,30 @@
+#!/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 \ No newline at end of file