aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-10-06 02:05:36 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-10-06 02:05:36 +0000
commita9f34eaa0f07a56a2de674cb5ec604a722e67310 (patch)
tree330bac51ea5442db70b46acca89df997ef073604 /railties
parenteb54de9992dedfcc6b42613a06480af4d0783bf0 (diff)
downloadrails-a9f34eaa0f07a56a2de674cb5ec604a722e67310.tar.gz
rails-a9f34eaa0f07a56a2de674cb5ec604a722e67310.tar.bz2
rails-a9f34eaa0f07a56a2de674cb5ec604a722e67310.zip
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
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/Rakefile4
-rw-r--r--railties/bin/breakpointer3
-rw-r--r--railties/bin/console3
-rw-r--r--railties/bin/destroy3
-rw-r--r--railties/bin/generate3
-rw-r--r--railties/bin/perform3
-rw-r--r--railties/bin/process3
-rw-r--r--[-rwxr-xr-x]railties/bin/runner (renamed from railties/bin/run)2
-rw-r--r--railties/bin/server3
-rw-r--r--railties/lib/commands.rb10
-rw-r--r--railties/lib/commands/perform.rb2
-rw-r--r--railties/lib/commands/process/reaper.rb7
-rw-r--r--railties/lib/rails_generator/generators/applications/app/app_generator.rb5
14 files changed, 42 insertions, 11 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 39fb889f52..720ac08fd9 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -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]
diff --git a/railties/Rakefile b/railties/Rakefile
index b46666e440..03ebb18de8 100644
--- a/railties/Rakefile
+++ b/railties/Rakefile
@@ -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 )
diff --git a/railties/bin/breakpointer b/railties/bin/breakpointer
new file mode 100644
index 0000000000..2918f8c152
--- /dev/null
+++ b/railties/bin/breakpointer
@@ -0,0 +1,3 @@
+#!/usr/local/bin/ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/breakpointer' \ No newline at end of file
diff --git a/railties/bin/console b/railties/bin/console
new file mode 100644
index 0000000000..f2143e5719
--- /dev/null
+++ b/railties/bin/console
@@ -0,0 +1,3 @@
+#!/usr/local/bin/ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/console' \ No newline at end of file
diff --git a/railties/bin/destroy b/railties/bin/destroy
new file mode 100644
index 0000000000..c2799bd20d
--- /dev/null
+++ b/railties/bin/destroy
@@ -0,0 +1,3 @@
+#!/usr/local/bin/ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/destroy' \ No newline at end of file
diff --git a/railties/bin/generate b/railties/bin/generate
new file mode 100644
index 0000000000..d8a1599870
--- /dev/null
+++ b/railties/bin/generate
@@ -0,0 +1,3 @@
+#!/usr/local/bin/ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/generate' \ No newline at end of file
diff --git a/railties/bin/perform b/railties/bin/perform
new file mode 100644
index 0000000000..5eb8ab0f87
--- /dev/null
+++ b/railties/bin/perform
@@ -0,0 +1,3 @@
+#!/usr/local/bin/ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/perform' \ No newline at end of file
diff --git a/railties/bin/process b/railties/bin/process
new file mode 100644
index 0000000000..13df54f90f
--- /dev/null
+++ b/railties/bin/process
@@ -0,0 +1,3 @@
+#!/usr/local/bin/ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/process' \ No newline at end of file
diff --git a/railties/bin/run b/railties/bin/runner
index 5490bc9336..cd2496d6a0 100755..100644
--- a/railties/bin/run
+++ b/railties/bin/runner
@@ -1,3 +1,3 @@
#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/boot'
-require "commands" \ No newline at end of file
+require 'commands/runner' \ No newline at end of file
diff --git a/railties/bin/server b/railties/bin/server
new file mode 100644
index 0000000000..59d8259788
--- /dev/null
+++ b/railties/bin/server
@@ -0,0 +1,3 @@
+#!/usr/local/bin/ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/server' \ No newline at end of file
diff --git a/railties/lib/commands.rb b/railties/lib/commands.rb
index cf7716fc83..841e98a0dc 100644
--- a/railties/lib/commands.rb
+++ b/railties/lib/commands.rb
@@ -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 \ No newline at end of file
diff --git a/railties/lib/commands/perform.rb b/railties/lib/commands/perform.rb
index ae45e7e633..6c09565896 100644
--- a/railties/lib/commands/perform.rb
+++ b/railties/lib/commands/perform.rb
@@ -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 \ No newline at end of file
diff --git a/railties/lib/commands/process/reaper.rb b/railties/lib/commands/process/reaper.rb
index 27c05ed5ce..b5b82c310f 100644
--- a/railties/lib/commands/process/reaper.rb
+++ b/railties/lib/commands/process/reaper.rb
@@ -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
diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
index 1d5a864de4..4934379669 100644
--- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb
+++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -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