forecast_io 2.0.1 → 2.0.2

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: 0bd639a3593f4d407dd9833b18c797250c05989b
4
- data.tar.gz: e81f3541c4dad1d8598311144a22473636e614ff
3
+ metadata.gz: dbf16534391d01b99b0ccb0b08b0f14ee5a2134e
4
+ data.tar.gz: 08d25494e668eaf5c488c95d184ed722bb84c908
5
5
  SHA512:
6
- metadata.gz: 36dcad0f6fc8db2fea47b5cf7181238d03be6d38e2a530e7ba93402e3cfcb111549abb638431a635b282a0ed98a7716e55938a31ec807eabbebdd3e6a942857f
7
- data.tar.gz: a11101784cbea1796df0e11791b6022f0f5b7cbbe29cc9007b5d5fdb82b7ffc6430534b91d3dac309c6f78faa3830dff6a8b78dc4fc09dbbf34c97b74419b893
6
+ metadata.gz: 8dfd87923210e474b6f13c4ed504451cde3f4439b443bd2fadb871de378096d4b78dd81021d0c5189629e624e04586e175162426e6b65d4265e9c47ed1bf2f00
7
+ data.tar.gz: 472799f5e857b70fbe91400a33cf03b8178df66b118caeeb3f6c2633c10b9814ff1fba2966409589896cd4db8c64ebf3cda1aa0774ee86734741628c495d8f4c
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.0.2 (2018-01-30)
4
+
5
+ * Add optional request read timeout to Faraday [Fixes #10](https://github.com/darkskyapp/forecast-ruby/issues/10)
6
+
3
7
  ## 2.0.1 (2016-09-20)
4
8
 
5
9
  * forecast.io to darksky.net api [#9](https://github.com/darkskyapp/forecast-ruby/pull/9)
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2014 David Czarnecki
1
+ Copyright (c) 2013-2018 David Czarnecki
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # forecast_io
2
2
 
3
- [forecast.io](https://developer.darkskyapp.com/docs/v2) API wrapper in Ruby.
3
+ [forecast.io](https://darksky.net/dev/docs) API wrapper in Ruby.
4
4
 
5
5
  ## Installation
6
6
 
@@ -120,4 +120,4 @@ end
120
120
 
121
121
  ## Copyright
122
122
 
123
- Copyright (c) 2013-2014 David Czarnecki. See LICENSE.txt for further details.
123
+ Copyright (c) 2013-2018 David Czarnecki. See LICENSE.txt for further details.
@@ -29,7 +29,7 @@ module ForecastIO
29
29
 
30
30
  # Build or get an HTTP connection object.
31
31
  def connection
32
- @connection ||= Faraday.new
32
+ @connection ||= Faraday.new(request: { timeout: ForecastIO.timeout })
33
33
  end
34
34
 
35
35
  # Set an HTTP connection object.
@@ -9,6 +9,9 @@ module ForecastIO
9
9
  # API key
10
10
  attr_writer :api_key
11
11
 
12
+ # Request read timeout
13
+ attr_writer :timeout
14
+
12
15
  # Default parameters
13
16
  attr_accessor :default_params
14
17
 
@@ -18,6 +21,7 @@ module ForecastIO
18
21
  #
19
22
  # ForecastIO.configure do |configuration|
20
23
  # configuration.api_key = 'this-is-your-api-key'
24
+ # configuration.timeout = 500
21
25
  # end
22
26
  def configure
23
27
  yield self
@@ -32,5 +36,10 @@ module ForecastIO
32
36
  def api_key
33
37
  @api_key
34
38
  end
39
+
40
+ # Request read timeout
41
+ def timeout
42
+ @timeout
43
+ end
35
44
  end
36
45
  end
@@ -1,3 +1,3 @@
1
1
  module ForecastIO
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
@@ -6,6 +6,7 @@ describe ForecastIO::Configuration do
6
6
  ForecastIO.configure do |configuration|
7
7
  expect(configuration.api_endpoint).to eq(ForecastIO::Configuration::DEFAULT_FORECAST_IO_API_ENDPOINT)
8
8
  expect(configuration.api_key).to be_nil
9
+ expect(configuration.timeout).to be_nil
9
10
  end
10
11
  end
11
12
  end
@@ -2,6 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe 'ForecastIO::VERSION' do
4
4
  it 'should be the correct version' do
5
- expect(ForecastIO::VERSION).to eq('2.0.1')
5
+ expect(ForecastIO::VERSION).to eq('2.0.2')
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forecast_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Czarnecki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2018-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday