gillbus 0.17.6 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -4
- data/gillbus.gemspec +1 -1
- data/lib/gillbus/base_response.rb +3 -3
- data/lib/gillbus/helpers/parser.rb +16 -6
- data/lib/gillbus/structs/return_cause.rb +1 -1
- data/lib/gillbus/structs/tariff/return_cause.rb +8 -3
- data/lib/gillbus/structs/ticket.rb +1 -1
- data/lib/gillbus/structs/trip.rb +1 -0
- data/lib/gillbus/structs/trip_options.rb +8 -0
- data/lib/gillbus/structs/trip_service.rb +16 -1
- data/lib/gillbus/version.rb +1 -1
- data/test/error_test.rb +1 -1
- data/test/parse_trip_test.rb +25 -0
- data/test/responses/legacy_trip_2.yml +217 -0
- data/test/search_trips_test.rb +1 -0
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 061717304c911054d7958701d0453ae6243f1efc
|
4
|
+
data.tar.gz: 481cf904061a7696bdfabc23359710e0a0d83707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfc65005717460f4f77283acf4b572b8b45c94d2d67445d89b39fc2a4845fd53adf446e1b3783182615afabb346c487e8d48c28f331fb628d2dc40016a86f955
|
7
|
+
data.tar.gz: 4af31b24aa23bf174da9d40d9abd7f0b9219d8016a6592a9fa62d733b9b033f378181ff815d0204707fc4d9a966e80ced0cbb544bfde3cfbff05e6e98277a424
|
data/Gemfile
CHANGED
data/gillbus.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency 'faraday'
|
23
23
|
spec.add_dependency 'monetize'
|
24
24
|
spec.add_dependency 'money'
|
25
|
-
spec.add_dependency '
|
25
|
+
spec.add_dependency 'ox', '~> 2.9'
|
26
26
|
|
27
27
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
28
28
|
spec.add_development_dependency 'minitest'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'ox'
|
2
2
|
|
3
3
|
class Gillbus
|
4
4
|
class BaseResponse
|
@@ -32,12 +32,12 @@ class Gillbus
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.parse_string(xml_string, **options)
|
35
|
-
xml =
|
35
|
+
xml = Ox.load(xml_string, mode: :hash, symbolize_keys: false)
|
36
36
|
# <DATA/> is a valid response
|
37
37
|
return ParseError.new(xml_string, 'DATA attribute missing') unless xml.key?('DATA')
|
38
38
|
data = xml['DATA'] || {}
|
39
39
|
parse(data, instance: new, options: options)
|
40
|
-
rescue
|
40
|
+
rescue Ox::ParseError, ArgumentError => e
|
41
41
|
ParseError.new(xml_string, e.message)
|
42
42
|
end
|
43
43
|
end
|
@@ -3,6 +3,13 @@ require 'active_support/time'
|
|
3
3
|
|
4
4
|
class Gillbus
|
5
5
|
class Parser
|
6
|
+
NULL_CONST = 'null'.freeze
|
7
|
+
TRUE_CONST = 'true'.freeze
|
8
|
+
YES_CONST = 'Y'.freeze
|
9
|
+
DATE_FORMAT_CONST = '%d.%m.%Y'.freeze
|
10
|
+
TIME_FORMAT_REGEXP = /^ ( \d\d:\d\d ) (?: :\d\d )? $/x.freeze
|
11
|
+
DEFAULT_TIMEZONE = 'Europe/Kiev'.freeze
|
12
|
+
|
6
13
|
attr_accessor :doc
|
7
14
|
attr_accessor :instance
|
8
15
|
attr_accessor :fields
|
@@ -45,6 +52,9 @@ class Gillbus
|
|
45
52
|
def make_one_or_many(type, val)
|
46
53
|
# [:type]
|
47
54
|
if type.is_a? Array
|
55
|
+
if val.is_a?(Array) && val[0].is_a?(Hash) && !val[0].has_key?('__content__')
|
56
|
+
val = [val] if val[1].is_a?(String) # hack to handle attribute parsing by Ox
|
57
|
+
end
|
48
58
|
array(val).map { |v| make_one type.first, v }
|
49
59
|
# :type
|
50
60
|
else
|
@@ -70,16 +80,16 @@ class Gillbus
|
|
70
80
|
end
|
71
81
|
|
72
82
|
def string(val)
|
73
|
-
return if val ==
|
83
|
+
return if val == NULL_CONST
|
74
84
|
val
|
75
85
|
end
|
76
86
|
|
77
87
|
def bool(val)
|
78
|
-
val ==
|
88
|
+
val == TRUE_CONST
|
79
89
|
end
|
80
90
|
|
81
91
|
def yesno_bool(val)
|
82
|
-
val ==
|
92
|
+
val == YES_CONST
|
83
93
|
end
|
84
94
|
|
85
95
|
def int(val)
|
@@ -87,12 +97,12 @@ class Gillbus
|
|
87
97
|
end
|
88
98
|
|
89
99
|
def date(val)
|
90
|
-
Date.strptime(val,
|
100
|
+
Date.strptime(val, DATE_FORMAT_CONST)
|
91
101
|
end
|
92
102
|
|
93
103
|
# rubocop:disable Style/GuardClause, Style/IfUnlessModifier
|
94
104
|
def time(val)
|
95
|
-
if val =~
|
105
|
+
if val =~ TIME_FORMAT_REGEXP
|
96
106
|
$1
|
97
107
|
end
|
98
108
|
end
|
@@ -109,7 +119,7 @@ class Gillbus
|
|
109
119
|
end
|
110
120
|
|
111
121
|
def default_timezone
|
112
|
-
@options[:timezone] ||
|
122
|
+
@options[:timezone] || DEFAULT_TIMEZONE
|
113
123
|
end
|
114
124
|
|
115
125
|
def decimal(val)
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class Gillbus
|
2
2
|
class Tariff
|
3
3
|
class ReturnCause
|
4
|
+
LOSSLESS = 'lossless'.freeze
|
5
|
+
|
4
6
|
extend Fields
|
5
7
|
include UpdateAttrs
|
6
8
|
|
@@ -10,10 +12,13 @@ class Gillbus
|
|
10
12
|
|
11
13
|
# rubocop:disable Lint/UnusedMethodArgument
|
12
14
|
def self.parse(doc, instance: nil, parent: nil, options: {})
|
13
|
-
instance =
|
14
|
-
if doc.is_a? Hash
|
15
|
+
instance = new
|
16
|
+
if doc.is_a?(Array) && doc.size == 2 && doc.first.is_a?(Hash) && doc.last.is_a?(String)
|
17
|
+
instance.lossless = doc.first[LOSSLESS] == Parser::TRUE_CONST
|
18
|
+
instance.cause = doc.last
|
19
|
+
elsif doc.is_a?(Hash) && doc.has_key?('__content__')
|
20
|
+
instance.lossless = (doc['lossless'] == 'true')
|
15
21
|
instance.cause = doc['__content__']
|
16
|
-
instance.lossless = doc['lossless'] == 'true'
|
17
22
|
else
|
18
23
|
instance.cause = doc
|
19
24
|
instance.lossless = false
|
@@ -256,7 +256,7 @@ class Gillbus
|
|
256
256
|
# Array of commissions only for us (with additional fields)
|
257
257
|
field :all_commissions, [Commission], key: 'COMMISSION', root: 'ALL_COMMISSIONS'
|
258
258
|
|
259
|
-
field :return_causes, [
|
259
|
+
field :return_causes, [ReturnCause], key: 'RETURN_CAUSE'
|
260
260
|
|
261
261
|
# Date to pay reserved ticket
|
262
262
|
field :date_to_pay, :datetime
|
data/lib/gillbus/structs/trip.rb
CHANGED
@@ -39,5 +39,13 @@ class Gillbus
|
|
39
39
|
vals.include?('BUSFOR_RECOMMEND')
|
40
40
|
end
|
41
41
|
end
|
42
|
+
|
43
|
+
def self.build_blank
|
44
|
+
options = new
|
45
|
+
field_definitions.each do |name:, type:, key:, root:|
|
46
|
+
options.send(:"#{name}=", []) if type.is_a?(Array)
|
47
|
+
end
|
48
|
+
options
|
49
|
+
end
|
42
50
|
end
|
43
51
|
end
|
@@ -7,6 +7,21 @@ class Gillbus
|
|
7
7
|
field :id, :int, key: 'ID'
|
8
8
|
|
9
9
|
# название услуги в автобусе
|
10
|
-
field :name, :string, key:
|
10
|
+
field :name, :string, key: :__content__
|
11
|
+
|
12
|
+
def self.parse(doc, instance: nil, parent: nil, options: {})
|
13
|
+
instance = new
|
14
|
+
if doc.is_a?(Array)
|
15
|
+
raise ArgumentError, "Unable to parse TripService: #{doc.inspect}" unless doc.size == 2
|
16
|
+
instance.id = doc.first.fetch('ID').to_i
|
17
|
+
instance.name = doc.last
|
18
|
+
elsif doc.is_a?(Hash) #legacy data made with MultiXML
|
19
|
+
instance.id = doc.fetch('ID')
|
20
|
+
instance.name = doc.fetch('__content__')
|
21
|
+
else
|
22
|
+
raise ArgumentError, "Unable to parse TripService: #{doc.inspect}"
|
23
|
+
end
|
24
|
+
instance
|
25
|
+
end
|
11
26
|
end
|
12
27
|
end
|
data/lib/gillbus/version.rb
CHANGED
data/test/error_test.rb
CHANGED
@@ -22,7 +22,7 @@ class ErrorTest < Minitest::Test
|
|
22
22
|
|
23
23
|
def test_malformed_errorness
|
24
24
|
assert malformed_response.error?
|
25
|
-
assert_equal "Malformed response:
|
25
|
+
assert_equal "Malformed response: invalid format, expected < at line 1, column 1 [parse.c:146]\n", malformed_response.error_message
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_malformed_2_errorness
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ParseTripYAML < Minitest::Test
|
4
|
+
def test_content_1
|
5
|
+
response = Gillbus::Trip.parse(YAML.load(File.read('test/responses/legacy_trip.yml')))
|
6
|
+
expected_causes = [
|
7
|
+
'Без потерь, более чем за 2 ч., до отправления рейса. Возвращается 100% стоимости тарифа. Ориентировочная сумма возврата 550',
|
8
|
+
'Добровольно, менее чем за 2 ч., до отправления рейса. Удерживается при возврате: 15% тарифа. Ориентировочная сумма возврата 425',
|
9
|
+
'Возврат маршрутной квитанции в случае опоздания к отправлению (стоимость не возвращается). Удерживается при возврате: 100% тарифа. Ориентировочная сумма возврата 0',
|
10
|
+
'Возврат маршрутной квитанции по отмене отправления т/с, задержки отправления т/с более чем на час и непредставления пассажиру указанного в билете места. СРОК ОБРАЩЕНИЯ для возврата билета 24 часа с времени отправления. . Возвращается 100% стоимости билета. Ориентировочная сумма возврата 550'
|
11
|
+
]
|
12
|
+
|
13
|
+
assert_equal true, response.tariffs.first.return_cause.first.lossless
|
14
|
+
assert_equal expected_causes, response.tariffs.first.return_cause.map(&:cause)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_content_2
|
18
|
+
response = Gillbus::Trip.parse(YAML.load(File.read('test/responses/legacy_trip_2.yml')))
|
19
|
+
assert_equal ["Принудительно, при отмене рейса. Ориентировочная сумма возврата 1044.95RUB",
|
20
|
+
"Добровільно ДБ 4, менш ніж за 10 хвилин до відправлення рейсу. Ориентировочная сумма возврата 574.72RUB",
|
21
|
+
"ДБ 3, не менш ніж за 10 хвилин до відправлення рейсу. Ориентировочная сумма возврата 679.21RUB",
|
22
|
+
"Добровольно, более чем за 2 ч., до отправления рейса. Ориентировочная сумма возврата 783.71RUB",
|
23
|
+
"не менше ніж за 24 години до відправлення рейсу. Ориентировочная сумма возврата 888.2RUB"], response.tariffs.first.return_cause.map(&:cause)
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,217 @@
|
|
1
|
+
---
|
2
|
+
ID: '3436521222122325532'
|
3
|
+
RES_ID: '0'
|
4
|
+
NUMBER: STAGE - ATM 002 Москва - Киев
|
5
|
+
START_CITY_NAME: Москва
|
6
|
+
END_CITY_NAME: Киев Автовокзал "Центральный"
|
7
|
+
START_TIMEZONE:
|
8
|
+
END_TIMEZONE:
|
9
|
+
START_DATE: 10.06.2017
|
10
|
+
END_DATE: 11.06.2017
|
11
|
+
START_TIME: '21:20'
|
12
|
+
END_TIME: '15:30'
|
13
|
+
BUS_MODEL: 'Неоплан '
|
14
|
+
BUS_CLASS:
|
15
|
+
BUS_ID:
|
16
|
+
PLATFORM:
|
17
|
+
TRIP_SEATS_MAP: 'true'
|
18
|
+
SHOW_PICKUP_DROPOFF: 'false'
|
19
|
+
BRANDED: 'false'
|
20
|
+
HAS_TRANSFER: 'false'
|
21
|
+
PLACES_COUNT: '49'
|
22
|
+
FREE_PLACES_COUNT: '10'
|
23
|
+
FREE_BUSY_PLACES: 10/49
|
24
|
+
CARRIER_ID: 4A5DC2609C320E39E0530300F00A7BFB
|
25
|
+
CARRIER_NAME: '"АТМ Транс" ООО'
|
26
|
+
TIME_IN_ROAD: '18:10'
|
27
|
+
FAKE_TIME_IN_ROAD: 'false'
|
28
|
+
STATION_BEGIN_ID: 3206819326B763A8E0530300F00AA4FB
|
29
|
+
STATION_BEGIN_NAME: Международный автовокзал "Южные Ворота"
|
30
|
+
STATION_BEGIN_ADDRESS: '19-й км МКАД, владение 20, стр. 1, Москва, Россия
|
31
|
+
|
32
|
+
'
|
33
|
+
STATION_END_ID: 1C7DB38A37BCCE21E0508E5B35570395
|
34
|
+
STATION_END_NAME: Центральный автовокзал
|
35
|
+
STATION_END_ADDRESS: проспект Науки; дом 1/2
|
36
|
+
RESERVATION_ENABLED: 'false'
|
37
|
+
SALE_ENABLED: 'true'
|
38
|
+
RETURN_ENABLED: 'false'
|
39
|
+
TIME_FOR_CANCEL: '40'
|
40
|
+
TRIP_FULL_SALE: 'false'
|
41
|
+
CAN_DISCOUNT: 'true'
|
42
|
+
RECOMMENDED: 'false'
|
43
|
+
INTERNATIONAL: 'true'
|
44
|
+
JOIN_BOOK_BUY: 'true'
|
45
|
+
TRIP_MODE: '1'
|
46
|
+
SPECIAL_CONDITIONS:
|
47
|
+
IMAGE_URL: 'null'
|
48
|
+
START_POINT_TYPE: 'null'
|
49
|
+
VEHICLE_DESCRIPTION: 'null'
|
50
|
+
VEHICLE_FEATURES: 'null'
|
51
|
+
TOTAL_COST: '1044.95'
|
52
|
+
CURRENCY: RUB
|
53
|
+
CURRENCY_CODE: '643'
|
54
|
+
TARIFF:
|
55
|
+
SHORT_NAME: Y
|
56
|
+
FULL_NAME: Базовый тариф
|
57
|
+
START_DATE:
|
58
|
+
END_DATE:
|
59
|
+
DESCRIPTION: |+
|
60
|
+
Базовый тариф стоимости проезда одного пассажиров в одном направлении
|
61
|
+
В стоимость билета включена стоимость перевозки одного места багажа, весом до 30 кг., на 1 лицо и ручной поклажи весом до 5 кг. размером до 60х40х20 см. При превышении данных лимитов относительно веса и размеров, берется доплата как за дополнительный багаж. Дополнительный багаж перевозится при наличии свободного места в багажном отделении автобуса, за который берется доплата в размере 10 % от стоимости билета за одно дополнительное багажное место.
|
62
|
+
|
63
|
+
TIME_TO_BUY_RESERVED: '24'
|
64
|
+
TIME_TO_STOP_BOOKING: '48'
|
65
|
+
TIME_TO_PAY_RESERVATION:
|
66
|
+
COST: '1044.95'
|
67
|
+
INSURANCE_COST: '0'
|
68
|
+
INSURANCE_ID:
|
69
|
+
INSURANCE_SUM: '0'
|
70
|
+
INSURANCE_CUR:
|
71
|
+
AFTER_DISPATCH_NO_RETURN: 'true'
|
72
|
+
PASSENGER_BIRTHDAY:
|
73
|
+
PASSENGER_ISIC_NUMBER:
|
74
|
+
PASSENGER_STUDENT_TICKET:
|
75
|
+
NOTE:
|
76
|
+
RETURN_CAUSE:
|
77
|
+
- max_time: '10'
|
78
|
+
min_time: "-1440000"
|
79
|
+
percent: '0'
|
80
|
+
__content__: Принудительно, при отмене рейса. Ориентировочная сумма возврата 1044.95RUB
|
81
|
+
- max_time: '10'
|
82
|
+
min_time: '10'
|
83
|
+
percent: '45.00'
|
84
|
+
__content__: Добровільно ДБ 4, менш ніж за 10 хвилин до відправлення рейсу. Ориентировочная
|
85
|
+
сумма возврата 574.72RUB
|
86
|
+
- max_time: '120'
|
87
|
+
min_time: '10'
|
88
|
+
percent: '35.00'
|
89
|
+
__content__: ДБ 3, не менш ніж за 10 хвилин до відправлення рейсу. Ориентировочная
|
90
|
+
сумма возврата 679.21RUB
|
91
|
+
- max_time: '1440'
|
92
|
+
min_time: '120'
|
93
|
+
percent: '25.00'
|
94
|
+
__content__: Добровольно, более чем за 2 ч., до отправления рейса. Ориентировочная
|
95
|
+
сумма возврата 783.71RUB
|
96
|
+
- min_time: '1440'
|
97
|
+
percent: '15.00'
|
98
|
+
__content__: не менше ніж за 24 години до відправлення рейсу. Ориентировочная
|
99
|
+
сумма возврата 888.2RUB
|
100
|
+
PROMOTE: 'false'
|
101
|
+
POINT:
|
102
|
+
- NUMBER: '0'
|
103
|
+
GEOGRAPHY_NAME: Москва
|
104
|
+
NAME: Международный автовокзал "Южные Ворота"
|
105
|
+
ADDRESS: '19-й км МКАД, владение 20, стр. 1, Москва, Россия
|
106
|
+
|
107
|
+
'
|
108
|
+
TIMEZONE:
|
109
|
+
ARRIVAL_DATE: 10.06.2017
|
110
|
+
ARRIVAL_TIME:
|
111
|
+
DISPATCH_DATE: 10.06.2017
|
112
|
+
DISPATCH_TIME: '21:20'
|
113
|
+
CHECK_POINT: 'false'
|
114
|
+
DISTANCE: '0'
|
115
|
+
TRANSFER_POINT: 'false'
|
116
|
+
PLATFORM:
|
117
|
+
BUSMODEL: 'Неоплан '
|
118
|
+
- NUMBER: '1'
|
119
|
+
GEOGRAPHY_NAME: Москва
|
120
|
+
NAME: Автостанция "Красногвардейская"
|
121
|
+
ADDRESS: метро Красногвардейская; бульвар Ореховый; дом 24к1Г
|
122
|
+
TIMEZONE:
|
123
|
+
ARRIVAL_DATE: 10.06.2017
|
124
|
+
ARRIVAL_TIME: '21:40'
|
125
|
+
DISPATCH_DATE: 10.06.2017
|
126
|
+
DISPATCH_TIME: '22:00'
|
127
|
+
CHECK_POINT: 'false'
|
128
|
+
DISTANCE: '5'
|
129
|
+
TRANSFER_POINT: 'false'
|
130
|
+
PLATFORM:
|
131
|
+
BUSMODEL: 'Неоплан '
|
132
|
+
- NUMBER: '2'
|
133
|
+
GEOGRAPHY_NAME: Орел
|
134
|
+
NAME: Автовокзал "Орел"
|
135
|
+
ADDRESS: улица Автовокзальная; дом 1
|
136
|
+
TIMEZONE:
|
137
|
+
ARRIVAL_DATE: 11.06.2017
|
138
|
+
ARRIVAL_TIME: '05:05'
|
139
|
+
DISPATCH_DATE: 11.06.2017
|
140
|
+
DISPATCH_TIME: '05:30'
|
141
|
+
CHECK_POINT: 'false'
|
142
|
+
DISTANCE: '371'
|
143
|
+
TRANSFER_POINT: 'false'
|
144
|
+
PLATFORM:
|
145
|
+
BUSMODEL: 'Неоплан '
|
146
|
+
- NUMBER: '3'
|
147
|
+
GEOGRAPHY_NAME: Железногорск
|
148
|
+
NAME: Автовокзал "Железногорск"
|
149
|
+
ADDRESS: улица Советской Армии; дом 8
|
150
|
+
TIMEZONE:
|
151
|
+
ARRIVAL_DATE: 11.06.2017
|
152
|
+
ARRIVAL_TIME: '07:20'
|
153
|
+
DISPATCH_DATE: 11.06.2017
|
154
|
+
DISPATCH_TIME: '07:30'
|
155
|
+
CHECK_POINT: 'false'
|
156
|
+
DISTANCE: '466'
|
157
|
+
TRANSFER_POINT: 'false'
|
158
|
+
PLATFORM:
|
159
|
+
BUSMODEL: 'Неоплан '
|
160
|
+
- NUMBER: '4'
|
161
|
+
GEOGRAPHY_NAME: Хомутовка
|
162
|
+
NAME: АС
|
163
|
+
ADDRESS: ул. Ленина, 5
|
164
|
+
TIMEZONE:
|
165
|
+
ARRIVAL_DATE: 11.06.2017
|
166
|
+
ARRIVAL_TIME: '08:45'
|
167
|
+
DISPATCH_DATE: 11.06.2017
|
168
|
+
DISPATCH_TIME: '08:50'
|
169
|
+
CHECK_POINT: 'false'
|
170
|
+
DISTANCE: '534'
|
171
|
+
TRANSFER_POINT: 'false'
|
172
|
+
PLATFORM:
|
173
|
+
BUSMODEL: 'Неоплан '
|
174
|
+
- NUMBER: '5'
|
175
|
+
GEOGRAPHY_NAME: Бачевск КПП(Украина-Россия)
|
176
|
+
NAME:
|
177
|
+
ADDRESS:
|
178
|
+
TIMEZONE:
|
179
|
+
ARRIVAL_DATE: 11.06.2017
|
180
|
+
ARRIVAL_TIME: '09:05'
|
181
|
+
DISPATCH_DATE: 11.06.2017
|
182
|
+
DISPATCH_TIME: '09:45'
|
183
|
+
CHECK_POINT: 'true'
|
184
|
+
DISTANCE: '557'
|
185
|
+
TRANSFER_POINT: 'false'
|
186
|
+
PLATFORM:
|
187
|
+
BUSMODEL: 'Неоплан '
|
188
|
+
- NUMBER: '6'
|
189
|
+
GEOGRAPHY_NAME: Глухов
|
190
|
+
NAME: Остановка Глухов
|
191
|
+
ADDRESS: улица Путивльская; дом 39А
|
192
|
+
TIMEZONE:
|
193
|
+
ARRIVAL_DATE: 11.06.2017
|
194
|
+
ARRIVAL_TIME: '10:15'
|
195
|
+
DISPATCH_DATE: 11.06.2017
|
196
|
+
DISPATCH_TIME: '10:35'
|
197
|
+
CHECK_POINT: 'false'
|
198
|
+
DISTANCE: '594'
|
199
|
+
TRANSFER_POINT: 'false'
|
200
|
+
PLATFORM:
|
201
|
+
BUSMODEL: 'Неоплан '
|
202
|
+
- NUMBER: '7'
|
203
|
+
GEOGRAPHY_NAME: Киев
|
204
|
+
NAME: Центральный автовокзал
|
205
|
+
ADDRESS: проспект Науки; дом 1/2
|
206
|
+
TIMEZONE:
|
207
|
+
ARRIVAL_DATE: 11.06.2017
|
208
|
+
ARRIVAL_TIME: '15:30'
|
209
|
+
DISPATCH_DATE: 11.06.2017
|
210
|
+
DISPATCH_TIME: '16:00'
|
211
|
+
CHECK_POINT: 'false'
|
212
|
+
DISTANCE: '914'
|
213
|
+
TRANSFER_POINT: 'false'
|
214
|
+
PLATFORM:
|
215
|
+
BUSMODEL: 'Неоплан '
|
216
|
+
EXTRA_CHARGE: '0.0'
|
217
|
+
|
data/test/search_trips_test.rb
CHANGED
@@ -84,6 +84,7 @@ class SearchTripsResponseTest < Minitest::Test
|
|
84
84
|
|
85
85
|
def test_fields_parsing
|
86
86
|
response = get_successful_search_trips
|
87
|
+
assert_equal '3451212695530327295', response.trips.first.id
|
87
88
|
assert_equal Date.new(2014, 8, 23), response.trips.first.start_date
|
88
89
|
assert_equal Money.new(1410_00, 'RUB'), response.trips.first.total_cost
|
89
90
|
assert_equal Money.new(1410_00, 'RUB'), response.trips.first.tariffs.first.cost
|
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.
|
4
|
+
version: 0.18.1
|
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: 2018-
|
12
|
+
date: 2018-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -68,19 +68,19 @@ dependencies:
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: ox
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '2.9'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '2.9'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: bundler
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- test/get_trip_seats_test.rb
|
238
238
|
- test/get_trip_segments_test.rb
|
239
239
|
- test/lock_seats_test.rb
|
240
|
+
- test/parse_trip_test.rb
|
240
241
|
- test/reserve_tickets_test.rb
|
241
242
|
- test/responses/bookingDifferentCurrencies.xml
|
242
243
|
- test/responses/buyBooking.xml
|
@@ -253,6 +254,7 @@ files:
|
|
253
254
|
- test/responses/getTripSeats-segments.xml
|
254
255
|
- test/responses/getTripSeats.xml
|
255
256
|
- test/responses/getTripSegments.xml
|
257
|
+
- test/responses/legacy_trip_2.yml
|
256
258
|
- test/responses/lockSeats.xml
|
257
259
|
- test/responses/reserveTickets.xml
|
258
260
|
- test/responses/reserveTickets.yml
|
@@ -313,6 +315,7 @@ test_files:
|
|
313
315
|
- test/get_trip_seats_test.rb
|
314
316
|
- test/get_trip_segments_test.rb
|
315
317
|
- test/lock_seats_test.rb
|
318
|
+
- test/parse_trip_test.rb
|
316
319
|
- test/reserve_tickets_test.rb
|
317
320
|
- test/responses/bookingDifferentCurrencies.xml
|
318
321
|
- test/responses/buyBooking.xml
|
@@ -329,6 +332,7 @@ test_files:
|
|
329
332
|
- test/responses/getTripSeats-segments.xml
|
330
333
|
- test/responses/getTripSeats.xml
|
331
334
|
- test/responses/getTripSegments.xml
|
335
|
+
- test/responses/legacy_trip_2.yml
|
332
336
|
- test/responses/lockSeats.xml
|
333
337
|
- test/responses/reserveTickets.xml
|
334
338
|
- test/responses/reserveTickets.yml
|