diff options
author | otherl <lgdmiller@gmail.com> | 2014-08-17 19:51:14 +0100 |
---|---|---|
committer | otherl <lgdmiller@gmail.com> | 2014-08-17 19:58:01 +0100 |
commit | 416324f60e0dac53f25453aa7da67dfdb9eaa52d (patch) | |
tree | 148473366d903b93dbeea9c4ba8593551eec0d7d | |
parent | 610eee148281ac5b86dd76ce09841d72379ea4b7 (diff) |
Fixed a bug that caused multi word station names to be parsed incorrectly. Fixed a formatting bug in the travel time output.
-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 |