skiplan_client 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +26 -26
- data/README.md +77 -77
- data/data/lumi_response.xml +1392 -1392
- data/lib/skiplan_client.rb +82 -82
- data/lib/skiplan_client/attribute_helper.rb +10 -10
- data/lib/skiplan_client/forecast.rb +62 -62
- data/lib/skiplan_client/metrics.rb +83 -83
- data/lib/skiplan_client/skiplan.rb +11 -10
- data/lib/skiplan_client/version.rb +3 -3
- data/lib/skiplan_client/zone.rb +34 -34
- data/skiplan_client.gemspec +27 -27
- data/test/skiplan_client/forecast_test.rb +37 -37
- data/test/skiplan_client/metrics_test.rb +98 -98
- data/test/skiplan_client/skiplan_client_test.rb +102 -100
- data/test/skiplan_client/zone_test.rb +50 -50
- metadata +4 -4
@@ -1,51 +1,51 @@
|
|
1
|
-
# encoding : UTF-8
|
2
|
-
require 'rubygems'
|
3
|
-
require 'test/unit'
|
4
|
-
require 'shoulda-context'
|
5
|
-
require 'skiplan_client/zone'
|
6
|
-
|
7
|
-
class ZoneTest < Test::Unit::TestCase
|
8
|
-
|
9
|
-
setup do
|
10
|
-
attributes = {'nom' => 'ALPIN CHINAILLON',
|
11
|
-
'REMONTEE' => [{
|
12
|
-
'nom' => 'TS LA FLORIA', 'etat' => 'O', 'type' => 'TS', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:45',
|
13
|
-
'MSG_ASSOCIE' => ['message fr', 'message en']
|
14
|
-
},
|
15
|
-
{'nom' => 'TK LE STADE', 'etat' => 'F', 'type' => 'TK', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:00'}],
|
16
|
-
'PISTE' => [{'nom' => 'LA SERPENTINE', 'etat' => 'F', 'type' => 'A', 'msg' => 'Piste de retour au Village', 'niveau' => 'V', 'entretien_num' => '1'},
|
17
|
-
{'nom' => 'LE VENAY', 'etat' => 'O', 'type' => 'A', 'msg' => '', 'niveau' => 'V', 'entretien_num' => '0'}],
|
18
|
-
'Liaison' => [{'nom' => 'DOUCYCOMBELOUVIERE', 'etat' => 'F'}, {'nom' => 'ST FRANCOIS', 'etat' => 'O'}]
|
19
|
-
|
20
|
-
}
|
21
|
-
@zone = Zone.new(attributes)
|
22
|
-
end
|
23
|
-
|
24
|
-
should 'retrieve the data for a given zone' do
|
25
|
-
assert_equal 'ALPIN CHINAILLON', @zone.name
|
26
|
-
assert_equal [{
|
27
|
-
'nom' => 'TS LA FLORIA', 'etat' => 'O', 'type' => 'TS', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:45',
|
28
|
-
'MSG_ASSOCIE' => ['message fr', 'message en']
|
29
|
-
},
|
30
|
-
{'nom' => 'TK LE STADE', 'etat' => 'F', 'type' => 'TK', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:00'}], @zone.skilifts
|
31
|
-
assert_equal [{'nom' => 'LA SERPENTINE', 'etat' => 'F', 'type' => 'A', 'msg' => 'Piste de retour au Village', 'niveau' => 'V', 'entretien_num' => '1'},
|
32
|
-
{'nom' => 'LE VENAY', 'etat' => 'O', 'type' => 'A', 'msg' => '', 'niveau' => 'V', 'entretien_num' => '0'}], @zone.slopes
|
33
|
-
assert_equal [{'nom' => 'DOUCYCOMBELOUVIERE', 'etat' => 'F'}, {'nom' => 'ST FRANCOIS', 'etat' => 'O'}], @zone.connections
|
34
|
-
end
|
35
|
-
|
36
|
-
should 'store an array of slopes even when only one slope is present' do
|
37
|
-
attributes = {'nom' => 'PIETONS',
|
38
|
-
'PISTE' => {'nom' => 'Chemin pieton', 'etat' => 'F', 'type' => 'PE', 'msg' => 'Chemin', 'entretien_num' => '0'}
|
39
|
-
}
|
40
|
-
@zone = Zone.new(attributes)
|
41
|
-
assert_equal [{'nom' => 'Chemin pieton', 'etat' => 'F', 'type' => 'PE', 'msg' => 'Chemin', 'entretien_num' => '0'}], @zone.slopes
|
42
|
-
end
|
43
|
-
|
44
|
-
should 'return the ratio of open skilifts' do
|
45
|
-
assert_equal '1/2', @zone.ratio(@zone.skilifts)
|
46
|
-
end
|
47
|
-
|
48
|
-
should 'return the ratio of open slopes' do
|
49
|
-
assert_equal '1/2', @zone.ratio(@zone.slopes)
|
50
|
-
end
|
1
|
+
# encoding : UTF-8
|
2
|
+
require 'rubygems'
|
3
|
+
require 'test/unit'
|
4
|
+
require 'shoulda-context'
|
5
|
+
require 'skiplan_client/zone'
|
6
|
+
|
7
|
+
class ZoneTest < Test::Unit::TestCase
|
8
|
+
|
9
|
+
setup do
|
10
|
+
attributes = {'nom' => 'ALPIN CHINAILLON',
|
11
|
+
'REMONTEE' => [{
|
12
|
+
'nom' => 'TS LA FLORIA', 'etat' => 'O', 'type' => 'TS', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:45',
|
13
|
+
'MSG_ASSOCIE' => ['message fr', 'message en']
|
14
|
+
},
|
15
|
+
{'nom' => 'TK LE STADE', 'etat' => 'F', 'type' => 'TK', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:00'}],
|
16
|
+
'PISTE' => [{'nom' => 'LA SERPENTINE', 'etat' => 'F', 'type' => 'A', 'msg' => 'Piste de retour au Village', 'niveau' => 'V', 'entretien_num' => '1'},
|
17
|
+
{'nom' => 'LE VENAY', 'etat' => 'O', 'type' => 'A', 'msg' => '', 'niveau' => 'V', 'entretien_num' => '0'}],
|
18
|
+
'Liaison' => [{'nom' => 'DOUCYCOMBELOUVIERE', 'etat' => 'F'}, {'nom' => 'ST FRANCOIS', 'etat' => 'O'}]
|
19
|
+
|
20
|
+
}
|
21
|
+
@zone = Zone.new(attributes)
|
22
|
+
end
|
23
|
+
|
24
|
+
should 'retrieve the data for a given zone' do
|
25
|
+
assert_equal 'ALPIN CHINAILLON', @zone.name
|
26
|
+
assert_equal [{
|
27
|
+
'nom' => 'TS LA FLORIA', 'etat' => 'O', 'type' => 'TS', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:45',
|
28
|
+
'MSG_ASSOCIE' => ['message fr', 'message en']
|
29
|
+
},
|
30
|
+
{'nom' => 'TK LE STADE', 'etat' => 'F', 'type' => 'TK', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:00'}], @zone.skilifts
|
31
|
+
assert_equal [{'nom' => 'LA SERPENTINE', 'etat' => 'F', 'type' => 'A', 'msg' => 'Piste de retour au Village', 'niveau' => 'V', 'entretien_num' => '1'},
|
32
|
+
{'nom' => 'LE VENAY', 'etat' => 'O', 'type' => 'A', 'msg' => '', 'niveau' => 'V', 'entretien_num' => '0'}], @zone.slopes
|
33
|
+
assert_equal [{'nom' => 'DOUCYCOMBELOUVIERE', 'etat' => 'F'}, {'nom' => 'ST FRANCOIS', 'etat' => 'O'}], @zone.connections
|
34
|
+
end
|
35
|
+
|
36
|
+
should 'store an array of slopes even when only one slope is present' do
|
37
|
+
attributes = {'nom' => 'PIETONS',
|
38
|
+
'PISTE' => {'nom' => 'Chemin pieton', 'etat' => 'F', 'type' => 'PE', 'msg' => 'Chemin', 'entretien_num' => '0'}
|
39
|
+
}
|
40
|
+
@zone = Zone.new(attributes)
|
41
|
+
assert_equal [{'nom' => 'Chemin pieton', 'etat' => 'F', 'type' => 'PE', 'msg' => 'Chemin', 'entretien_num' => '0'}], @zone.slopes
|
42
|
+
end
|
43
|
+
|
44
|
+
should 'return the ratio of open skilifts' do
|
45
|
+
assert_equal '1/2', @zone.ratio(@zone.skilifts)
|
46
|
+
end
|
47
|
+
|
48
|
+
should 'return the ratio of open slopes' do
|
49
|
+
assert_equal '1/2', @zone.ratio(@zone.slopes)
|
50
|
+
end
|
51
51
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skiplan_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SimonRonzani
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -97,7 +97,7 @@ dependencies:
|
|
97
97
|
version: '0'
|
98
98
|
description: SkiPlan API client gem
|
99
99
|
email:
|
100
|
-
-
|
100
|
+
- jeanbaptistevilain@gmail.com
|
101
101
|
executables: []
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.4.5.1
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: A simple Ruby wrapper for the SkiPlan XML api
|