gares 2.0.0 → 2.0.1
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/lib/gares/base.rb +1 -1
- data/lib/gares/version.rb +1 -1
- data/spec/fixtures/87271007.json +21 -0
- data/spec/gares/station_spec.rb +10 -0
- data/spec/spec_helper.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4702068cf0cdbfaa09688c6d7ca85b761c7ee3f3
|
4
|
+
data.tar.gz: 77b3f7296d478e7c508843910e5fe8e367bf9334
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfbb732a4c47ed9fa44439e45d3a05cbaa2c0134422154a7a63f332d73dd0316c98f5d1042ff5afc3fe142293dd8003a4fcaab1e56022321c991fc7295dddade
|
7
|
+
data.tar.gz: 9263b6f9f0d56f0f7062c5dac8a70fface1ed59f3d6a1b81554483c21170faa97826004809b2bcf4cb8ea1cde4dd21bb8f4b80b21a9e25aba9db02d65dd36f6e
|
data/lib/gares/base.rb
CHANGED
data/lib/gares/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Server: nginx
|
3
|
+
Date: Fri, 08 May 2015 14:21:22 GMT
|
4
|
+
Content-Type: application/json; charset=utf-8
|
5
|
+
Transfer-Encoding: chunked
|
6
|
+
Connection: keep-alive
|
7
|
+
X-RateLimit-Remaining: 4960
|
8
|
+
Access-Control-Allow-Headers: Authorization, X-Requested-With, Origin, ODS-API-Analytics-App, ODS-Widgets-Version
|
9
|
+
Content-Language: fr
|
10
|
+
Access-Control-Max-Age: 1000
|
11
|
+
Expires: Fri, 01 Jan 1990 00:00:00 GMT
|
12
|
+
Vary: Accept-Language, Cookie, Host
|
13
|
+
X-RateLimit-Limit: 5000
|
14
|
+
Pragma: no-cache
|
15
|
+
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
|
16
|
+
Access-Control-Allow-Origin: *
|
17
|
+
Access-Control-Allow-Methods: POST, GET, OPTIONS
|
18
|
+
X-RateLimit-Reset: 1431129600
|
19
|
+
X-UA-Compatible: IE=edge
|
20
|
+
|
21
|
+
{"nhits": 1, "parameters": {"dataset": ["referentiel-gares-voyageurs"], "q": "0087271007", "rows": 10, "format": "json"}, "records": [{"datasetid": "referentiel-gares-voyageurs", "recordid": "9d286d234095e70362859cc9561e362d49bd2734", "fields": {"departement": "Paris", "commune": "Paris", "uic": "0087271007", "code_postal": "75010", "code_gare": "02561", "region": "\u00cele-de-France", "tvs": "PNO PNO_TRANS", "departement_commune": "75-056", "agence_gare": "AG Ile-de-France", "nombre_plateformes": "4", "niveau_de_service": "3", "segment_drg": "a", "region_sncf": "REGION DE PARIS-NORD", "intitule_gare": "Paris Nord"}, "record_timestamp": "2015-02-09T10:19:37.908942"}]}
|
data/spec/gares/station_spec.rb
CHANGED
@@ -57,5 +57,15 @@ describe Gares::Station do
|
|
57
57
|
it { expect(subject.has_borne?).to be(true) }
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
context 'A station with a strange TVS number from SNCF open data - Paris Gare-du-Nord' do
|
62
|
+
subject do
|
63
|
+
Gares::Station.find_by_sncf_id('frpno')
|
64
|
+
end
|
65
|
+
|
66
|
+
describe 'a gare with a BLS' do
|
67
|
+
it { expect(subject.send(:tvs)).to eq("PNO") }
|
68
|
+
end
|
69
|
+
end
|
60
70
|
end
|
61
71
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -24,7 +24,8 @@ end
|
|
24
24
|
GARES_SAMPLES = {
|
25
25
|
'https://raw.githubusercontent.com/capitainetrain/stations/master/stations.csv' => 'stations.csv',
|
26
26
|
'https://raw.githubusercontent.com/paulrbr/stations/stations-with-bls/stations.csv' => 'bls.csv',
|
27
|
-
'https://ressources.data.sncf.com/api/records/1.0/search?dataset=referentiel-gares-voyageurs&q=0087723197' => '87723197.json',
|
27
|
+
'https://ressources.data.sncf.com/api/records/1.0/search?dataset=referentiel-gares-voyageurs&q=0087723197' => '87723197.json', # Lyon Part-Dieu
|
28
|
+
'https://ressources.data.sncf.com/api/records/1.0/search?dataset=referentiel-gares-voyageurs&q=0087271007' => '87271007.json', # Paris Gare-du-Nord
|
28
29
|
'http://www.gares-sncf.com/fr/train-times/arrival/LYD/gl' => 'LYD-arrivals.json',
|
29
30
|
'http://www.gares-sncf.com/fr/train-times/departure/LYD/gl' => 'LYD-departures.json'
|
30
31
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gares
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Bonaud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -236,6 +236,7 @@ files:
|
|
236
236
|
- lib/gares/train_stop.rb
|
237
237
|
- lib/gares/version.rb
|
238
238
|
- lib/string_extensions.rb
|
239
|
+
- spec/fixtures/87271007.json
|
239
240
|
- spec/fixtures/87723197.json
|
240
241
|
- spec/fixtures/LYD-arrivals.json
|
241
242
|
- spec/fixtures/LYD-departures.json
|