diff options
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/template_runner.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/template_runner.rb b/railties/lib/rails_generator/generators/applications/app/template_runner.rb index 84e36ecc1b..eeb6b17661 100644 --- a/railties/lib/rails_generator/generators/applications/app/template_runner.rb +++ b/railties/lib/rails_generator/generators/applications/app/template_runner.rb @@ -75,7 +75,7 @@ module Rails end elsif options[:git] || options[:svn] in_root do - run("script/plugin install #{options[:svn] || options[:git]}", false) + run_ruby_script("script/plugin install #{options[:svn] || options[:git]}", false) end else log "! no git or svn provided for #{name}. skipping..." @@ -220,7 +220,7 @@ module Rails log 'generating', what argument = args.map(&:to_s).flatten.join(" ") - in_root { run("script/generate #{what} #{argument}", false) } + in_root { run_ruby_script("script/generate #{what} #{argument}", false) } end # Executes a command @@ -236,6 +236,12 @@ module Rails `#{command}` end + # Executes a ruby script (taking into account WIN32 platform quirks) + def run_ruby_script(command, log_action = true) + ruby_command = RUBY_PLATFORM=~ /win32/ ? 'ruby ' : '' + run("#{ruby_command}#{command}", log_action) + end + # Runs the supplied rake task # # ==== Example |