Added script/runner which can be used to run code inside the environment by...

Added script/runner which can be used to run code inside the environment by eval'ing the first parameter

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@939 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 16287608
*SVN*
* Added script/runner which can be used to run code inside the environment by eval'ing the first parameter. Examples:
./script/runner 'ReminderService.deliver'
./script/runner 'Mailer.receive(STDIN.read)'
This makes it easier to do CRON and postfix scripts without actually making a script just to trigger 1 line of code.
* Fixed webrick_server cookie handling to allow multiple cookes to be set at once #800, #813 [dave@cherryville.org]
* Fixed the Rakefile's interaction with postgresql to:
1. Use PGPASSWORD and PGHOST in the environment to fix prompting for
passwords when connecting to a remote db and local socket connections.
2. Added a '-x' flag to pg_dump which stops it dumping privileges #807 [rasputnik]
2. Add a '-x' flag to pg_dump which stops it dumping privileges #807 [rasputnik]
3. Quote the user name and use template0 when dumping so the functions doesn't get dumped too #855 [pburleson]
4. Use the port if available #875 [madrobby]
......
......@@ -21,7 +21,7 @@ TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
LOG_FILES = %w( server.log development.log test.log production.log )
HTML_FILES = %w( 404.html 500.html index.html favicon.ico )
BIN_FILES = %w( generate destroy breakpointer console server update )
BIN_FILES = %w( generate destroy breakpointer console server update runner )
VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties )
......
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/environment'
eval(ARGV.first)
\ No newline at end of file
......@@ -47,7 +47,7 @@ def manifest
m.file "environments/test.rb", "config/environments/test.rb"
# Scripts
%w(console console_sandbox.rb destroy generate server).each do |file|
%w(console console_sandbox.rb destroy generate server runner).each do |file|
m.file "bin/#{file}", "script/#{file}", script_options
end
if options[:gem]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册