OpenWeather 0.0.4 → 0.0.5

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: 6796e9997908381add1de5e95e9675c8db7a63a7
4
- data.tar.gz: fb6fd09bcc69181a6b4ac87bca761c4ac97fc806
3
+ metadata.gz: 51787be0700fa161b8400dd0f5a8bec000c56eb8
4
+ data.tar.gz: 766ed688b46c1941ca932681c31a8a618cbf068b
5
5
  SHA512:
6
- metadata.gz: 1c70b571f6abcba911ad33de6d9241caabb7ba2e76996b197cbcba09f54eb694c31482e194196e95dee6e31b95e129fc8d9522915d6e255997273ba496c49d5e
7
- data.tar.gz: 4881ff046297ba7f8758535b33ad15f85ea7422a429b00d5508d4bf50fa92a51e758186e6b49cdb21851bbc0f9f950eea9a8142568265c9e55b76bbba5fb5f1b
6
+ metadata.gz: 8dd511792187d04e4a09171fc3eabd61849d022531119fe8a0b0995499883f3a8bbb82cc94f1e75ed174493caed3b1ca1a55bca027a9d5c8cdd409810eabf16c
7
+ data.tar.gz: 529905fed27aab98a72e36261f3b41a060137cf327938a94605e74d66c470368c8258caf8f07789d8badaaddcce4e4d2b2b4be00978330bd318f844b95da787b
@@ -29,5 +29,13 @@ module OpenWeather
29
29
  ! tomorrow_list.select { |code| Integer(code['weather'][0]['id']).between?(500, 599) }.empty?
30
30
  end
31
31
 
32
+ def forecast_tomorrow_sunny?(city)
33
+ forecast = forecast_raw(city)
34
+ tomorrow_list = forecast['list'].select { |weather| weather['dt_txt'].split(" ")[0] == tomorrow }
35
+ # This selects any period of time during the day where the condition code is between 500 and 599 which
36
+ # corresponds to rainy condition. If the array is empty that means it won't rain so we return the opposite.
37
+ ! tomorrow_list.select { |code| Integer(code['weather'][0]['id']).between?(800, 801) }.empty?
38
+ end
39
+
32
40
  end
33
41
  end
@@ -1,3 +1,3 @@
1
1
  module OpenWeather
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: OpenWeather
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris911
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-16 00:00:00.000000000 Z
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler