diff options
author | unknown <jeko1@.npfit.nhs.uk> | 2009-02-03 13:03:47 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-02-16 20:22:02 +0100 |
commit | 2414fdb244cc0ba97620dd3f50e269d2e26c7392 (patch) | |
tree | 18e8f3ce8acd407d05c05a54ade4195de2a9a415 /railties/lib/rails_generator/generators/applications/app/template_runner.rb | |
parent | 86d8f922828677e64892c166adf26cd421f0991a (diff) | |
download | rails-2414fdb244cc0ba97620dd3f50e269d2e26c7392.tar.gz rails-2414fdb244cc0ba97620dd3f50e269d2e26c7392.tar.bz2 rails-2414fdb244cc0ba97620dd3f50e269d2e26c7392.zip |
Ensure template_runner can run script/* ruby scripts under Windows. [#1859 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties/lib/rails_generator/generators/applications/app/template_runner.rb')
-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 |