Sha256: b4be2b17d9e919fc1d80a5773a079c006aee5e85301975b1eb525347d3eaaf91
Contents?: true
Size: 977 Bytes
Versions: 15
Compression:
Stored size: 977 Bytes
Contents
module Beet module Execution # Executes a command # # ==== Example # # inside('vendor') do # run('ln -s ~/edge rails) # end # def run(command, log_action = true) log 'executing', "#{command} from #{Dir.pwd}" if log_action `#{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 # # rake("db:migrate") # rake("db:migrate", :env => "production") # rake("gems:install", :sudo => true) # def rake(command, options = {}) log 'rake', command env = options[:env] || 'development' sudo = options[:sudo] ? 'sudo ' : '' in_root { run("#{sudo}rake #{command} RAILS_ENV=#{env}", false) } end end end
Version data entries
15 entries across 15 versions & 1 rubygems