Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (31 sloc) 0.828 kb
namespace :execute do
class NoCommandError < StandardError; end
def command
if ENV['e']
ENV['e']
else
raise NoCommandError, 'To execute a command do: rake execute:all e="p :foo"'
end
end
def run(bin)
sh "#{bin} -e '#{command}'"
rescue Exception => e
raise e if e.is_a?(NoCommandError)
end
desc "Run command (ENV['e']) with miniruby (MacRuby)"
task :miniruby do
run './miniruby'
end
desc "Run command (ENV['e']) with ruby (1.8)"
task :ruby do
run 'ruby'
end
desc "Run command (ENV['e']) with ruby19 (1.9)"
task :ruby19 do
run 'ruby19'
end
desc "Run command (ENV['e']) with ruby, ruby19, and miniruby"
task :all => [:ruby, :ruby19, :miniruby]
end
desc "Run command (ENV['e']) with ruby, ruby19, and miniruby"
task :e => 'execute:all'
Jump to Line
Something went wrong with that request. Please try again.