station_master 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/station_master/ask.rb +1 -1
- data/lib/station_master/schedule.rb +3 -3
- data/lib/station_master/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32b9f5de932077df843d30f145c23fb5c9887f13
|
4
|
+
data.tar.gz: 67709ee0e31c63b17c00197e1e0894f51d5c54f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b84730ab2ce3f46adf37bfd9702021a340b7bc41015d9a4e59290e68eb7402708bc2c962f5c5d6f585f0b2a948f675960134fc3a68c86687185477f3151e357f
|
7
|
+
data.tar.gz: e4d36ac384e938e1935fe0938bf1f14a75fea998d3cff0f11977861fab02c5a0c68acb3d685ac5fe8710f6f51c914127b1b3fa373e93bcee41d625a39aafe36e
|
data/README.md
CHANGED
data/lib/station_master/ask.rb
CHANGED
@@ -26,7 +26,7 @@ module StationMaster
|
|
26
26
|
nil
|
27
27
|
end
|
28
28
|
|
29
|
-
ask!(
|
29
|
+
ask!(request_url) if request_url
|
30
30
|
end
|
31
31
|
|
32
32
|
def format_time(time)
|
@@ -41,7 +41,7 @@ module StationMaster
|
|
41
41
|
@train_code = hash[:numeroTreno]
|
42
42
|
@train_type = hash[:categoria]
|
43
43
|
@origin = hash[:origine]
|
44
|
-
@platform = (hash[:binarioProgrammatoArrivoDescrizione]|| '0').strip
|
44
|
+
@platform = (hash[:binarioProgrammatoArrivoDescrizione].to_s || '0').strip
|
45
45
|
@time = Time.at((hash[:orarioArrivo] || 0) / 1000)
|
46
46
|
@delay = hash[:ritardo]
|
47
47
|
end
|
@@ -65,7 +65,7 @@ module StationMaster
|
|
65
65
|
@train_code = hash[:numeroTreno]
|
66
66
|
@train_type = hash[:categoria]
|
67
67
|
@destination = hash[:destinazione]
|
68
|
-
@platform = (hash[:binarioProgrammatoPartenzaDescrizione] || 0).strip
|
68
|
+
@platform = (hash[:binarioProgrammatoPartenzaDescrizione].to_s || '0').strip
|
69
69
|
@time = Time.at((hash[:orarioPartenza] || 0) / 1000)
|
70
70
|
@delay = hash[:ritardo]
|
71
71
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -9,6 +9,9 @@ include WebMock::API
|
|
9
9
|
require 'benchmark'
|
10
10
|
|
11
11
|
RSpec.configure do |config|
|
12
|
+
config.filter_run :focus => true
|
13
|
+
config.run_all_when_everything_filtered = true
|
14
|
+
|
12
15
|
# stubs for Station.all
|
13
16
|
config.before(:each) do
|
14
17
|
stub_request(:get, 'http://www.viaggiatreno.it/viaggiatrenonew/resteasy/viaggiatreno/elencoStazioni/0').
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: station_master
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Ordine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This gem provide an interface to an api from www.viaggiatreno.it public
|
14
14
|
site. This project exploits the api that the site uses to build up the front-end
|