gillbus 0.16.6 → 0.16.7
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/Rakefile +1 -0
- data/lib/gillbus/structs/segment.rb +9 -1
- data/lib/gillbus/structs/trip.rb +3 -1
- data/lib/gillbus/version.rb +1 -1
- data/test/search_trips_test.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfd0ac869d9d605b0344ae93bc7c0f26c8dce47a
|
4
|
+
data.tar.gz: c625a743ef866ce2cdd2671696afca22b29c396b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 857e79e6e0b3865f781693b3ad69cde047afacb98a344b2419348f25facfe3fd1ed3898012de843688c6ab2281bacdce2aa2da489688f6527d1d4eec3b079145
|
7
|
+
data.tar.gz: f7b1c07c2cef34801f585b497069228c10f144a766d2a2ccc829079cce93fcdfcc07bf89ee85293e3727ae3cdd2afbbd2182ff1a07413e7c09bb39d092521af1
|
data/Rakefile
CHANGED
@@ -38,9 +38,15 @@ class Gillbus
|
|
38
38
|
# => "22:50"
|
39
39
|
field :start_time, :time
|
40
40
|
|
41
|
+
# => "Europe/Moscow"
|
42
|
+
field :start_timezone
|
43
|
+
|
41
44
|
# => "08:00"
|
42
45
|
field :end_time, :time
|
43
46
|
|
47
|
+
# => "Europe/Kiev"
|
48
|
+
field :end_timezone
|
49
|
+
|
44
50
|
# => "Сетра S 315 НDH"
|
45
51
|
field :bus_model
|
46
52
|
|
@@ -140,7 +146,9 @@ class Gillbus
|
|
140
146
|
field :options, TripOptions, key: 'OPTIONS'
|
141
147
|
|
142
148
|
def start_at
|
143
|
-
|
149
|
+
timezone = data['START_TIMEZONE'] || 'Europe/Kiev'
|
150
|
+
datetime_string = "#{data['START_DATE']} #{data['START_TIME']}"
|
151
|
+
ActiveSupport::TimeZone[timezone].parse(datetime_string)
|
144
152
|
end
|
145
153
|
|
146
154
|
parser do
|
data/lib/gillbus/structs/trip.rb
CHANGED
@@ -160,7 +160,9 @@ class Gillbus
|
|
160
160
|
field :options, TripOptions, key: 'OPTIONS'
|
161
161
|
|
162
162
|
def start_at
|
163
|
-
|
163
|
+
timezone = data['START_TIMEZONE'] || 'Europe/Kiev'
|
164
|
+
datetime_string = "#{data['START_DATE']} #{data['START_TIME']}"
|
165
|
+
ActiveSupport::TimeZone[timezone].parse(datetime_string)
|
164
166
|
end
|
165
167
|
|
166
168
|
parser do
|
data/lib/gillbus/version.rb
CHANGED
data/test/search_trips_test.rb
CHANGED
@@ -98,6 +98,16 @@ class SearchTripsResponseTest < Minitest::Test
|
|
98
98
|
assert_equal 'http://example.com/123', response.trips.first.redirect_url
|
99
99
|
end
|
100
100
|
|
101
|
+
def test_start_at_parsing
|
102
|
+
response = get_successful_search_trips
|
103
|
+
|
104
|
+
trip1_start_at = ActiveSupport::TimeZone['Europe/Moscow'].parse('23.08.2014 19:00')
|
105
|
+
trip2_start_at = ActiveSupport::TimeZone['Europe/Kiev'].parse('23.08.2014 21:10')
|
106
|
+
|
107
|
+
assert_equal trip1_start_at, response.trips[0].start_at
|
108
|
+
assert_equal trip2_start_at, response.trips[1].start_at
|
109
|
+
end
|
110
|
+
|
101
111
|
def test_options_parsing
|
102
112
|
response = get_successful_search_trips
|
103
113
|
options = response.trips.first.options
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gillbus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey "codesnik" Trofimenko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-11
|
12
|
+
date: 2017-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_xml
|