Skip to content

Commit

Permalink
Added carat option for specifying rvm-managed rubies
Browse files Browse the repository at this point in the history
  • Loading branch information
srawlins committed Jun 1, 2011
1 parent 5529d47 commit cc494f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion benchmark/bin/benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ compare_targets = []

opt = OptionParser.new do |o|
o.on("-t", "--target TARGET", String,
"Use multiple TARGETs for comparison: r:ruby|r19:ruby19|x:rbx|j:jruby") do |t|
"Use multiple TARGETs for comparison:",
"<path-to-ruby-binary>: will use exact ruby binary",
"shortcuts: r:ruby | r19:ruby19 | x:rbx | j:jruby",
"^<name>: rvm-managed ruby; will use ~/.rvm/rubies/<name>/bin/ruby") do |t|
case t
when 'r', 'ruby'
targets << 'ruby'
Expand All @@ -40,6 +43,9 @@ opt = OptionParser.new do |o|
rescue TypeError
targets << t
end
elsif t[0,1] == "^"
puts "Found rvm-managed ruby: " + t[1..-1]
targets << File.expand_path("~/.rvm/rubies/" + t[1..-1] + "/bin/ruby")
else
targets << t
end
Expand Down

0 comments on commit cc494f7

Please sign in to comment.