myweatherforecast 0.5.6 → 1.0.3
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 +4 -2
- data/lib/myweatherforecast.rb +31 -8
- metadata +54 -30
- 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: 2ef0cadbcace160e5acbe9231c400eba8205e2e7bc381b0b614525a9cc67d14e
|
4
|
+
data.tar.gz: 8959466307216d99e3a095a3a3f9f6753a66c5342a7e2ade463e4e69bf243ef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d94beea6d1fd97c0b6ca85dffe1df1b73c6dbf731f86ddee46b5cf95a1f88f2a01ac35db801de66759db682366daf16488a0c486a97a9621b5758790ab84daf
|
7
|
+
data.tar.gz: 693c873c7b93699881c3110250482af95c36c78cd0e0927c04d7a68b1fda43b3585c54c73c01deefc6fe8dcbdf6045de843781ca43429244fc7c9c4ae8187ac5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
��6tz�]���Z��/���=\�W�1r�@��|P�iI�zl�S5��"Z�1 O�\�!+������g��N������d��8s^�n��,�؊�`
|
2
|
+
F!��E�$�M��ۀ؏dz���@�п���8�:K���u�uI{��gI\ ��|�I�G���^�<�Fi/�����Y��˂��&�!��iu�3
|
3
|
+
���h�u0�>�H#���5����aR��Ʒ��b�u�>���,���֨;c�;�I�T̻�S�8��糤��o��;�������}|H��,��v���]Q���ՄQ���<o~[��6���ȼ��zy��Dž�a�M�́���|g�6��;�kV+=�{�i
|
4
|
+
7n,,��zХ7U�Ep��
|
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,9 +90,9 @@ class MyWeatherForecast
|
|
90
90
|
|
91
91
|
end
|
92
92
|
|
93
|
-
def ahead()
|
93
|
+
def ahead(advance=2)
|
94
94
|
|
95
|
-
current_hour = Time.at(@hourly_data[0]['time']).hour
|
95
|
+
current_hour = Time.at(@hourly_data[0]['time']).hour + advance
|
96
96
|
|
97
97
|
case current_hour
|
98
98
|
when 12..17
|
@@ -111,6 +111,26 @@ class MyWeatherForecast
|
|
111
111
|
|
112
112
|
def afternoon() period(12, 17) end
|
113
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
|
+
|
114
134
|
def evening() period(17, night_time.hour+1) end
|
115
135
|
def morning() period(6, 12) end
|
116
136
|
def night() period(night_time.hour, 23) end
|
@@ -222,13 +242,16 @@ class MyWeatherForecast
|
|
222
242
|
|
223
243
|
end
|
224
244
|
|
245
|
+
def day()
|
246
|
+
Date::ABBR_DAYNAMES[self.time.wday]
|
247
|
+
end
|
248
|
+
|
225
249
|
def to_s
|
226
250
|
|
227
|
-
label = self.time.to_date == Time.now.to_date ? 'Today' :
|
228
|
-
Date::ABBR_DAYNAMES[self.time.wday]
|
229
|
-
|
251
|
+
label = self.time.to_date == Time.now.to_date ? 'Today' : day()
|
230
252
|
mask = @symbols ? "%s: ▽%s ▲%s, %s" : "%s: %s %s, %s"
|
231
253
|
mask % [label, tempmin, tempmax, @x.summary]
|
254
|
+
|
232
255
|
end
|
233
256
|
|
234
257
|
def sunrise()
|
@@ -323,4 +346,4 @@ class MyWeatherForecast
|
|
323
346
|
Daily.new(@forecast, @tlabel, d)
|
324
347
|
end
|
325
348
|
|
326
|
-
end
|
349
|
+
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.3
|
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
|
+
cnRzb24vREM9Z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2nepwOJNwqgb8x8
|
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-28 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: []
|
@@ -100,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
124
|
version: '0'
|
101
125
|
requirements: []
|
102
126
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.7.10
|
104
128
|
signing_key:
|
105
129
|
specification_version: 4
|
106
130
|
summary: This gem is a wrapper of the forecast_io gem.
|
metadata.gz.sig
CHANGED
Binary file
|