ztm_warszawa 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edb65a00d5d254953f3e4279c69ad8dbfbc83787
4
- data.tar.gz: 85b887a46eedad4774862c791426ce347483dfe0
3
+ metadata.gz: 3a09f75e478850781ed4613f9c2ea504f4e3d2c0
4
+ data.tar.gz: 336b877fd3ee308266e5daa33b1c0848664ffa38
5
5
  SHA512:
6
- metadata.gz: 0e336a47c5b6a9e7a92f01a2222f9b9150be747d42c040281e453edbada089c690876e1d0c4392929942ee808b402cf55002c7ba61c3d85fefd3e7ecd888ce21
7
- data.tar.gz: ccc58044bedb352dcf68f8d032bf2d33b4fe59244267a7aa2b51cd4d68b4288dfa9196f266d08b533567b2ff3a05cf69ce53584ef58106c68faa45d3ed23fd14
6
+ metadata.gz: 24cbe504c66d951ab59668a24c14365151de7dce556d09f2e13829c15c3dbd04ef8f8f1af0e95f7dd226a175ee88bca8c2930c512a96462785ae0859f8df2ba3
7
+ data.tar.gz: ab14856d78bebbc7e1206863881388850faaba43b2fc5c4e4d84e371f819bfbd713d93f81580f7dfce1e6fd1f25699f28ee1906222b6eb58c91f68a7f3e504bc
data/README.md CHANGED
@@ -46,7 +46,7 @@ Now, you can use the following methods:
46
46
 
47
47
  - `get_bus_lines(bus_stop_id, bus_stop_no)`: Returns an array of bus lines (e.g. 527, 141...) that depart from a given bus stop.
48
48
 
49
- - `get_line_departure_hours(bus_stop_id, bus_stop_no, bus_line)`: Returns the server response with all the hours of departure of a given bus line from a given bus stop.
49
+ - `get_line_departure_hours(bus_stop_id, bus_stop_no, bus_line)`: Returns the server response with all the hours of departure of a given bus line from a given bus stop. Night bus lines (e.g. N37, N85...) are not supported due to some server-side errors.
50
50
 
51
51
  - `get_closest_departures(server_response, script_starting_time, bus_line, number_of_departures)`: Given the server's response from `get_line_departure_hours()`, finds a given number of closest departures. The result is an array of hashes with "bus_line" and "time" entries.
52
52
 
@@ -1,3 +1,3 @@
1
1
  class ZtmWarszawa
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/ztm_warszawa.rb CHANGED
@@ -37,6 +37,7 @@ class ZtmWarszawa
37
37
 
38
38
  # Returns the server response with all the hours of departure of a given bus line from a given bus stop.
39
39
  def get_line_departure_hours(bus_stop_id, bus_stop_no, bus_line)
40
+ raise 'Night bus lines are not supported due to some server-side errors.' if bus_line.start_with? "N"
40
41
  url = "https://api.um.warszawa.pl/api/action/dbtimetable_get?id=e923fa0e-d96c-43f9-ae6e-60518c9f3238&busstopId=#{bus_stop_id}&busstopNr=#{bus_stop_no}&line=#{bus_line}&apikey=#{@api_key}"
41
42
  response = HTTParty.get(url).parsed_response["result"]
42
43
  return response
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ztm_warszawa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Górni
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-26 00:00:00.000000000 Z
11
+ date: 2016-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty