aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-07-06 18:31:28 +0200
committerJosé Valim <jose.valim@gmail.com>2009-07-06 18:31:28 +0200
commit66d1b968d108787114372144e97f4f817847892b (patch)
treefde26589fbb2fe4abc79e10e09068b4e5d18972b /railties/lib
parenteeb6a0786a061b640bcd90a5d90bd0d0215fe809 (diff)
downloadrails-66d1b968d108787114372144e97f4f817847892b.tar.gz
rails-66d1b968d108787114372144e97f4f817847892b.tar.bz2
rails-66d1b968d108787114372144e97f4f817847892b.zip
Make specs pass on Ruby 1.9.
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/generators/actions.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/generators/actions.rb b/railties/lib/generators/actions.rb
index b6a3eb95e4..e0f765f201 100644
--- a/railties/lib/generators/actions.rb
+++ b/railties/lib/generators/actions.rb
@@ -214,7 +214,7 @@ module Rails
def rake(command, options={})
log :rake, command
env = options[:env] || 'development'
- sudo = options[:sudo] && RUBY_PLATFORM !~ /win32|mswin/ ? 'sudo ' : ''
+ sudo = options[:sudo] && RUBY_PLATFORM !~ /mswin|mingw/ ? 'sudo ' : ''
in_root { run("#{sudo}#{extify(:rake)} #{command} RAILS_ENV=#{env}", false) }
end
@@ -268,10 +268,14 @@ module Rails
end
end
- # Add the ruby command extension to the given name.
+ # Add an extension to the given name based on the platform.
#
def extify(name)
- "#{name}#{File.extname(Thor::Util.ruby_command)}"
+ if RUBY_PLATFORM =~ /mswin|mingw/
+ "#{name}.bat"
+ else
+ name
+ end
end
end