takuhai_status 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c015ad60431dfb59921095e662da4abb3417e4c3
4
- data.tar.gz: 3dfbdf2e397f9c97da128eb99d2ddf561501b940
3
+ metadata.gz: ca5e2767e709bd9aa9a8991009c77ac7e00afd16
4
+ data.tar.gz: 210a6a33b154a40ab185df723b607b3b6e138697
5
5
  SHA512:
6
- metadata.gz: 2fef03c4c01e0e5c3934dd033eb93feca9c189180ba850ebc8ec246e0bb072a7387304d6c0657dc66bcc063d8ce3a2d23fdbaf38dee5369e79f46adc61640af4
7
- data.tar.gz: 394c234de677e22377364a9a97c067ecd62842e0de2acfe78ddfba2a63b7142e3a2cbed881b707ff8768b7e2eea46ee209cbc55fd74ddcddbef5f5ebdd844747
6
+ metadata.gz: 196e05de9e2fcf5f1af5f3cbf32c3b78f26db4a433f0f0a75b02e69b8d72bfb5a1f9c02696a8f4826836853ed55ce04d5a9df42e222adda1c4aef2bbbd133654
7
+ data.tar.gz: 13aa79c96495f3186e6da4fa7e43447fe4a94bb6d586342aae6e3d154f88390031d8a336d63d4c06771355c8bc4fc3bc75edbb0fff86638699d7ce8f961f9a8f
@@ -20,14 +20,25 @@ module TakuhaiStatus
20
20
  doc = Nokogiri(open(uri, &:read))
21
21
 
22
22
  begin
23
- cols = doc.css('.tableType01')[1].css('tr')
24
- col = cols[cols.size - 2]
25
- stime = col.css('td')[0].text
26
- time = Time.parse(stime)
27
- station = " [#{col.css('td')[3].text}]"
28
- station = " [#{col.css('td')[4].text.strip}]" if station.size <= 4
29
- station = "" if station.size <= 4
30
- state = "#{col.css('td')[1].text}#{station}"
23
+ begin
24
+ # japanese baggage
25
+ cols = doc.css('.tableType01')[1].css('tr')
26
+ col = cols[cols.size - 2]
27
+ stime = col.css('td')[0].text
28
+ time = Time.parse(stime)
29
+ station = " [#{col.css('td')[3].text}]"
30
+ station = " [#{col.css('td')[4].text.strip}]" if station.size <= 4
31
+ station = "" if station.size <= 4
32
+ state = "#{col.css('td')[1].text}#{station}"
33
+ rescue NoMethodError
34
+ # international baggage
35
+ cols = doc.css('.tableType01 tr')
36
+ col = cols[cols.size - 2]
37
+ stime = col.css('td')[2].text
38
+ time = Time.parse(stime)
39
+ station = " [#{col.css('td')[4].text}/#{col.css('td')[5].text}]"
40
+ state = "#{col.css('td')[3].text}#{station}"
41
+ end
31
42
 
32
43
  return time, state
33
44
  rescue NoMethodError
@@ -1,3 +1,3 @@
1
1
  module TakuhaiStatus
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takuhai_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TADA Tadashi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-04 00:00:00.000000000 Z
11
+ date: 2016-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday