public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Clean up the act of commands

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2412 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
dhh (author)
Thu Sep 29 05:33:48 -0700 2005
commit  d219d54930a68a9c5de3705d05d5d464e5e51b54
tree    4544f6d4dfa28de85ddf35032d9eccf1d4d49729
parent  0a0ac868453e9d8d9ee1dac6a7eb274772235b05
...
1
2
 
 
 
 
3
4
 
5
6
...
 
 
1
2
3
4
5
 
6
7
8
0
@@ -1,5 +1,7 @@
0
-if %w( console perform process runner server ).include?(ARGV.first)
0
- require "#{File.dirname(__FILE__)}/process/#{ARGV.shift}"
0
+commands = Dir["#{File.dirname(__FILE__)}/commands/*.rb"].collect { |file_path| File.basename(file_path).split(".").first }
0
+
0
+if commands.include?(ARGV.first)
0
+ require "#{File.dirname(__FILE__)}/commands/#{ARGV.shift}"
0
 else
0
- puts "Choose: console perform process runner server"
0
+ puts "Choose: #{commands.join(", ")}"
0
 end
0
\ No newline at end of file
...
9
10
11
12
 
13
14
15
...
9
10
11
 
12
13
14
15
0
@@ -9,7 +9,7 @@ OptionParser.new do |opt|
0
 end
0
 
0
 libs = " -r irb/completion"
0
-libs << " -r #{File.dirname(__FILE__)}/../config/environment"
0
+libs << " -r #{RAILS_ROOT}/config/environment"
0
 libs << " -r console_sandbox" if options[:sandbox]
0
 
0
 ENV['RAILS_ENV'] = ARGV.first || 'development'
...
5
6
7
8
 
9
10
11
...
47
48
49
50
 
51
52
53
...
5
6
7
 
8
9
10
11
...
47
48
49
 
50
51
52
53
0
@@ -5,7 +5,7 @@ OPTIONS = {
0
   :port => 3000,
0
   :ip => "0.0.0.0",
0
   :environment => "development",
0
- :server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"),
0
+ :server_root => File.expand_path(RAILS_ROOT + "/public/"),
0
   :server_type => WEBrick::SimpleServer,
0
   :charset => "UTF-8",
0
   :mime_types => WEBrick::HTTPUtils::DefaultMimeTypes
0
@@ -47,7 +47,7 @@ ARGV.options do |opts|
0
 end
0
 
0
 ENV["RAILS_ENV"] = OPTIONS[:environment]
0
-require File.dirname(__FILE__) + "/../config/environment"
0
+require RAILS_ROOT + "/config/environment"
0
 require 'webrick_server'
0
 
0
 OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT)

Comments

    No one has commented yet.