easy_transilien 0.0.9 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/{CHANGELOG → Changelog.md} +3 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +44 -36
- data/README.md +4 -1
- data/easy_transilien.gemspec +1 -1
- data/lib/easy_transilien/version.rb +1 -1
- data/spec/line_spec.rb +5 -5
- data/spec/station_spec.rb +16 -16
- data/spec/stop_spec.rb +4 -4
- data/spec/trip_spec.rb +15 -15
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8b47b17351287300d009b406f9288b901a45eba
|
4
|
+
data.tar.gz: e2411d303d225e9d230226e8549eaf16a0326b5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82cd4f531776644100cd7beb24d8c1b192327dd983c513093accf3d5afea726003aeda1a6518e7bae5c405ba7e42f144de960f2433f774aaedb7c009bf2b3257
|
7
|
+
data.tar.gz: 70f9a6901f5cd59b07d28757b8cac90e03b4a1f81f559f4655b3e05ee7ffcb922c079c32341744cc2aaebb949ee0bb90e46853e3c40c75ace466c0d57a047881
|
data/.travis.yml
ADDED
data/{CHANGELOG → Changelog.md}
RENAMED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,64 +1,71 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
easy_transilien (0.0
|
5
|
-
transilien_microservices (~>
|
4
|
+
easy_transilien (1.0.0)
|
5
|
+
transilien_microservices (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
celluloid (0.
|
11
|
-
timers (~>
|
10
|
+
celluloid (0.16.0)
|
11
|
+
timers (~> 4.0.0)
|
12
12
|
coderay (1.1.0)
|
13
13
|
diff-lcs (1.2.5)
|
14
|
-
faraday (0.9.
|
14
|
+
faraday (0.9.2)
|
15
15
|
multipart-post (>= 1.2, < 3)
|
16
|
-
ffi (1.9.
|
17
|
-
formatador (0.2.
|
18
|
-
guard (2.
|
16
|
+
ffi (1.9.6)
|
17
|
+
formatador (0.2.5)
|
18
|
+
guard (2.6.1)
|
19
19
|
formatador (>= 0.2.4)
|
20
|
-
listen (~> 2.
|
20
|
+
listen (~> 2.7)
|
21
21
|
lumberjack (~> 1.0)
|
22
22
|
pry (>= 0.9.12)
|
23
23
|
thor (>= 0.18.1)
|
24
|
-
guard-rspec (4.
|
24
|
+
guard-rspec (4.3.1)
|
25
25
|
guard (~> 2.1)
|
26
26
|
rspec (>= 2.14, < 4.0)
|
27
|
-
|
27
|
+
hitimes (1.2.2)
|
28
|
+
listen (2.7.11)
|
28
29
|
celluloid (>= 0.15.2)
|
29
30
|
rb-fsevent (>= 0.9.3)
|
30
31
|
rb-inotify (>= 0.9)
|
31
|
-
lumberjack (1.0.
|
32
|
+
lumberjack (1.0.9)
|
32
33
|
method_source (0.8.2)
|
33
|
-
|
34
|
+
mini_portile2 (2.0.0)
|
34
35
|
multipart-post (2.0.0)
|
35
|
-
nokogiri (1.6.1)
|
36
|
-
|
37
|
-
pry (0.
|
38
|
-
coderay (~> 1.0)
|
39
|
-
method_source (~> 0.8)
|
36
|
+
nokogiri (1.6.7.1)
|
37
|
+
mini_portile2 (~> 2.0.0.rc2)
|
38
|
+
pry (0.10.1)
|
39
|
+
coderay (~> 1.1.0)
|
40
|
+
method_source (~> 0.8.1)
|
40
41
|
slop (~> 3.4)
|
41
|
-
pry-doc (0.
|
42
|
-
pry (
|
43
|
-
yard (
|
42
|
+
pry-doc (0.6.0)
|
43
|
+
pry (~> 0.9)
|
44
|
+
yard (~> 0.8)
|
45
|
+
rake (10.3.2)
|
44
46
|
rb-fsevent (0.9.4)
|
45
|
-
rb-inotify (0.9.
|
47
|
+
rb-inotify (0.9.5)
|
46
48
|
ffi (>= 0.5.0)
|
47
|
-
rspec (
|
48
|
-
rspec-core (~>
|
49
|
-
rspec-expectations (~>
|
50
|
-
rspec-mocks (~>
|
51
|
-
rspec-core (
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
49
|
+
rspec (3.1.0)
|
50
|
+
rspec-core (~> 3.1.0)
|
51
|
+
rspec-expectations (~> 3.1.0)
|
52
|
+
rspec-mocks (~> 3.1.0)
|
53
|
+
rspec-core (3.1.7)
|
54
|
+
rspec-support (~> 3.1.0)
|
55
|
+
rspec-expectations (3.1.2)
|
56
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
+
rspec-support (~> 3.1.0)
|
58
|
+
rspec-mocks (3.1.3)
|
59
|
+
rspec-support (~> 3.1.0)
|
60
|
+
rspec-support (3.1.2)
|
61
|
+
slop (3.6.0)
|
62
|
+
thor (0.19.1)
|
63
|
+
timers (4.0.1)
|
64
|
+
hitimes
|
65
|
+
transilien_microservices (1.0.0)
|
59
66
|
faraday (>= 0.8.4)
|
60
|
-
nokogiri (>= 1.
|
61
|
-
yard (0.8.7.
|
67
|
+
nokogiri (>= 1.6)
|
68
|
+
yard (0.8.7.4)
|
62
69
|
|
63
70
|
PLATFORMS
|
64
71
|
ruby
|
@@ -68,4 +75,5 @@ DEPENDENCIES
|
|
68
75
|
guard-rspec
|
69
76
|
pry
|
70
77
|
pry-doc
|
78
|
+
rake
|
71
79
|
rspec
|
data/README.md
CHANGED
@@ -4,9 +4,12 @@ Ruby wrapper for transilien_microservices ruby gem: make data easy to fetch.
|
|
4
4
|
|
5
5
|
The original gem: http://rubygems.org/gems/transilien_microservices
|
6
6
|
|
7
|
+
[![Build Status](https://travis-ci.org/ook/easy_transilien.svg?branch=master)](https://travis-ci.org/ook/easy_transilien)
|
8
|
+
|
7
9
|
## Installation
|
8
10
|
|
9
|
-
Gem developped
|
11
|
+
Gem developped and maintened against rubies from 1.9 to 2.1.
|
12
|
+
Remember: ruby 1.8 died in mid-2013, not necessary to lost time on it.
|
10
13
|
|
11
14
|
Add this line to your application's Gemfile:
|
12
15
|
|
data/easy_transilien.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.homepage = "https://github.com/ook/easy_transilien"
|
14
14
|
gem.license = 'MIT'
|
15
15
|
|
16
|
-
gem.add_runtime_dependency('transilien_microservices', '~>
|
16
|
+
gem.add_runtime_dependency('transilien_microservices', '~> 1.0') # Hey, it's a wrapper, so we must wrap it ;)
|
17
17
|
|
18
18
|
gem.files = `git ls-files`.split($/)
|
19
19
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/spec/line_spec.rb
CHANGED
@@ -5,12 +5,12 @@ describe EasyTransilien::Line do
|
|
5
5
|
@line = EasyTransilien::Line.find('laz').first
|
6
6
|
end
|
7
7
|
|
8
|
-
it '
|
9
|
-
@line.is_a?(EasyTransilien::Line).
|
8
|
+
it 'expect get some Line when searching for laz' do
|
9
|
+
expect(@line.is_a?(EasyTransilien::Line)).to be_truthy
|
10
10
|
end
|
11
11
|
|
12
|
-
it '
|
13
|
-
@line.codes.is_a?(Array).
|
14
|
-
@line.codes.empty
|
12
|
+
it 'expect have at least one codes' do
|
13
|
+
expect(@line.codes.is_a?(Array)).to be_truthy
|
14
|
+
expect(@line.codes.empty?).to be_falsey
|
15
15
|
end
|
16
16
|
end
|
data/spec/station_spec.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe EasyTransilien::Station do
|
4
|
-
it '
|
4
|
+
it 'expect get some Station when searching for argenteuil' do
|
5
5
|
col = EasyTransilien::Station.find('argenteuil')
|
6
|
-
col.is_a?(Array).
|
7
|
-
col.first.is_a?(EasyTransilien::Station).
|
8
|
-
col.length.
|
6
|
+
expect(col.is_a?(Array)).to be_truthy
|
7
|
+
expect(col.first.is_a?(EasyTransilien::Station)).to be_truthy
|
8
|
+
expect(col.length).to eql(2)
|
9
9
|
end
|
10
|
-
it '
|
10
|
+
it 'expect get all Station for empty search' do
|
11
11
|
col = EasyTransilien::Station.find
|
12
|
-
col.is_a?(Array).
|
13
|
-
(col.length > 0).
|
12
|
+
expect(col.is_a?(Array)).to be_truthy
|
13
|
+
expect(col.length > 0).to be_truthy
|
14
14
|
end
|
15
15
|
|
16
|
-
it '
|
16
|
+
it 'expect get at least a Line for a Station' do
|
17
17
|
station = EasyTransilien::Station.find('Val d\'Argenteuil').first
|
18
|
-
station.lines.is_a?(Array).
|
19
|
-
(station.lines.length > 0).
|
20
|
-
station.lines[0].is_a?(EasyTransilien::Line).
|
18
|
+
expect(station.lines.is_a?(Array)).to be_truthy
|
19
|
+
expect(station.lines.length > 0).to be_truthy
|
20
|
+
expect(station.lines[0].is_a?(EasyTransilien::Line)).to be_truthy
|
21
21
|
end
|
22
22
|
|
23
|
-
it '
|
23
|
+
it 'expect get at least one line_letters for a Station' do
|
24
24
|
station = EasyTransilien::Station.find('Val d\'Argenteuil').first
|
25
|
-
station.codes.is_a?(Array).
|
26
|
-
(station.codes.length > 0).
|
27
|
-
station.codes[0].is_a?(String).
|
28
|
-
station.codes[0].
|
25
|
+
expect(station.codes.is_a?(Array)).to be_truthy
|
26
|
+
expect(station.codes.length > 0).to be_truthy
|
27
|
+
expect(station.codes[0].is_a?(String)).to be_truthy
|
28
|
+
expect(station.codes[0]).to eql('J')
|
29
29
|
end
|
30
30
|
end
|
data/spec/stop_spec.rb
CHANGED
@@ -5,14 +5,14 @@ MS_STOP_PAYLOAD = "<Stop StopIdx=\"3856503\" StopPointIdx=\"37162\" VehicleJourn
|
|
5
5
|
Noko_Payload = Nokogiri.XML(MS_STOP_PAYLOAD)
|
6
6
|
|
7
7
|
describe EasyTransilien::Stop do
|
8
|
-
it '
|
8
|
+
it 'expect get valid #time from ms_stop' do
|
9
9
|
time = Time.new
|
10
10
|
ms_stop = Transilien::Stop.from_node(Noko_Payload, time)
|
11
11
|
|
12
12
|
es = EasyTransilien::Stop.new
|
13
13
|
es.ms_stop = ms_stop
|
14
|
-
es.is_a?(EasyTransilien::Stop).
|
15
|
-
es.time.is_a?(Time).
|
16
|
-
es.time.
|
14
|
+
expect(es.is_a?(EasyTransilien::Stop)).to be_truthy
|
15
|
+
expect(es.time.is_a?(Time)).to be_truthy
|
16
|
+
expect(es.time).to eql(Time.local(time.year,time.month,time.day,14,40))
|
17
17
|
end
|
18
18
|
end
|
data/spec/trip_spec.rb
CHANGED
@@ -4,45 +4,45 @@ describe EasyTransilien::Trip do
|
|
4
4
|
before(:each) do
|
5
5
|
end
|
6
6
|
|
7
|
-
it '
|
7
|
+
it 'expect get some Trip s from a simple search' do
|
8
8
|
trips = EasyTransilien::Trip.find('val d\'argenteuil', 'paris saint-lazare')
|
9
|
-
trips.first.is_a?(EasyTransilien::Trip).
|
9
|
+
expect(trips.first.is_a?(EasyTransilien::Trip)).to be_truthy
|
10
10
|
end
|
11
11
|
|
12
|
-
it '
|
12
|
+
it 'expect accepts options[:at] and handle last at default_duration' do
|
13
13
|
at = Time.now
|
14
14
|
trips = EasyTransilien::Trip.find('val d\'argenteuil', 'paris saint-lazare', {at: at})
|
15
|
-
trips.first.at.
|
16
|
-
trips.first.last.
|
15
|
+
expect(trips.first.at).to eql(at)
|
16
|
+
expect(trips.first.last).to eql(at + 3600)
|
17
17
|
end
|
18
18
|
|
19
|
-
it '
|
19
|
+
it 'expect accepts options[:at] AND options[:last] at the same time' do
|
20
20
|
at = Time.now
|
21
21
|
last = Time.now + 3600 * 2 + 42 # arbitrary…
|
22
22
|
trips = EasyTransilien::Trip.find('val d\'argenteuil', 'paris saint-lazare', {at: at, last: last})
|
23
|
-
trips.first.at.
|
24
|
-
trips.first.last.
|
23
|
+
expect(trips.first.at).to eql(at)
|
24
|
+
expect(trips.first.last).to eql(last)
|
25
25
|
end
|
26
26
|
|
27
|
-
it '
|
27
|
+
it 'expect auto sort when at is after last' do
|
28
28
|
last = Time.now
|
29
29
|
at = Time.now + 3600 * 2 + 42 # arbitrary…
|
30
30
|
trips = EasyTransilien::Trip.find('val d\'argenteuil', 'paris saint-lazare', {at: at, last: last})
|
31
|
-
trips.first.at.
|
32
|
-
trips.first.last.
|
31
|
+
expect(trips.first.at).to eql(last)
|
32
|
+
expect(trips.first.last).to eql(at)
|
33
33
|
end
|
34
34
|
|
35
|
-
it '
|
35
|
+
it 'expect autoset at and last for options[:whole_day]' do
|
36
36
|
hoy = Time.new
|
37
37
|
trips = EasyTransilien::Trip.find('val d\'argenteuil', 'paris saint-lazare', {whole_day: true})
|
38
|
-
trips.first.at.
|
38
|
+
expect(trips.first.at).to eql(Time.new(hoy.year, hoy.month, hoy.day, 0, 0, 1))
|
39
39
|
end
|
40
40
|
|
41
|
-
it '
|
41
|
+
it 'expect ignore options :at and :last when :whole_day is set' do
|
42
42
|
hoy = Time.new
|
43
43
|
at = Time.now
|
44
44
|
last = Time.now + 3600 * 2 + 42 # arbitrary…
|
45
45
|
trips = EasyTransilien::Trip.find('val d\'argenteuil', 'paris saint-lazare', {whole_day: true, at: at, last: last})
|
46
|
-
trips.first.at.
|
46
|
+
expect(trips.first.at).to eql(Time.new(hoy.year, hoy.month, hoy.day, 0, 0, 1))
|
47
47
|
end
|
48
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_transilien
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Lecavelier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: transilien_microservices
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '1.0'
|
27
27
|
description: 'Access SNCF Transilien micro-services datan the easy way: enable access
|
28
28
|
to their theoric offer.'
|
29
29
|
email:
|
@@ -35,7 +35,8 @@ files:
|
|
35
35
|
- .gitignore
|
36
36
|
- .rspec
|
37
37
|
- .ruby-version
|
38
|
-
-
|
38
|
+
- .travis.yml
|
39
|
+
- Changelog.md
|
39
40
|
- Gemfile
|
40
41
|
- Gemfile.lock
|
41
42
|
- Guardfile
|
@@ -75,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
76
|
version: '0'
|
76
77
|
requirements: []
|
77
78
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
79
|
+
rubygems_version: 2.4.8
|
79
80
|
signing_key:
|
80
81
|
specification_version: 4
|
81
82
|
summary: See https://github.com/ook/easy_transilien
|