From 66d1b968d108787114372144e97f4f817847892b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 6 Jul 2009 18:31:28 +0200 Subject: Make specs pass on Ruby 1.9. --- railties/lib/generators/actions.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'railties/lib/generators') 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 -- cgit v1.2.3