From 50dfb125823589bb52980a0b979e9dca2e1e0340 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Fri, 9 Oct 2015 20:54:50 +0100 Subject: Make units binary name configurable --- blaunits.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/blaunits.rb b/blaunits.rb index 460df9a..b8b00c8 100755 --- a/blaunits.rb +++ b/blaunits.rb @@ -1,6 +1,7 @@ #!/usr/bin/ruby -VERSION = "2.0" +VERSION = "2.0.1" +BINARY_NAME = "gunits" begin args = ARGV.dup @@ -51,15 +52,15 @@ begin puts "Invalid input! Try !convert [amount] [from-unit] to [to-unit] e.g !convert 2 cm to inches" exit end - out = %x(gunits -t1 #{from} #{to}) + out = %x(#{BINARY_NAME} -t1 #{from} #{to}) outs = out.split(" ") if outs[0] == "Unknown" from.upcase! - out = %x(gunits -t1 #{from} #{to}) + out = %x(#{BINARY_NAME} -t1 #{from} #{to}) outs = out.split(" ") if outs[0] == "Unknown" to.upcase! - out = %x(gunits -t1 #{from} #{to}) + out = %x(#{BINARY_NAME} -t1 #{from} #{to}) outs = out.split(" ") if outs[0] == "Unknown" puts out -- cgit v1.2.3