diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-06 18:31:28 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-06 18:31:28 +0200 |
commit | 66d1b968d108787114372144e97f4f817847892b (patch) | |
tree | fde26589fbb2fe4abc79e10e09068b4e5d18972b /railties/lib/generators/actions.rb | |
parent | eeb6a0786a061b640bcd90a5d90bd0d0215fe809 (diff) | |
download | rails-66d1b968d108787114372144e97f4f817847892b.tar.gz rails-66d1b968d108787114372144e97f4f817847892b.tar.bz2 rails-66d1b968d108787114372144e97f4f817847892b.zip |
Make specs pass on Ruby 1.9.
Diffstat (limited to 'railties/lib/generators/actions.rb')
-rw-r--r-- | railties/lib/generators/actions.rb | 10 |
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 |