OpenWeather 0.0.4 → 0.0.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 +4 -4
- data/lib/OpenWeather/forecast.rb +8 -0
- data/lib/OpenWeather/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51787be0700fa161b8400dd0f5a8bec000c56eb8
|
4
|
+
data.tar.gz: 766ed688b46c1941ca932681c31a8a618cbf068b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dd511792187d04e4a09171fc3eabd61849d022531119fe8a0b0995499883f3a8bbb82cc94f1e75ed174493caed3b1ca1a55bca027a9d5c8cdd409810eabf16c
|
7
|
+
data.tar.gz: 529905fed27aab98a72e36261f3b41a060137cf327938a94605e74d66c470368c8258caf8f07789d8badaaddcce4e4d2b2b4be00978330bd318f844b95da787b
|
data/lib/OpenWeather/forecast.rb
CHANGED
@@ -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
|
data/lib/OpenWeather/version.rb
CHANGED
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
|
+
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-
|
11
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|