zvv-cli 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +3 -1
  3. data/exe/zvv +7 -13
  4. data/lib/zvv/cli/version.rb +1 -1
  5. metadata +6 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 73048c291b55fcae9442dcfce0cef615284c17dd
4
- data.tar.gz: debe2ec3713322463c0d51678491d0ba46c1f150
2
+ SHA256:
3
+ metadata.gz: 8beaff8e2a23d5324dbbc699caecec6952d9add84a0fba9ad7f646d092f53f82
4
+ data.tar.gz: b904773ebd70ec0db4aea799b2faeab3f0fe4d726e9e8619bc51d13238e737ee
5
5
  SHA512:
6
- metadata.gz: decaedd03da53003a10801207e53c75a55e52eb19619c1cae7aa658c1b8aa800f74801bbf0456856a60f777804c2e34661d060a1a27745528d4b93170ed8a3ff
7
- data.tar.gz: 5bff1a218c2c562967ba20163157c75adf7542425d2034ed11314de5f1400582c490cf0e9925901e5f60556b76794b5c67d74ce3785a241a7883a63a72d6496e
6
+ metadata.gz: 40f2955c405bd8dcf0c392fd57768ac3dcdb9d48b7285dfad38a4818dd3b59d2efc9c2b311f00d6dedfcb62d32b8f47d5e75aa5308105fb7ad1056d01b732190
7
+ data.tar.gz: 75f2feb32a96f75d0f27bf7eda25c05fe38f29fa4f9603a294c16c900d226d7c3cfffcb2f14ea23d1c607c75a186b15288ebc6c7db863dca0e249814d8fd4a4f
data/.gitignore CHANGED
@@ -1,4 +1,6 @@
1
1
  .idea
2
2
  .ruby-version
3
3
  Gemfile.lock
4
- .byebug_history
4
+ .byebug_history
5
+ pkg
6
+ .DS_Store
data/exe/zvv CHANGED
@@ -5,6 +5,7 @@ require 'rubygems'
5
5
  require 'commander'
6
6
  require 'transprt'
7
7
  require 'colorize'
8
+ require 'debug'
8
9
 
9
10
  require 'zvv/cli'
10
11
  require 'ostruct'
@@ -15,16 +16,6 @@ module Patches
15
16
  def strftime
16
17
  DateTime.iso8601(self).strftime('%H:%M')
17
18
  end
18
-
19
- def subzh
20
- gsub('Zürich', 'Zh').
21
- gsub('Bahnhof', 'Bhf')
22
- end
23
-
24
- def subcon
25
- tokens = split(' ')
26
- tokens[0][-1] + ' ' + tokens[1]
27
- end
28
19
  end
29
20
 
30
21
  refine Hash do
@@ -79,13 +70,16 @@ class App
79
70
  isArrivalTime: isArrivalTime
80
71
  )
81
72
 
73
+ # pp connections[0]
74
+
82
75
  connections.to_ostruct.each_with_index do |c, i|
83
- puts ("%s %s ---> %s %s" % [c.from.station.name, c.from.departure.strftime, c.to.station.name, c.to.arrival.strftime]).subzh
76
+ duration_sec = (DateTime.iso8601(c.to.arrival).to_time - DateTime.iso8601(c.from.departure).to_time).to_int
77
+ puts ("%-20s %5s %2d:%02d %-20s %5s" % [c.from.station.name, c.from.departure.strftime, duration_sec / 60 ** 2, (duration_sec % 60 ** 2) / 60, c.to.station.name, c.to.arrival.strftime])
84
78
  c.sections.each do |s|
85
79
  if s.walk
86
- puts ("Walk (%s) to %s" % [s.walk.duration, s.departure.station.name]).subzh.light_black
80
+ puts ("Walk (%sm) to %s" % [s.walk.duration, s.departure.station.name]).light_black
87
81
  else
88
- puts ("%s %s -- %s --> %s %s" % [s.departure.station.name, s.departure.departure.strftime, s.journey.name.subcon, s.arrival.station.name, s.arrival.arrival.strftime]).subzh.light_black
82
+ puts ("%-20s %5s %2s%-3s %-20s %5s" % [s.departure.station.name, s.departure.departure.strftime, s.journey.category, s.journey.number[0..2], s.arrival.station.name, s.arrival.arrival.strftime]).light_black
89
83
  end
90
84
  end
91
85
  puts unless i == connections.length - 1
@@ -1,5 +1,5 @@
1
1
  module Zvv
2
2
  module Cli
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zvv-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - PJK
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-31 00:00:00.000000000 Z
11
+ date: 2023-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -160,7 +160,7 @@ homepage: https://github.com/PJK/zvv-cli
160
160
  licenses:
161
161
  - MIT
162
162
  metadata: {}
163
- post_install_message:
163
+ post_install_message:
164
164
  rdoc_options: []
165
165
  require_paths:
166
166
  - lib
@@ -175,9 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []
178
- rubyforge_project:
179
- rubygems_version: 2.5.1
180
- signing_key:
178
+ rubygems_version: 3.4.10
179
+ signing_key:
181
180
  specification_version: 4
182
181
  summary: CLI for Swiss public transport network
183
182
  test_files: []