summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2015-10-09 20:54:50 +0100
committerJoe Robinson <joe@lc8n.com>2015-10-09 20:54:50 +0100
commit50dfb125823589bb52980a0b979e9dca2e1e0340 (patch)
tree46750b106f4ae08515e3b2f15c6c42116070d184
parentd372de14d696fe66d9bc6f1ffb78b64211101374 (diff)
Make units binary name configurable
-rwxr-xr-xblaunits.rb9
1 files 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