aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/commands')
-rw-r--r--railties/lib/commands/dbconsole.rb4
-rwxr-xr-x[-rw-r--r--]railties/lib/commands/ncgi/listener4
-rwxr-xr-x[-rw-r--r--]railties/lib/commands/ncgi/tracker4
-rw-r--r--railties/lib/commands/plugin.rb2
-rw-r--r--railties/lib/commands/process/spawner.rb4
-rw-r--r--railties/lib/commands/runner.rb2
-rw-r--r--railties/lib/commands/server.rb6
7 files changed, 14 insertions, 12 deletions
diff --git a/railties/lib/commands/dbconsole.rb b/railties/lib/commands/dbconsole.rb
index 17acb7b68f..5be3b5dd8e 100644
--- a/railties/lib/commands/dbconsole.rb
+++ b/railties/lib/commands/dbconsole.rb
@@ -41,11 +41,13 @@ when "mysql"
if config['password'] && include_password
args << "--password=#{config['password']}"
+ elsif config['password'] && !config['password'].empty?
+ args << "-p"
end
args << config['database']
- exec(find_cmd('mysql5', 'mysql'), *args)
+ exec(find_cmd('mysql', 'mysql5'), *args)
when "postgresql"
ENV['PGUSER'] = config["username"] if config["username"]
diff --git a/railties/lib/commands/ncgi/listener b/railties/lib/commands/ncgi/listener
index 421c453f23..7079ef78a6 100644..100755
--- a/railties/lib/commands/ncgi/listener
+++ b/railties/lib/commands/ncgi/listener
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
require 'stringio'
require 'fileutils'
@@ -83,4 +83,4 @@ end
socket_path = ARGV.shift
timeout = (ARGV.shift || 90).to_i
-Listener.new(timeout, socket_path) \ No newline at end of file
+Listener.new(timeout, socket_path)
diff --git a/railties/lib/commands/ncgi/tracker b/railties/lib/commands/ncgi/tracker
index 859c9fa0e0..4ca12d779b 100644..100755
--- a/railties/lib/commands/ncgi/tracker
+++ b/railties/lib/commands/ncgi/tracker
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
require 'drb'
require 'thread'
@@ -66,4 +66,4 @@ end
socket_path = ARGV.shift
instances = ARGV.shift.to_i
t = Tracker.new(instances, socket_path)
-t.background(ARGV.first ? ARGV.shift.to_i : 90) \ No newline at end of file
+t.background(ARGV.first ? ARGV.shift.to_i : 90)
diff --git a/railties/lib/commands/plugin.rb b/railties/lib/commands/plugin.rb
index 0256090d16..980244a71b 100644
--- a/railties/lib/commands/plugin.rb
+++ b/railties/lib/commands/plugin.rb
@@ -907,7 +907,7 @@ class RecursiveHTTPFetcher
def ls
@urls_to_fetch.collect do |url|
- if url =~ /^svn:\/\/.*/
+ if url =~ /^svn(\+ssh)?:\/\/.*/
`svn ls #{url}`.split("\n").map {|entry| "/#{entry}"} rescue nil
else
open(url) do |stream|
diff --git a/railties/lib/commands/process/spawner.rb b/railties/lib/commands/process/spawner.rb
index fd09daa55b..dc0008698a 100644
--- a/railties/lib/commands/process/spawner.rb
+++ b/railties/lib/commands/process/spawner.rb
@@ -66,9 +66,9 @@ class MongrelSpawner < Spawner
"-l #{OPTIONS[:rails_root]}/log/mongrel.log"
# Add prefix functionality to spawner's call to mongrel_rails
- # Digging through monrel's project subversion server, the earliest
+ # Digging through mongrel's project subversion server, the earliest
# Tag that has prefix implemented in the bin/mongrel_rails file
- # is 0.3.15 which also happens to be the earilest tag listed.
+ # is 0.3.15 which also happens to be the earliest tag listed.
# References: http://mongrel.rubyforge.org/svn/tags
if Mongrel::Const::MONGREL_VERSION.to_f >=0.3 && !OPTIONS[:prefix].nil?
cmd = cmd + " --prefix #{OPTIONS[:prefix]}"
diff --git a/railties/lib/commands/runner.rb b/railties/lib/commands/runner.rb
index 926bc26344..14159c3893 100644
--- a/railties/lib/commands/runner.rb
+++ b/railties/lib/commands/runner.rb
@@ -42,7 +42,7 @@ if code_or_file.nil?
$stderr.puts "Run '#{$0} -h' for help."
exit 1
elsif File.exist?(code_or_file)
- eval(File.read(code_or_file))
+ eval(File.read(code_or_file), nil, code_or_file)
else
eval(code_or_file)
end
diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb
index 7306c248fb..15f417b5be 100644
--- a/railties/lib/commands/server.rb
+++ b/railties/lib/commands/server.rb
@@ -23,10 +23,10 @@ server = case ARGV.first
when "lighttpd", "mongrel", "new_mongrel", "webrick", "thin"
ARGV.shift
else
- if defined?(Thin)
- "thin"
- elsif defined?(Mongrel)
+ if defined?(Mongrel)
"mongrel"
+ elsif defined?(Thin)
+ "thin"
elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI)
"lighttpd"
else