1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Backed out of script/run portal idea. Muscle memory too deep

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-10-06 02:05:36 +00:00
parent eb54de9992
commit a9f34eaa0f
14 changed files with 42 additions and 11 deletions

View file

@ -2,8 +2,6 @@
* Add experimental plugin support #2335
* Removed all the scripts in script/* and replaced it with one generic portal: script/run
* Made Rakefile aware of new .js files in script.aculo.us [Thomas Fuchs]
* Make table_name and controller_name in generators honor AR::Base.pluralize_table_names. #1216 #2213 [kazuhiko@fdiary.net]

View file

@ -26,7 +26,7 @@ RUBY_FORGE_USER = "webster132"
# end
BASE_DIRS = %w( app config/environments components db doc log lib lib/tasks public script test vendor )
BASE_DIRS = %w( app config/environments components db doc log lib lib/tasks public script test vendor vendor/plugins )
APP_DIRS = %w( apis models controllers helpers views views/layouts )
PUBLIC_DIRS = %w( images javascripts stylesheets )
TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
@ -36,7 +36,7 @@ HTML_FILES = %w( 404.html 500.html index.html robots.txt favicon.ico
javascripts/prototype.js javascripts/scriptaculous.js
javascripts/effects.js javascripts/dragdrop.js javascripts/controls.js
javascripts/util.js javascripts/slider.js )
BIN_FILES = %w( run )
BIN_FILES = %w( breakpointer console destroy generate perform process run runner server )
VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties )

View file

@ -0,0 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/breakpointer'

3
railties/bin/console Normal file
View file

@ -0,0 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/console'

3
railties/bin/destroy Normal file
View file

@ -0,0 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/destroy'

3
railties/bin/generate Normal file
View file

@ -0,0 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate'

3
railties/bin/perform Normal file
View file

@ -0,0 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/perform'

3
railties/bin/process Normal file
View file

@ -0,0 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/process'

2
railties/bin/run → railties/bin/runner Executable file → Normal file
View file

@ -1,3 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
require "commands"
require 'commands/runner'

3
railties/bin/server Normal file
View file

@ -0,0 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/server'

View file

@ -3,5 +3,15 @@ commands = Dir["#{File.dirname(__FILE__)}/commands/*.rb"].collect { |file_path|
if commands.include?(ARGV.first)
require "#{File.dirname(__FILE__)}/commands/#{ARGV.shift}"
else
puts <<-USAGE
The 'run' provides a unified access point for all the default Rails' commands.
Usage: ./script/run <command> [OPTIONS]
Examples:
./script/run generate controller Admin
./script/run process reaper
USAGE
puts "Choose: #{commands.join(", ")}"
end

View file

@ -1,5 +1,5 @@
if %w( benchmarker profiler ).include?(ARGV.first)
require "#{File.dirname(__FILE__)}/process/#{ARGV.shift}"
else
puts "Choose either reaper, spawner, or spinner"
puts "Choose either benchmarker or profiler"
end

View file

@ -77,19 +77,18 @@ ARGV.options do |opts|
opts.on <<-EOF
Description:
The reaper is used to reload, gracefully exit, and forcefully exit FCGI processes
The reaper is used to restart, reload, gracefully exit, and forcefully exit FCGI processes
running a Rails Dispatcher. This is commonly done when a new version of the application
is available, so the existing processes can be updated to use the latest code.
The reaper actions are:
* restart : Restarts the application by reloading both application and framework code
* reload : Only reloads the application, but not the framework (like the development environment)
* graceful: Marks all of the processes for exit after the next request
* kill : Forcefully exists all processes regardless of whether they're currently serving a request
Graceful exist is the most common and default action. But since the processes won't exist until after
their next request, it's often necessary to ensure that such a request occurs right after they've been
marked. That's what nudging is for.
Restart is the most common and default action.
A nudge is simply a request to a URL where the dispatcher is serving. You should perform one nudge per
FCGI process you have running if they're setup in a round-robin. Be sure to do one nudge per FCGI process

View file

@ -44,7 +44,9 @@ class AppGenerator < Rails::Generator::Base
m.file "environments/test.rb", "config/environments/test.rb"
# Scripts
m.file "bin/run", "script/run", script_options
%w( breakpointer console destroy generate perform process run runner server ).each do |file|
m.file "bin/#{file}", "script/#{file}", script_options
end
# Dispatches
m.file "dispatches/dispatch.rb", "public/dispatch.rb", script_options
@ -117,5 +119,6 @@ class AppGenerator < Rails::Generator::Base
test/mocks/test
test/unit
vendor
vendor/plugins
)
end