summaryrefslogtreecommitdiff
path: root/blatube.rb
diff options
context:
space:
mode:
Diffstat (limited to 'blatube.rb')
-rw-r--r--blatube.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/blatube.rb b/blatube.rb
index 12de2c0..af67aeb 100644
--- a/blatube.rb
+++ b/blatube.rb
@@ -18,7 +18,7 @@ VERSION = 'v1.3.1'
INFINITY = 1 << 64
WEIGHTS = ['distance','peak_time','off_peak_time','unimpeded_time']
-STDIN.gets.split(' ').each{|arg| ARGV << arg} if ARGV == []
+STDIN.gets.split('-').drop(1).map {|arg| ('-'+arg).rstrip.split(/ /,2)}.flatten.each{|arg| ARGV << arg} if ARGV == []
args = ARGV.dup
options = OptionParser.new do |opts|
@@ -180,7 +180,7 @@ def build_route_output
else
minutes = @distances[@to_station.upcase].round(2)
seconds = (minutes - minutes.to_i) * 60
- @output << "Travel Time: #{minutes.to_i}:#{seconds.round}"
+ @output << "Travel Time: #{minutes.to_i}:#{seconds.round.to_s.rjust(2, '0')}"
end
end