darksky-api 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6d016e9642f5018a07312d3caa96e4d49f43a63a8de2415b9a5aa2128cbf9f2
4
- data.tar.gz: d68c72019164491f10fc8a708e57c6700003a59eabedeb1d51eae01ca66b82ca
3
+ metadata.gz: 47bedf01bb151ab47ab4edb99123d8afb0d04b3d20a95da2ff41dbb64a9b12bc
4
+ data.tar.gz: f96f67e5757e25a3097a2d5ec7ea822ac378ac98fa32d35e473f86e992c29b16
5
5
  SHA512:
6
- metadata.gz: 8461aaf0495eb088df3c6af3b5ef36bb9052cd7218a64045dcc741f7d4f8eb432bf943efeb5d1384fbeebfdfd366e32ac1338720f06907bd4986ccefefdb83a1
7
- data.tar.gz: bf40943663be48d5bd9af37ac90d11cbcf0e99c60e72d53cb996c1f1b90b72e1635551ea961c4c972b553033c156a3f43b9f4cac39e781079ab6e1d51f952fb1
6
+ metadata.gz: 07565c56edc103de2e6509d111570d6e59d392f4e31d7b57450294b70f315d59e84bb81a948968583227d466e21023c763a9f19035e2e530bab93a5ebe5587d2
7
+ data.tar.gz: 37590cb2c6596df3f3aedb78b9af7bbdbf498c1905beea639b9e8d31a21c3f0d6ec5770d7b6d9a34d4a82df47d21e7694e645f8cbda6810e957a5fed8a5d4779
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- darksky-api (0.1.4)
4
+ darksky-api (0.1.5)
5
5
  json (~> 2.1)
6
6
  rest-client (~> 2.0)
7
7
 
@@ -6,6 +6,6 @@ require 'darksky-api/current'
6
6
  require 'darksky-api/day'
7
7
 
8
8
  # @author Jacob Pratt <the.z.cuber@gmail.com>
9
- # @version 0.1.3
9
+ # @version 0.1.5
10
10
  module DarkSky
11
11
  end
@@ -175,7 +175,7 @@ module DarkSky
175
175
  # @example
176
176
  # location = DarkSky::Location.new [45, -90]
177
177
  # location.current.clear?
178
- # @since 0.1.0
178
+ # @since 0.1.4
179
179
  # @return [Boolean] if icon is 'clear' variant
180
180
  def clear?
181
181
  %w[clear-day clear-night].include? icon
@@ -184,7 +184,7 @@ module DarkSky
184
184
  # @example
185
185
  # location = DarkSky::Location.new [45, -90]
186
186
  # location.current.rainy?
187
- # @since 0.1.0
187
+ # @since 0.1.4
188
188
  # @return [Boolean] if icon is 'rain'
189
189
  def rainy?
190
190
  icon == 'rain'
@@ -193,7 +193,7 @@ module DarkSky
193
193
  # @example
194
194
  # location = DarkSky::Location.new [45, -90]
195
195
  # location.current.snowy?
196
- # @since 0.1.0
196
+ # @since 0.1.4
197
197
  # @return [Boolean] if icon is 'snow'
198
198
  def snowy?
199
199
  icon == 'snow'
@@ -202,7 +202,7 @@ module DarkSky
202
202
  # @example
203
203
  # location = DarkSky::Location.new [45, -90]
204
204
  # location.current.sleet?
205
- # @since 0.1.0
205
+ # @since 0.1.4
206
206
  # @return [Boolean] if icon is 'sleet'
207
207
  def sleet?
208
208
  icon == 'sleet'
@@ -211,7 +211,7 @@ module DarkSky
211
211
  # @example
212
212
  # location = DarkSky::Location.new [45, -90]
213
213
  # location.current.windy?
214
- # @since 0.1.0
214
+ # @since 0.1.4
215
215
  # @return [Boolean] if icon is 'wind'
216
216
  def windy?
217
217
  icon == 'wind'
@@ -220,7 +220,7 @@ module DarkSky
220
220
  # @example
221
221
  # location = DarkSky::Location.new [45, -90]
222
222
  # location.current.foggy?
223
- # @since 0.1.0
223
+ # @since 0.1.4
224
224
  # @return [Boolean] if icon is 'fog'
225
225
  def foggy?
226
226
  icon == 'fog'
@@ -229,7 +229,7 @@ module DarkSky
229
229
  # @example
230
230
  # location = DarkSky::Location.new [45, -90]
231
231
  # location.current.cloudy?
232
- # @since 0.1.0
232
+ # @since 0.1.4
233
233
  # @return [Boolean] if icon is 'cloudy' or variant
234
234
  def cloudy?
235
235
  %w[cloudy partly-cloudy-day partly-cloudy-night].include? icon
@@ -249,11 +249,12 @@ module DarkSky
249
249
  elsif intensity >= 0.017
250
250
  'light'
251
251
  elsif intensity >= 0.002
252
- 'sporadic'
252
+ 'spotty'
253
253
  end
254
254
  end
255
255
 
256
256
  def _bearing_text(degree)
257
+ return nil if degree.nil?
257
258
  directions = %w[N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW]
258
259
  directions[degree / 22.5 + 0.5]
259
260
  end
@@ -276,6 +276,7 @@ module DarkSky
276
276
  Day.new self, 1
277
277
  end
278
278
  alias in_1_day tomorrow
279
+ alias in_1_days tomorrow
279
280
 
280
281
  # @example
281
282
  # location = DarkSky::Location.new [45, -90]
@@ -83,8 +83,10 @@ module DarkSky
83
83
  def full_data
84
84
  if (Time.now - @cache_time).to_i >= @cache_duration
85
85
  response = RestClient.get "https://api.darksky.net/forecast/#{DarkSky.key}/#{@location.join ','}",
86
- units: @units,
87
- language: @language
86
+ params: {
87
+ units: @units,
88
+ lang: @language
89
+ }
88
90
  @data = JSON.parse response.body, symbolize_names: true
89
91
  @cache_time = Time.now
90
92
  end
@@ -1,4 +1,4 @@
1
1
  module DarkSky
2
2
  # version of this library (follows SemVer for versions >= 1.0.0)
3
- VERSION = '0.1.4'.freeze
3
+ VERSION = '0.1.5'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darksky-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Pratt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-02 00:00:00.000000000 Z
11
+ date: 2018-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json