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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df738d594ab16a40db34035ac5d6ce7f7bbf3150
4
- data.tar.gz: 4f7356d8d51a5cddf828545d04b12c31499d3f35
3
+ metadata.gz: 32b9f5de932077df843d30f145c23fb5c9887f13
4
+ data.tar.gz: 67709ee0e31c63b17c00197e1e0894f51d5c54f4
5
5
  SHA512:
6
- metadata.gz: f2ce2af4504d1e9540f2edc4df1316171c2ea3cc7cc05ba6b3dd0c1fa1716aee6d21781c83cceb9243853bcc054c08b4a0687879b94f522f34a6ea155f52a0f3
7
- data.tar.gz: 7560d515dce4e77d25b5fcd3931f812c0549026968937de9f445087b9a130e7b693dcd57df4cd8b2c959bb5f4d02b2fefae24b1f2fa607f1d1f865b46d638919
6
+ metadata.gz: b84730ab2ce3f46adf37bfd9702021a340b7bc41015d9a4e59290e68eb7402708bc2c962f5c5d6f585f0b2a948f675960134fc3a68c86687185477f3151e357f
7
+ data.tar.gz: e4d36ac384e938e1935fe0938bf1f14a75fea998d3cff0f11977861fab02c5a0c68acb3d685ac5fe8710f6f51c914127b1b3fa373e93bcee41d625a39aafe36e
data/README.md CHANGED
@@ -51,6 +51,10 @@ require minutes!).
51
51
 
52
52
  ## Changelog
53
53
 
54
+ ### 0.0.8
55
+
56
+ - Bug fix arrivals and departures initializers.
57
+
54
58
  ### 0.0.7
55
59
 
56
60
  - Add delay information to schedule arrivals and departures.
@@ -2,7 +2,7 @@ module StationMaster
2
2
  module Ask
3
3
  protected
4
4
  def ask!(request_url)
5
- url = URI.parse(request_url)
5
+ url = URI.parse(URI.escape(request_url))
6
6
  http = Net::HTTP.new(url.host, url.port)
7
7
  http.read_timeout = 2
8
8
 
@@ -26,7 +26,7 @@ module StationMaster
26
26
  nil
27
27
  end
28
28
 
29
- ask!(URI.escape(request_url)) if request_url
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
@@ -1,3 +1,3 @@
1
1
  module StationMaster
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  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.7
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 00:00:00.000000000 Z
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