gillbus 0.11.0 → 0.12.0

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: abd154225fa9cf95e090acd4e225b7793933afe3
4
- data.tar.gz: df33244cd12c9948e297301164d27ab7a8c6eb50
3
+ metadata.gz: 7773b860602eecb6696a5cb66c9ff0e918943f76
4
+ data.tar.gz: 2ae7d87c1f29a0f026cc7d791bcf778282d96cca
5
5
  SHA512:
6
- metadata.gz: 2faa23383a71fe67e11161f9a60b758a8c1020fcf64e0f046c1b2a882eac85ee306d3d46ef72126268a54c79264a621a4a2071bde00119cf07f638ad4fea0e0c
7
- data.tar.gz: 0b8b35d7b404a02e9ee6ebcdcf9dbc4c97383c07f3b05cbef6ef5ddfd3fc572d2f3ca53aa2ad626d416cda1347144ac647678fdcbb95d3e91fb829c79b879121
6
+ metadata.gz: d0a10504220662bdedc0e607df427ed334e239c9fb1e117b2aeb842faaf5845f3401904cddccf718024be281be815ae8f3bc5e0b24e2e2cd3d2fed85b36ea54b
7
+ data.tar.gz: fb86f6fa657e5631a005d7179656e3c05aa37f6a8a8889d492998006030ee7944e5b1f259774f6b5be4d3200bee1c024f05d674ddc3d0b13fbd3bce0279a538e
data/Gemfile CHANGED
@@ -4,7 +4,5 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :development do
7
- gem 'guard', github: 'guard/guard'
8
- gem 'guard-minitest', github: 'guard/guard-minitest'
9
7
  gem 'ox'
10
8
  end
@@ -0,0 +1,26 @@
1
+ class Gillbus
2
+ # Получение маршрута следования (getTripSegments)
3
+ # Возвращает список остановочных пунктов следования рейса
4
+ # Если список остановочных пунктов отсутствует, то ресурс не предоставляет возможности получения маршрута следования.
5
+ module GetTripSegments
6
+
7
+ Gillbus.register self, :get_trip_segments
8
+
9
+ class Request < BaseRequest
10
+ def path; '/online2/getTripSegments' end
11
+
12
+ # tripId
13
+ # ИД рейса, для которого нужно получить маршрут
14
+ attr_accessor :trip_id
15
+
16
+ def params
17
+ { tripId: trip_id }
18
+ end
19
+ end
20
+
21
+ class Response < BaseResponse
22
+ field :points, [Point], key: 'POINT'
23
+ end
24
+
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  class Gillbus
2
- VERSION = "0.11.0"
2
+ VERSION = "0.12.0"
3
3
  end
data/lib/gillbus.rb CHANGED
@@ -70,6 +70,7 @@ class Gillbus
70
70
  require 'gillbus/search_trips'
71
71
  require 'gillbus/get_trips'
72
72
  require 'gillbus/get_trip_seats'
73
+ require 'gillbus/get_trip_segments'
73
74
  require 'gillbus/get_required_fields'
74
75
  require 'gillbus/lock_seats'
75
76
  require 'gillbus/unlock_seats'
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ class GetTripSegmentsTest < Minitest::Test
4
+
5
+ def get_trip_segments
6
+ Gillbus::GetTripSegments::Response.parse_string(File.read('test/responses/getTripSegments.xml'))
7
+ end
8
+
9
+ def test_get_trip_segments
10
+ points = get_trip_segments.points
11
+
12
+ assert_equal( 13, points.size )
13
+ assert_equal( 'Львов', points.first.geography_name )
14
+ assert_equal( 'Ж/Д вокзал Львів', points.first.name )
15
+ assert_equal( 'Щецин', points.last.geography_name )
16
+ assert_equal( 'Автовокзал', points.last.name )
17
+ end
18
+ end
@@ -0,0 +1,158 @@
1
+ <DATA>
2
+ <POINT>
3
+ <NUMBER>0</NUMBER>
4
+ <GEOGRAPHY_NAME>Львов</GEOGRAPHY_NAME>
5
+ <NAME>Ж/Д вокзал Львів</NAME>
6
+ <ADDRESS>пл. Двірцева 1</ADDRESS>
7
+ <ARRIVAL_DATE>26.06.2015</ARRIVAL_DATE>
8
+ <ARRIVAL_TIME>22:30</ARRIVAL_TIME>
9
+ <DISPATCH_DATE>26.06.2015</DISPATCH_DATE>
10
+ <DISPATCH_TIME>22:40</DISPATCH_TIME>
11
+ <CHECK_POINT>false</CHECK_POINT>
12
+ <DISTANCE>0</DISTANCE>
13
+ </POINT>
14
+ <POINT>
15
+ <NUMBER>1</NUMBER>
16
+ <GEOGRAPHY_NAME>Краковец КПП (Украина/Польша)</GEOGRAPHY_NAME>
17
+ <NAME/>
18
+ <ADDRESS/>
19
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
20
+ <ARRIVAL_TIME>00:25</ARRIVAL_TIME>
21
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
22
+ <DISPATCH_TIME>01:10</DISPATCH_TIME>
23
+ <CHECK_POINT>true</CHECK_POINT>
24
+ <DISTANCE>60</DISTANCE>
25
+ </POINT>
26
+ <POINT>
27
+ <NUMBER>2</NUMBER>
28
+ <GEOGRAPHY_NAME>Жешув</GEOGRAPHY_NAME>
29
+ <NAME>Жешув АС</NAME>
30
+ <ADDRESS>вул. Гроттгера, 1</ADDRESS>
31
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
32
+ <ARRIVAL_TIME>01:40</ARRIVAL_TIME>
33
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
34
+ <DISPATCH_TIME>01:50</DISPATCH_TIME>
35
+ <CHECK_POINT>false</CHECK_POINT>
36
+ <DISTANCE>151</DISTANCE>
37
+ </POINT>
38
+ <POINT>
39
+ <NUMBER>3</NUMBER>
40
+ <GEOGRAPHY_NAME>Сандомир</GEOGRAPHY_NAME>
41
+ <NAME>ul. 11 Listopada 30</NAME>
42
+ <ADDRESS/>
43
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
44
+ <ARRIVAL_TIME>03:00</ARRIVAL_TIME>
45
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
46
+ <DISPATCH_TIME>03:10</DISPATCH_TIME>
47
+ <CHECK_POINT>false</CHECK_POINT>
48
+ <DISTANCE>239</DISTANCE>
49
+ </POINT>
50
+ <POINT>
51
+ <NUMBER>4</NUMBER>
52
+ <GEOGRAPHY_NAME>Радом</GEOGRAPHY_NAME>
53
+ <NAME>Dw. Autob. </NAME>
54
+ <ADDRESS>ul. Prazmowskiego, 8</ADDRESS>
55
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
56
+ <ARRIVAL_TIME>04:40</ARRIVAL_TIME>
57
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
58
+ <DISPATCH_TIME>04:50</DISPATCH_TIME>
59
+ <CHECK_POINT>false</CHECK_POINT>
60
+ <DISTANCE>348</DISTANCE>
61
+ </POINT>
62
+ <POINT>
63
+ <NUMBER>5</NUMBER>
64
+ <GEOGRAPHY_NAME>Груец</GEOGRAPHY_NAME>
65
+ <NAME>Автовокзал</NAME>
66
+ <ADDRESS/>
67
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
68
+ <ARRIVAL_TIME>05:50</ARRIVAL_TIME>
69
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
70
+ <DISPATCH_TIME>06:00</DISPATCH_TIME>
71
+ <CHECK_POINT>false</CHECK_POINT>
72
+ <DISTANCE>406</DISTANCE>
73
+ </POINT>
74
+ <POINT>
75
+ <NUMBER>6</NUMBER>
76
+ <GEOGRAPHY_NAME>Варшава</GEOGRAPHY_NAME>
77
+ <NAME>Автовокзал "Западный"</NAME>
78
+ <ADDRESS>ал. Иерусалим 144</ADDRESS>
79
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
80
+ <ARRIVAL_TIME>07:20</ARRIVAL_TIME>
81
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
82
+ <DISPATCH_TIME>07:40</DISPATCH_TIME>
83
+ <CHECK_POINT>false</CHECK_POINT>
84
+ <DISTANCE>451</DISTANCE>
85
+ </POINT>
86
+ <POINT>
87
+ <NUMBER>7</NUMBER>
88
+ <GEOGRAPHY_NAME>Варшава аэропорт</GEOGRAPHY_NAME>
89
+ <NAME>Терминал Т1 02</NAME>
90
+ <ADDRESS/>
91
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
92
+ <ARRIVAL_TIME>07:50</ARRIVAL_TIME>
93
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
94
+ <DISPATCH_TIME>08:00</DISPATCH_TIME>
95
+ <CHECK_POINT>false</CHECK_POINT>
96
+ <DISTANCE>456</DISTANCE>
97
+ </POINT>
98
+ <POINT>
99
+ <NUMBER>8</NUMBER>
100
+ <GEOGRAPHY_NAME>Лодзь</GEOGRAPHY_NAME>
101
+ <NAME>Plac Niepodleglosci</NAME>
102
+ <ADDRESS/>
103
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
104
+ <ARRIVAL_TIME>09:10</ARRIVAL_TIME>
105
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
106
+ <DISPATCH_TIME>09:20</DISPATCH_TIME>
107
+ <CHECK_POINT>false</CHECK_POINT>
108
+ <DISTANCE>581</DISTANCE>
109
+ </POINT>
110
+ <POINT>
111
+ <NUMBER>9</NUMBER>
112
+ <GEOGRAPHY_NAME>Конин</GEOGRAPHY_NAME>
113
+ <NAME>Dworzec PKP</NAME>
114
+ <ADDRESS/>
115
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
116
+ <ARRIVAL_TIME>10:40</ARRIVAL_TIME>
117
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
118
+ <DISPATCH_TIME>10:50</DISPATCH_TIME>
119
+ <CHECK_POINT>false</CHECK_POINT>
120
+ <DISTANCE>693</DISTANCE>
121
+ </POINT>
122
+ <POINT>
123
+ <NUMBER>10</NUMBER>
124
+ <GEOGRAPHY_NAME>Познань</GEOGRAPHY_NAME>
125
+ <NAME>Poznan Glowny</NAME>
126
+ <ADDRESS>ul.Stanislava Matyi 2</ADDRESS>
127
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
128
+ <ARRIVAL_TIME>11:50</ARRIVAL_TIME>
129
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
130
+ <DISPATCH_TIME>12:00</DISPATCH_TIME>
131
+ <CHECK_POINT>false</CHECK_POINT>
132
+ <DISTANCE>784</DISTANCE>
133
+ </POINT>
134
+ <POINT>
135
+ <NUMBER>11</NUMBER>
136
+ <GEOGRAPHY_NAME>Гожув Велькопольский</GEOGRAPHY_NAME>
137
+ <NAME>Автовокзал</NAME>
138
+ <ADDRESS>ul. Podmiejska, 20</ADDRESS>
139
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
140
+ <ARRIVAL_TIME>13:30</ARRIVAL_TIME>
141
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
142
+ <DISPATCH_TIME>13:40</DISPATCH_TIME>
143
+ <CHECK_POINT>false</CHECK_POINT>
144
+ <DISTANCE>947</DISTANCE>
145
+ </POINT>
146
+ <POINT>
147
+ <NUMBER>12</NUMBER>
148
+ <GEOGRAPHY_NAME>Щецин</GEOGRAPHY_NAME>
149
+ <NAME>Автовокзал</NAME>
150
+ <ADDRESS>pl. Grodnicki,1</ADDRESS>
151
+ <ARRIVAL_DATE>27.06.2015</ARRIVAL_DATE>
152
+ <ARRIVAL_TIME>16:00</ARRIVAL_TIME>
153
+ <DISPATCH_DATE>27.06.2015</DISPATCH_DATE>
154
+ <DISPATCH_TIME/>
155
+ <CHECK_POINT>false</CHECK_POINT>
156
+ <DISTANCE>1055</DISTANCE>
157
+ </POINT>
158
+ </DATA>
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.11.0
4
+ version: 0.12.0
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: 2016-07-27 00:00:00.000000000 Z
12
+ date: 2016-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_xml
@@ -170,6 +170,7 @@ files:
170
170
  - lib/gillbus/get_required_fields.rb
171
171
  - lib/gillbus/get_time_table.rb
172
172
  - lib/gillbus/get_trip_seats.rb
173
+ - lib/gillbus/get_trip_segments.rb
173
174
  - lib/gillbus/get_trips.rb
174
175
  - lib/gillbus/helpers/fields.rb
175
176
  - lib/gillbus/helpers/parser.rb
@@ -211,6 +212,7 @@ files:
211
212
  - test/get_order_ticket_test.rb
212
213
  - test/get_time_table_test.rb
213
214
  - test/get_trip_seats_test.rb
215
+ - test/get_trip_segments_test.rb
214
216
  - test/lock_seats_test.rb
215
217
  - test/reserve_tickets_test.rb
216
218
  - test/responses/buyBooking.xml
@@ -225,6 +227,7 @@ files:
225
227
  - test/responses/getTripSeats-one-empty-segment.xml
226
228
  - test/responses/getTripSeats-segments.xml
227
229
  - test/responses/getTripSeats.xml
230
+ - test/responses/getTripSegments.xml
228
231
  - test/responses/lockSeats.xml
229
232
  - test/responses/reserveTickets.xml
230
233
  - test/responses/searchTrips-empty.xml
@@ -274,6 +277,7 @@ test_files:
274
277
  - test/get_order_ticket_test.rb
275
278
  - test/get_time_table_test.rb
276
279
  - test/get_trip_seats_test.rb
280
+ - test/get_trip_segments_test.rb
277
281
  - test/lock_seats_test.rb
278
282
  - test/reserve_tickets_test.rb
279
283
  - test/responses/buyBooking.xml
@@ -288,6 +292,7 @@ test_files:
288
292
  - test/responses/getTripSeats-one-empty-segment.xml
289
293
  - test/responses/getTripSeats-segments.xml
290
294
  - test/responses/getTripSeats.xml
295
+ - test/responses/getTripSegments.xml
291
296
  - test/responses/lockSeats.xml
292
297
  - test/responses/reserveTickets.xml
293
298
  - test/responses/searchTrips-empty.xml