diff options
Diffstat (limited to 'blatube.rb')
-rw-r--r-- | blatube.rb | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |