kansai_train_info 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/kansai_train_info/client.rb +7 -7
- data/lib/kansai_train_info/script.rb +0 -4
- data/lib/kansai_train_info/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b54ebba43519ef36749f5446d252abaeda9f1437143ea8aec1fa1fe97df3c529
|
|
4
|
+
data.tar.gz: 659939d8d3be367a78c47a5749e86096a2eb1ab94a56c549e44137ecf2cc11fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ce182a438b00168b73c02e9aa36cf8645be08334f71cd67e9c95211861a020ad63f86d83b47ad63996fb83e525897f6687fda3154f5f2c6cf9fd7a879bb71ca
|
|
7
|
+
data.tar.gz: f4cde648707106d080357156c979647c8a658aba7fd65540556f2750affd7f83353c50b0935deb047d2cd4c1c57343b4e069b3dcb7a1ac0de52a09049f2eeb65
|
data/README.md
CHANGED
|
@@ -26,8 +26,11 @@ module KansaiTrainInfo
|
|
|
26
26
|
state = kansai_doc.xpath(status_xpath).first&.text
|
|
27
27
|
messages << message(route, state, url, detail_url)
|
|
28
28
|
end
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if messages.empty?
|
|
30
|
+
puts '利用可能な路線を入力してください'
|
|
31
|
+
else
|
|
32
|
+
messages.join(', ')
|
|
33
|
+
end
|
|
31
34
|
end
|
|
32
35
|
# rubocop:enable Metrics/AbcSize, Layout/LineLength
|
|
33
36
|
|
|
@@ -74,11 +77,8 @@ module KansaiTrainInfo
|
|
|
74
77
|
# rubocop:enable Metrics/CyclomaticComplexity
|
|
75
78
|
|
|
76
79
|
def help
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
print "\n"
|
|
80
|
-
print '大阪環状線、近鉄京都線、阪急京都線, 御堂筋線, 烏丸線, 東西線'
|
|
81
|
-
print "\n"
|
|
80
|
+
help_message = "利用可能な路線:\n大阪環状線、近鉄京都線、阪急京都線, 御堂筋線, 烏丸線, 東西線"
|
|
81
|
+
puts help_message
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
end
|
|
@@ -14,10 +14,6 @@ end
|
|
|
14
14
|
|
|
15
15
|
doc = Nokogiri::HTML.parse(html, nil, charset)
|
|
16
16
|
|
|
17
|
-
# doc.xpath('//div[@class="labelSmall"]').each do |node|
|
|
18
|
-
# p node.xpath('h3').text
|
|
19
|
-
# end
|
|
20
|
-
|
|
21
17
|
status_xpath = "//*[@id='mdAreaMajorLine']/div[4]/table/tr[3]/td[1]"
|
|
22
18
|
|
|
23
19
|
puts doc.xpath(status_xpath).first.text
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kansai_train_info
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- o8n
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-07-
|
|
11
|
+
date: 2024-07-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|