Changed script/console to default to development environment and drop...

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
上级 bc574a86
*SVN*
* Changed script/console to default to development environment and drop --no-inspect #650 [bitsweat]
* Added that the 'fixture :posts' syntax can be used for has_and_belongs_to_many fixtures where a model doesn't exist #572 [bitsweat]
* Added that running test_units and test_functional now performs the clone_structure_to_test as well #566 [rasputnik]
......
#!/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"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册