myweatherforecast 0.5.5 → 1.0.2
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/myweatherforecast.rb +44 -5
- metadata +54 -31
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 11ea5e686749c95022011a476df5dca9249c52be154c1bc05cb0a3617b8ac788
|
4
|
+
data.tar.gz: e81794bc2bf5cd63883f1ed8ec88dffe27ec5f05bbff94d215e44b096a21cc4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4a67326665bb8bee5cf7c15800c037d9ff9f2b93889d42acf9ca9ddd5e53834f4fcbc95a640b044ca1655d344327e868a67a54324bc3890790528b6e4c88e6f
|
7
|
+
data.tar.gz: 2888f61cc51a0739838aef54b2e170912ca49bdb781b3f86bddf32ef826337a1ce2b873287c2b86e4e72a1b5b8600224f9360e89d6f0dd090e7303de3a1a1da9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/myweatherforecast.rb
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
require 'json'
|
6
6
|
require 'time'
|
7
7
|
require 'geocoder'
|
8
|
-
require 'forecast_io'
|
9
8
|
require 'open-uri'
|
10
|
-
|
9
|
+
require 'emoji2020'
|
10
|
+
require 'forecast_io'
|
11
11
|
|
12
12
|
|
13
13
|
# This gem is a wrapper of the forecast_io gem
|
@@ -90,11 +90,50 @@ class MyWeatherForecast
|
|
90
90
|
|
91
91
|
end
|
92
92
|
|
93
|
-
def
|
93
|
+
def ahead(advance=2)
|
94
|
+
|
95
|
+
current_hour = Time.at(@hourly_data[0]['time']).hour + advance
|
96
|
+
|
97
|
+
case current_hour
|
98
|
+
when 12..17
|
99
|
+
:afternoon
|
100
|
+
when 0..5
|
101
|
+
:early_hours
|
102
|
+
when 17..(night_time.hour+1)
|
103
|
+
:evening
|
104
|
+
when 6..12
|
105
|
+
:morning
|
106
|
+
when night_time.hour..23
|
107
|
+
:night
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
def afternoon() period(12, 17) end
|
94
113
|
def early_hours() period(0, 5) end
|
114
|
+
|
115
|
+
def emoji()
|
116
|
+
|
117
|
+
h = {
|
118
|
+
'clear-day' => :sun,
|
119
|
+
'clear-night' => :night_with_stars,
|
120
|
+
'rain' => :cloud_with_rain,
|
121
|
+
'snow' => :cloud_with_snow,
|
122
|
+
'sleet' => :cloud_with_rain,
|
123
|
+
'wind' => :leaf_fluttering_in_wind,
|
124
|
+
'fog' => :fog,
|
125
|
+
'cloudy' => :cloud,
|
126
|
+
'partly-cloudy-day' => :sun_behind_cloud,
|
127
|
+
'partly-cloudy-night' => :cloud
|
128
|
+
}
|
129
|
+
|
130
|
+
Emoji2020.new(h[icon()]).to_s
|
131
|
+
|
132
|
+
end
|
133
|
+
|
95
134
|
def evening() period(17, night_time.hour+1) end
|
96
135
|
def morning() period(6, 12) end
|
97
|
-
def night() period(night_time.hour, 23) end
|
136
|
+
def night() period(night_time.hour, 23) end
|
98
137
|
|
99
138
|
def night_time()
|
100
139
|
Time.at(@day.sunsetTime)
|
@@ -304,4 +343,4 @@ class MyWeatherForecast
|
|
304
343
|
Daily.new(@forecast, @tlabel, d)
|
305
344
|
end
|
306
345
|
|
307
|
-
end
|
346
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myweatherforecast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjAwNDI2MDkwMDEzWhcN
|
15
|
+
MjEwNDI2MDkwMDEzWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDy5Ev/
|
17
|
+
+TmmW2Zbqs3nwm1ZKztFwS4HKierISuHHK9LRVUoocJ1HAMt65t9K0FqLHcPw8Cq
|
18
|
+
A83Hh6pyOC38Q6xE0bACRz05jL/AKWQU+KF2o9gyph4+b/Y+S51627/nJPaaPl/i
|
19
|
+
/AAkCPX+XYZZx6Ts3c4bajWbBZQvduKz+Mgns0HHfZyU4OL9PhjQSpL4w+b53C7I
|
20
|
+
rROHOcskWOmKhqD04VLoB0k7IoKQ6iD6AJLGwcLPIEKcQ00F6kiA9lFYUt9Iw/YM
|
21
|
+
Ci1W6SO7b80+7nYLeKgYMF3xfZwUB7ZwrIv3oNYZqLmSnk2NlDlibYNOd8CEm51d
|
22
|
+
il/LCYqBjsx8hQxddQ7bqckkMHI2aWfnB8CH/l3r7vWvkKrlyWkA+yc5Hain86eu
|
23
|
+
qip4E40kzjT1dKNuayS8MWYqD0kGrvZd5J6mm0w1SVSCmk5HVR68WkpNT63IXS5Y
|
24
|
+
tqflllrFbf1onOkOw3GOrN+IKGVnBdxZEpgwnROXTnswdUJ7Q8POSiK2Qu8CAwEA
|
25
|
+
AaOBijCBhzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUcUjjw62h
|
26
|
+
LOtlQ5ITbp0+TWaMl9EwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
27
|
+
c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAUzolYndXxgA1eH/QTx1gbEK4ay7UW4/BUMZcenlM
|
29
|
+
Xx841MdN5yfy91NWeo/Qy0ruxCnNtCvXsVEx6P1TVLaZBxkU/i/H3TgNrOsqgRHz
|
30
|
+
8S428Xg3PTTYkMf27+sLMO8uXmEYeCjrbdEyUBiCtmPht776T2nepwOJNwqgb8x8
|
31
|
+
qSMtqEYZxY3x+4Dd9CNf2xQujQ26Q4qyZnzYIuZQb9aHMgAiww3rst8Kxc83pggI
|
32
|
+
It47yWd2GhjXd7fv/9MZ0Uhfov+ExsqSr9H0HDjf8KCL+Y9OzNAW7ixpQpXK0pQJ
|
33
|
+
i54CNZiaGNwJnBVp9USO7cA5jCKN1Iouaj/Vbie5XXhiGnOZ/cyfna/K/fX10/lh
|
34
|
+
JL0NiXQMvY3FTEjgq7BZxit1Q7dE07TH54CD/f5EMNm9v/f5BKVPDF+pfAUrZnKy
|
35
|
+
T8ZItjfCqcG6MNMdmPqplYAqpSJzVB9ucdkrz8Ia5Lf1waJw6Dd0m1zHWYSofIH8
|
36
|
+
HuG3HnRIMQNQE2s1PFtxmX2w
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2020-06-16 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: forecast_io
|
@@ -42,7 +46,7 @@ dependencies:
|
|
42
46
|
version: '2.0'
|
43
47
|
- - ">="
|
44
48
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.0.
|
49
|
+
version: 2.0.2
|
46
50
|
type: :runtime
|
47
51
|
prerelease: false
|
48
52
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,29 +56,49 @@ dependencies:
|
|
52
56
|
version: '2.0'
|
53
57
|
- - ">="
|
54
58
|
- !ruby/object:Gem::Version
|
55
|
-
version: 2.0.
|
59
|
+
version: 2.0.2
|
56
60
|
- !ruby/object:Gem::Dependency
|
57
61
|
name: geocoder
|
58
62
|
requirement: !ruby/object:Gem::Requirement
|
59
63
|
requirements:
|
60
64
|
- - "~>"
|
61
65
|
- !ruby/object:Gem::Version
|
62
|
-
version: '1.
|
66
|
+
version: '1.6'
|
63
67
|
- - ">="
|
64
68
|
- !ruby/object:Gem::Version
|
65
|
-
version: 1.2
|
69
|
+
version: 1.6.2
|
66
70
|
type: :runtime
|
67
71
|
prerelease: false
|
68
72
|
version_requirements: !ruby/object:Gem::Requirement
|
69
73
|
requirements:
|
70
74
|
- - "~>"
|
71
75
|
- !ruby/object:Gem::Version
|
72
|
-
version: '1.
|
76
|
+
version: '1.6'
|
73
77
|
- - ">="
|
74
78
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.2
|
79
|
+
version: 1.6.2
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: emoji2020
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 0.2.0
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.2'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.2.0
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0.2'
|
76
100
|
description:
|
77
|
-
email: james@
|
101
|
+
email: james@jamesrobertson.eu
|
78
102
|
executables: []
|
79
103
|
extensions: []
|
80
104
|
extra_rdoc_files: []
|
@@ -99,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
123
|
- !ruby/object:Gem::Version
|
100
124
|
version: '0'
|
101
125
|
requirements: []
|
102
|
-
|
103
|
-
rubygems_version: 2.4.8
|
126
|
+
rubygems_version: 3.0.3
|
104
127
|
signing_key:
|
105
128
|
specification_version: 4
|
106
129
|
summary: This gem is a wrapper of the forecast_io gem.
|
metadata.gz.sig
CHANGED
Binary file
|