lothianbusestimetable 0.1.2 → 0.1.3
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/lothianbusestimetable.rb +25 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b04bea73d8b5ad4e895b25d94eb1ffa0a94d3c91
|
|
4
|
+
data.tar.gz: af832e2b5850a9b705f141b996d88abf7ea88425
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8419029b14414ead0461fc50f123964428342b48a4f7670db6b0eec7a6ccd906eb8a62dea7a343bf2e6663e4f91ea9efa2b2811d0f816a8326e5471594faa405
|
|
7
|
+
data.tar.gz: 5e040323094473cc03d9e10eee45af0be233285d816d53b2c48e8a3a0e455b648225ea3650d3efb2f86e607ef10623920447178adf1341d5fa0c6812301ad13c
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
|
@@ -45,7 +45,7 @@ class LothianBusesTimetable
|
|
|
45
45
|
table.xpath('tr').each do |tr|
|
|
46
46
|
|
|
47
47
|
# get the name
|
|
48
|
-
a = tr.xpath('td//text()').map(&:
|
|
48
|
+
a = tr.xpath('td//text()').map(&:unescape)
|
|
49
49
|
|
|
50
50
|
col1 = a.shift.strip
|
|
51
51
|
|
|
@@ -217,4 +217,28 @@ class LothianBusesTimetable
|
|
|
217
217
|
@timetable = master
|
|
218
218
|
|
|
219
219
|
end
|
|
220
|
+
|
|
221
|
+
def services()
|
|
222
|
+
|
|
223
|
+
return @services if @services
|
|
224
|
+
|
|
225
|
+
url = @base_url + '1'
|
|
226
|
+
|
|
227
|
+
doc = Nokorexi.new(url).to_doc
|
|
228
|
+
|
|
229
|
+
o = doc.root.xpath('//optgroup').map do |options|
|
|
230
|
+
|
|
231
|
+
[
|
|
232
|
+
options.attributes[:label].sub(' services',''),
|
|
233
|
+
options.xpath('option/text()').map do |x|
|
|
234
|
+
%i(number name).zip(x.to_s.split(/ - /,2)).to_h
|
|
235
|
+
end
|
|
236
|
+
]
|
|
237
|
+
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
@services = o.to_h
|
|
241
|
+
|
|
242
|
+
end
|
|
243
|
+
|
|
220
244
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lothianbusestimetable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
K7yWGJq+eGl34xrLaucvTbO8Ua3rHayCkBzgfx5LVcch22Axj8quw+YGsPnhuosr
|
|
32
32
|
BHdCmx9eUF/TKg==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2017-08-
|
|
34
|
+
date: 2017-08-25 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: nokorexi
|
metadata.gz.sig
CHANGED
|
Binary file
|