darksky 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.0.2
4
+
5
+ * Removed default to disable SSL peer verification now that the DarkSky API server has a signed certificate.
6
+
3
7
  ## 1.0.1
4
8
 
5
- * Added `options` hash to API endpoints as final parameter
6
- * Default options for API endpoints disable SSL peer verification while DarkSky API is in beta and still uses a self-signed certificate
7
- * Fixed response parsing for `precipitation` API endpoint
9
+ * Added `options` hash to API endpoints as final parameter.
10
+ * Default options for API endpoints disable SSL peer verification while DarkSky API is in beta and still uses a self-signed certificate.
11
+ * Fixed response parsing for `precipitation` API endpoint.
8
12
 
9
13
  ## 1.0.0
10
14
 
11
- * Initial release
15
+ * Initial release.
@@ -20,7 +20,7 @@ darksky = Darksky::API.new('d41d8cd98f00b204e9800998ecf8427e')
20
20
  forecast = darksky.forecast('42.7243','-73.6927')
21
21
  precipitation = darksky.precipitation(['42.7','-73.6',1325607100,'42.0','-73.0',1325607791])
22
22
  ```
23
-
23
+
24
24
  ## Contributing to darksky
25
25
 
26
26
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
@@ -5,7 +5,6 @@ module Darksky
5
5
  class API
6
6
  DARKSKY_API_URL = 'https://api.darkskyapp.com/v1'
7
7
  DEFAULT_OPTIONS = {
8
- :disable_ssl_peer_verification => true
9
8
  }
10
9
 
11
10
  # Create a new instance of the Darksky::API using your API key.
@@ -19,6 +18,7 @@ module Darksky
19
18
  #
20
19
  # @param latitude [String] Latitude in decimal degrees.
21
20
  # @param longitude [String] Longitude in decimal degrees.
21
+ # @param option [Hash] (Optional) Options to be passed to the Typhoeus::Request
22
22
  def forecast(latitude, longitude, options = {})
23
23
  response = Typhoeus::Request.get("#{DARKSKY_API_URL}/forecast/#{@api_key}/#{latitude},#{longitude}", DEFAULT_OPTIONS.dup.merge(options))
24
24
  JSON.parse(response.body) if response.code == 200
@@ -27,6 +27,7 @@ module Darksky
27
27
  # Returns forecasts for a collection of arbitrary points.
28
28
  #
29
29
  # @param latitudes_longitudes_times [Array] Triplets of latitude, longitude and time. Example: ['42.7','-73.6',1325607100,'42.0','-73.0',1325607791]
30
+ # @param option [Hash] (Optional) Options to be passed to the Typhoeus::Request
30
31
  def precipitation(latitudes_longitudes_times, options = {})
31
32
  return if latitudes_longitudes_times.size % 3 != 0
32
33
  response = Typhoeus::Request.get("#{DARKSKY_API_URL}/precipitation/#{@api_key}/#{latitudes_longitudes_times.join(',')}", DEFAULT_OPTIONS.dup.merge(options))
@@ -1,3 +1,3 @@
1
1
  module Darksky
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Darksky::VERSION do
4
+ it 'should be the correct version' do
5
+ Darksky::VERSION.should == '1.0.2'
6
+ end
7
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darksky
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-08 00:00:00.000000000 Z
12
+ date: 2012-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: typhoeus
16
- requirement: &2161902360 !ruby/object:Gem::Requirement
16
+ requirement: &70155687633380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2161902360
24
+ version_requirements: *70155687633380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &2161901940 !ruby/object:Gem::Requirement
27
+ requirement: &70155687632960 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2161901940
35
+ version_requirements: *70155687632960
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &2161901520 !ruby/object:Gem::Requirement
38
+ requirement: &70155687632540 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2161901520
46
+ version_requirements: *70155687632540
47
47
  description: Ruby gem for retrieving data from the Dark Sky API
48
48
  email:
49
49
  - me@davidczarnecki
@@ -63,6 +63,7 @@ files:
63
63
  - lib/darksky/api.rb
64
64
  - lib/darksky/version.rb
65
65
  - spec/darksky/api_spec.rb
66
+ - spec/darksky/version_spec.rb
66
67
  - spec/spec_helper.rb
67
68
  homepage: https://github.com/czarneckid/darksky
68
69
  licenses: []
@@ -78,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
79
  version: '0'
79
80
  segments:
80
81
  - 0
81
- hash: -1193096420889366995
82
+ hash: 1879961532628065117
82
83
  required_rubygems_version: !ruby/object:Gem::Requirement
83
84
  none: false
84
85
  requirements:
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  version: '0'
88
89
  segments:
89
90
  - 0
90
- hash: -1193096420889366995
91
+ hash: 1879961532628065117
91
92
  requirements: []
92
93
  rubyforge_project: darksky
93
94
  rubygems_version: 1.8.10
@@ -96,4 +97,5 @@ specification_version: 3
96
97
  summary: Ruby gem for retrieving data from the Dark Sky API
97
98
  test_files:
98
99
  - spec/darksky/api_spec.rb
100
+ - spec/darksky/version_spec.rb
99
101
  - spec/spec_helper.rb