lita-onewheel-forecast-io 0.0.0 → 0.0.1
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/.gitignore +1 -0
- data/.travis.yml +1 -3
- data/README.md +1 -1
- data/lib/lita/handlers/constants.rb +8 -0
- data/lib/lita/handlers/forecasts.rb +61 -22
- data/lib/lita/handlers/irc_handlers.rb +22 -5
- data/lib/lita/handlers/onewheel_forecast_io.rb +9 -2
- data/lib/lita/handlers/utils.rb +1 -1
- data/lita-onewheel-forecast-io.gemspec +4 -4
- data/spec/lita/handlers/forecast_io_spec.rb +26 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a1c34227a6fba45ea412b5129bcca4e12c7c090
|
4
|
+
data.tar.gz: d6e8c875355d3745874ddaa8a10e8354039e363c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61516507de3ce242843086104524b69e38885b7e2f482e02da40a6a9c02a92021c0c00ed5ec62bc6e6cd4b20305752d9486a7d8ecc50080c669b9bc1c5a5af74
|
7
|
+
data.tar.gz: fa6b2118a9c058a0cc3e6d164ddaf098661b1b76fa700f75a728659116441f176de1d80132cdb3a438ff1386754fd3b28f9b1fc79504463d0dc6722aeb837a19
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,7 @@ This Lita handler takes location-based queries and returns interesting data abou
|
|
11
11
|
Add lita-onewheel-forecast-io to your Lita instance's Gemfile, from github since it's currently unpublished:
|
12
12
|
|
13
13
|
``` ruby
|
14
|
-
gem 'lita-onewheel-forecast-io',
|
14
|
+
gem 'lita-onewheel-forecast-io', '~> 0.0'
|
15
15
|
```
|
16
16
|
|
17
17
|
## Configuration
|
@@ -119,6 +119,14 @@ module ForecastIo
|
|
119
119
|
}
|
120
120
|
end
|
121
121
|
|
122
|
+
# Just a shorthand function to return the configured snowflake.
|
123
|
+
def get_snowman(config)
|
124
|
+
# '⛄' # Fancy emoji snowman
|
125
|
+
# '❄️' # Fancy snowflake
|
126
|
+
# '❄' # Regular snowflake
|
127
|
+
config.snowflake
|
128
|
+
end
|
129
|
+
|
122
130
|
# I have no use for these yet, and yet they're handy to know.
|
123
131
|
# def attributes
|
124
132
|
# { :bold => 2.chr,
|
@@ -1,32 +1,44 @@
|
|
1
1
|
module ForecastIo
|
2
2
|
module Forecasts
|
3
3
|
def ascii_rain_forecast(forecast)
|
4
|
-
str = do_the_rain_chance_thing(forecast, ascii_chars, 'precipProbability')
|
5
|
-
|
4
|
+
(str, precip_type) = do_the_rain_chance_thing(forecast, ascii_chars, 'precipProbability')
|
5
|
+
max = get_max_by_data_key(forecast, 'minutely', 'precipProbability')
|
6
|
+
"1hr #{precip_type} probability #{(Time.now).strftime('%H:%M').to_s}|#{str}|#{(Time.now + 3600).strftime('%H:%M').to_s} max #{max * 100}%"
|
6
7
|
end
|
7
8
|
|
8
9
|
def ansi_rain_forecast(forecast)
|
9
|
-
str = do_the_rain_chance_thing(forecast, ansi_chars, 'precipProbability') #, 'probability', get_rain_range_colors)
|
10
|
-
|
11
|
-
"
|
10
|
+
(str, precip_type) = do_the_rain_chance_thing(forecast, ansi_chars, 'precipProbability') #, 'probability', get_rain_range_colors)
|
11
|
+
max = get_max_by_data_key(forecast, 'minutely', 'precipProbability')
|
12
|
+
"1hr #{precip_type} probability #{(Time.now).strftime('%H:%M').to_s}|#{str}|#{(Time.now + 3600).strftime('%H:%M').to_s} max #{max.to_f * 100}%"
|
12
13
|
end
|
13
14
|
|
14
15
|
def ansi_rain_intensity_forecast(forecast)
|
15
|
-
str = do_the_rain_intensity_thing(forecast, ansi_chars, 'precipIntensity') #, 'probability', get_rain_range_colors)
|
16
|
-
|
16
|
+
(str, precip_type) = do_the_rain_intensity_thing(forecast, ansi_chars, 'precipIntensity') #, 'probability', get_rain_range_colors)
|
17
|
+
max_str = get_max_by_data_key(forecast, 'minutely', 'precipIntensity')
|
18
|
+
"1hr #{precip_type} intensity #{(Time.now).strftime('%H:%M').to_s}|#{str}|#{(Time.now + 3600).strftime('%H:%M').to_s} #{max_str}"
|
17
19
|
end
|
18
20
|
|
19
21
|
def ansi_humidity_forecast(forecast)
|
20
22
|
do_the_humidity_thing(forecast, ansi_chars, 'humidity') #, 'probability', get_rain_range_colors)
|
21
23
|
end
|
22
24
|
|
23
|
-
def
|
25
|
+
def get_max_by_data_key(forecast, key, datum)
|
24
26
|
unless forecast[key].nil?
|
25
27
|
data_points = []
|
26
28
|
forecast[key]['data'].each do |data_point|
|
27
|
-
data_points.push data_point[
|
29
|
+
data_points.push data_point[datum]
|
28
30
|
end
|
29
|
-
|
31
|
+
data_points.max
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def get_min_by_data_key(forecast, key, datum)
|
36
|
+
unless forecast[key].nil?
|
37
|
+
data_points = []
|
38
|
+
forecast[key]['data'].each do |data_point|
|
39
|
+
data_points.push data_point[datum]
|
40
|
+
end
|
41
|
+
data_points.min
|
30
42
|
end
|
31
43
|
end
|
32
44
|
|
@@ -55,7 +67,7 @@ module ForecastIo
|
|
55
67
|
if i_can_has_snow
|
56
68
|
data.each_with_index do |datum, index|
|
57
69
|
if datum['precipType'] == 'snow'
|
58
|
-
str[index] =
|
70
|
+
str[index] = get_snowman config
|
59
71
|
end
|
60
72
|
end
|
61
73
|
end
|
@@ -64,7 +76,9 @@ module ForecastIo
|
|
64
76
|
str = get_colored_string(data, key, str, get_rain_range_colors)
|
65
77
|
end
|
66
78
|
|
67
|
-
|
79
|
+
precip_type = i_can_has_snow ? 'snow' : 'rain'
|
80
|
+
|
81
|
+
return str, precip_type
|
68
82
|
end
|
69
83
|
|
70
84
|
def do_the_rain_intensity_thing(forecast, chars, key) #, type, range_colors = nil)
|
@@ -72,11 +86,15 @@ module ForecastIo
|
|
72
86
|
return 'No minute-by-minute data available.' # The "Middle of Nowhere" case.
|
73
87
|
end
|
74
88
|
|
89
|
+
i_can_has_snow = false
|
75
90
|
data_points = []
|
76
91
|
data = forecast['minutely']['data']
|
77
92
|
|
78
93
|
data.each do |datum|
|
79
94
|
data_points.push datum[key]
|
95
|
+
if datum['precipType'] == 'snow'
|
96
|
+
i_can_has_snow = true
|
97
|
+
end
|
80
98
|
end
|
81
99
|
|
82
100
|
# Fixed range graph- 0-0.11.
|
@@ -85,7 +103,10 @@ module ForecastIo
|
|
85
103
|
if config.colors
|
86
104
|
str = get_colored_string(data, key, str, get_rain_intensity_range_colors)
|
87
105
|
end
|
88
|
-
|
106
|
+
|
107
|
+
precip_type = i_can_has_snow ? 'snow' : 'rain'
|
108
|
+
|
109
|
+
return str, precip_type
|
89
110
|
end
|
90
111
|
|
91
112
|
def do_the_humidity_thing(forecast, chars, key) #, type, range_colors = nil)
|
@@ -166,7 +187,7 @@ module ForecastIo
|
|
166
187
|
return str, data_points
|
167
188
|
end
|
168
189
|
|
169
|
-
def do_the_sun_thing(forecast)
|
190
|
+
def do_the_sun_thing(forecast, chars)
|
170
191
|
key = 'cloudCover'
|
171
192
|
data_points = []
|
172
193
|
data = forecast['daily']['data']
|
@@ -178,22 +199,30 @@ module ForecastIo
|
|
178
199
|
|
179
200
|
differential = data_points.max - data_points.min
|
180
201
|
|
181
|
-
str = get_dot_str(
|
202
|
+
str = get_dot_str(chars, data, data_points.min, differential, key)
|
182
203
|
|
183
204
|
if config.colors
|
184
205
|
str = get_colored_string(data, key, str, get_sun_range_colors)
|
185
206
|
end
|
186
207
|
|
187
|
-
|
208
|
+
max = 1 - get_min_by_data_key(forecast, 'hourly', key)
|
209
|
+
|
210
|
+
"8 day sun forecast |#{str}| max #{(max * 100).to_i}%"
|
188
211
|
end
|
189
212
|
|
190
|
-
def do_the_cloud_thing(forecast)
|
213
|
+
def do_the_cloud_thing(forecast, chars)
|
191
214
|
# O ◎ ]
|
192
215
|
data = forecast['hourly']['data'].slice(0,23)
|
193
216
|
|
194
|
-
|
217
|
+
max = 0
|
218
|
+
data.each do |datum|
|
219
|
+
if datum['cloudCover'] > max
|
220
|
+
max = datum['cloudCover']
|
221
|
+
end
|
222
|
+
end
|
223
|
+
str = get_dot_str(chars, data, 0, 1, 'cloudCover')
|
195
224
|
|
196
|
-
"24h cloud cover |#{str}|"
|
225
|
+
"24h cloud cover |#{str}| max #{max * 100}%"
|
197
226
|
end
|
198
227
|
|
199
228
|
def do_the_sunrise_thing(forecast)
|
@@ -261,7 +290,9 @@ module ForecastIo
|
|
261
290
|
str = get_colored_string(data, 'precipProbability', str, get_rain_range_colors)
|
262
291
|
end
|
263
292
|
|
264
|
-
|
293
|
+
max = get_max_by_data_key(forecast, 'daily', 'precipProbability')
|
294
|
+
|
295
|
+
"7day #{precip_type}s |#{str}| max #{max * 100}%"
|
265
296
|
end
|
266
297
|
|
267
298
|
def do_the_daily_rain_thing(forecast)
|
@@ -278,13 +309,21 @@ module ForecastIo
|
|
278
309
|
|
279
310
|
str = get_dot_str(ansi_chars, data, 0, 1, 'precipProbability')
|
280
311
|
|
312
|
+
if 'snow' == precip_type
|
313
|
+
data.each_with_index do |datum, index|
|
314
|
+
if datum['precipType'] == 'snow'
|
315
|
+
str[index] = get_snowman config
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
281
320
|
if config.colors
|
282
321
|
str = get_colored_string(data, 'precipProbability', str, get_rain_range_colors)
|
283
322
|
end
|
284
323
|
|
285
|
-
|
324
|
+
max = get_max_by_data_key(forecast, 'hourly', 'precipProbability')
|
286
325
|
|
287
|
-
"48 hr #{precip_type}s |#{str}| #{
|
326
|
+
"48 hr #{precip_type}s |#{str}| max #{max.to_f * 100}%"
|
288
327
|
end
|
289
328
|
|
290
329
|
def do_the_daily_wind_thing(forecast)
|
@@ -27,8 +27,8 @@ module ForecastIo
|
|
27
27
|
response.reply location.location_name + ' ' + ansi_rain_intensity_forecast(forecast)
|
28
28
|
response.reply location.location_name + ' ' + ansi_temp_forecast(forecast)
|
29
29
|
response.reply location.location_name + ' ' + ansi_wind_direction_forecast(forecast)
|
30
|
-
response.reply location.location_name + ' ' + do_the_sun_thing(forecast)
|
31
|
-
response.reply location.location_name + ' ' + do_the_cloud_thing(forecast)
|
30
|
+
response.reply location.location_name + ' ' + do_the_sun_thing(forecast, ansi_chars)
|
31
|
+
response.reply location.location_name + ' ' + do_the_cloud_thing(forecast, ansi_chars)
|
32
32
|
response.reply location.location_name + ' ' + do_the_daily_rain_thing(forecast)
|
33
33
|
end
|
34
34
|
|
@@ -84,13 +84,25 @@ module ForecastIo
|
|
84
84
|
def handle_irc_ansisun(response)
|
85
85
|
location = geo_lookup(response.user, response.match_data[1])
|
86
86
|
forecast = get_forecast_io_results(response.user, location)
|
87
|
-
response.reply location.location_name + ' ' + do_the_sun_thing(forecast)
|
87
|
+
response.reply location.location_name + ' ' + do_the_sun_thing(forecast, ansi_chars)
|
88
|
+
end
|
89
|
+
|
90
|
+
def handle_irc_asciisun(response)
|
91
|
+
location = geo_lookup(response.user, response.match_data[1])
|
92
|
+
forecast = get_forecast_io_results(response.user, location)
|
93
|
+
response.reply location.location_name + ' ' + do_the_sun_thing(forecast, ascii_chars)
|
88
94
|
end
|
89
95
|
|
90
96
|
def handle_irc_ansicloud(response)
|
91
97
|
location = geo_lookup(response.user, response.match_data[1])
|
92
98
|
forecast = get_forecast_io_results(response.user, location)
|
93
|
-
response.reply location.location_name + ' ' + do_the_cloud_thing(forecast)
|
99
|
+
response.reply location.location_name + ' ' + do_the_cloud_thing(forecast, ansi_chars)
|
100
|
+
end
|
101
|
+
|
102
|
+
def handle_irc_asciicloud(response)
|
103
|
+
location = geo_lookup(response.user, response.match_data[1])
|
104
|
+
forecast = get_forecast_io_results(response.user, location)
|
105
|
+
response.reply location.location_name + ' ' + do_the_cloud_thing(forecast, ascii_chars)
|
94
106
|
end
|
95
107
|
|
96
108
|
def handle_irc_seven_day(response)
|
@@ -171,7 +183,12 @@ module ForecastIo
|
|
171
183
|
forecast = get_forecast_io_results(response.user, location)
|
172
184
|
nearest_storm_distance, nearest_storm_bearing = do_the_nearest_storm_thing(forecast)
|
173
185
|
|
174
|
-
|
186
|
+
if nearest_storm_distance == 0
|
187
|
+
response.reply "You're in it!"
|
188
|
+
else
|
189
|
+
response.reply "The nearest storm is #{get_distance(nearest_storm_distance, get_scale(response.user))} to the #{get_cardinal_direction_from_bearing(nearest_storm_bearing)} of you."
|
190
|
+
end
|
191
|
+
|
175
192
|
end
|
176
193
|
end
|
177
194
|
end
|
@@ -13,6 +13,7 @@ module Lita
|
|
13
13
|
config :api_key
|
14
14
|
config :api_uri
|
15
15
|
config :colors
|
16
|
+
config :snowflake, default: '❄'
|
16
17
|
|
17
18
|
include ::ForecastIo::Constants
|
18
19
|
include ::ForecastIo::IrcHandlers
|
@@ -120,6 +121,9 @@ module Lita
|
|
120
121
|
route(/^ansisun\s*$/i, :handle_irc_ansisun)
|
121
122
|
route(/^ansisun\s+(.+)/i, :handle_irc_ansisun,
|
122
123
|
help: { '!ansisun [location]' => '7 day chance-of-sun report for [location].'})
|
124
|
+
route(/^asciisun\s*$/i, :handle_irc_asciisun)
|
125
|
+
route(/^asciisun\s+(.+)/i, :handle_irc_asciisun,
|
126
|
+
help: { '!asciisun [location]' => '7 day chance-of-sun report for [location].'})
|
123
127
|
|
124
128
|
# Mun!
|
125
129
|
|
@@ -135,8 +139,11 @@ module Lita
|
|
135
139
|
help: { '!dailywind [location]' => '7 day wind speed/direction report for [location].'})
|
136
140
|
|
137
141
|
# Cloud cover
|
138
|
-
route(/^
|
139
|
-
route(/^
|
142
|
+
route(/^asciiclouds*\s+(.+)/i, :handle_irc_asciicloud)
|
143
|
+
route(/^asciiclouds*\s*$/i, :handle_irc_asciicloud,
|
144
|
+
help: { '!asciicloud [location]' => '24h cloud cover report for [location].'})
|
145
|
+
route(/^ansiclouds*\s*$/i, :handle_irc_ansicloud)
|
146
|
+
route(/^ansiclouds*\s+(.+)/i, :handle_irc_ansicloud,
|
140
147
|
help: { '!ansicloud [location]' => '24h cloud cover report for [location].'})
|
141
148
|
|
142
149
|
# oooOOOoooo
|
data/lib/lita/handlers/utils.rb
CHANGED
@@ -138,7 +138,7 @@ module ForecastIo
|
|
138
138
|
def get_forecast_io_results(user, location)
|
139
139
|
if ! config.api_uri or ! config.api_key
|
140
140
|
Lita.logger.error "Configuration missing! '#{config.api_uri}' '#{config.api_key}'"
|
141
|
-
|
141
|
+
raise StandardError.new('Configuration missing!')
|
142
142
|
end
|
143
143
|
uri = config.api_uri + config.api_key + '/' + "#{location.latitude},#{location.longitude}"
|
144
144
|
Lita.logger.debug uri
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-forecast-io'
|
3
|
-
spec.version = '0.0.
|
3
|
+
spec.version = '0.0.1'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = <<-EOS
|
7
|
-
A rather different take on the weather.
|
8
|
-
!ansirain Portland, OR 97206, USA rain probability 21:30|████████████████████████████████████▇▇▇▇▇▇▇▇▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅|22:30 max 100%
|
9
|
-
!dailyrain Portland, OR 97206, USA 48 hr rains |▇▇▇▅▅▅▅▃▅▅▃▃▃▃▅▇▇▇▇▇▅▅▁▁▁▁▁______▁▁▁▁▁▁▁▁▁▃▃▃▁▁▁▁| max 59.0%
|
7
|
+
A rather different take on the weather. <br/>
|
8
|
+
!ansirain Portland, OR 97206, USA rain probability 21:30|████████████████████████████████████▇▇▇▇▇▇▇▇▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅|22:30 max 100% <br/>
|
9
|
+
!dailyrain Portland, OR 97206, USA 48 hr rains |▇▇▇▅▅▅▅▃▅▅▃▃▃▃▅▇▇▇▇▇▅▅▁▁▁▁▁______▁▁▁▁▁▁▁▁▁▃▃▃▁▁▁▁| max 59.0% <br/>
|
10
10
|
!ansitemp Portland, OR 97206, USA 24 hr temps: 8.44°C |▅▅▅▅▃▃▁_▁▁▅▅▇█████▇▅▅▃▁| 6.17°C Range: 5.89°C - 12.17°C
|
11
11
|
EOS
|
12
12
|
spec.summary = %q{A text-based interactive query engine for http://forecast.io's api.}
|
@@ -30,7 +30,10 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
30
30
|
it { is_expected.to route('ansiwind') }
|
31
31
|
it { is_expected.to route('asciiwind') }
|
32
32
|
it { is_expected.to route('ansisun') }
|
33
|
+
it { is_expected.to route('asciisun') }
|
34
|
+
it { is_expected.to route('asciicloud') }
|
33
35
|
it { is_expected.to route('ansicloud') }
|
36
|
+
it { is_expected.to route('ansiclouds') }
|
34
37
|
it { is_expected.to route('asciitemp') }
|
35
38
|
it { is_expected.to route('asciirain') }
|
36
39
|
it { is_expected.to route('7day') }
|
@@ -125,12 +128,12 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
125
128
|
|
126
129
|
it '!ansirain Paris' do
|
127
130
|
send_message 'ansirain Paris'
|
128
|
-
expect(replies.last).to include("|\u000302_
|
131
|
+
expect(replies.last).to include("|\u000302_❄\u000306▃\u000310▅\u000303▅\u000309▅\u000311▇\u000308▇\u000307█\u000304█\u000313█\u000302__________________________________________________\u0003|")
|
129
132
|
end
|
130
133
|
|
131
134
|
it '!ansirain return max chance' do
|
132
135
|
send_message 'ansirain Paris'
|
133
|
-
expect(replies.last).to include('max 100%')
|
136
|
+
expect(replies.last).to include('max 100.0%')
|
134
137
|
end
|
135
138
|
|
136
139
|
it '!ansirain no minutes' do
|
@@ -147,7 +150,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
147
150
|
|
148
151
|
it '!ansisnow Paris' do
|
149
152
|
send_message 'ansisnow Paris'
|
150
|
-
expect(replies.last).to include("|\u000302_
|
153
|
+
expect(replies.last).to include("|\u000302_❄\u000306▃\u000310▅\u000303▅\u000309▅\u000311▇\u000308▇\u000307█\u000304█\u000313█\u000302__________________________________________________\u0003|")
|
151
154
|
end
|
152
155
|
|
153
156
|
it '!ansiintensity' do
|
@@ -172,7 +175,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
172
175
|
|
173
176
|
it '!conditions' do
|
174
177
|
send_message 'conditions'
|
175
|
-
expect(replies.last).to eq("Portland, OR 28.3°F |\u000306_▁▃\u000310▅▇█\u000303█\u0003| 38.72°F / 4.3 mph |\u000306↓\u000310↙←\u000311↖↑↗\u000308→\u0003| 12.71 mph / 98% chance of sun / 60m precip |\u000306
|
178
|
+
expect(replies.last).to eq("Portland, OR 28.3°F |\u000306_▁▃\u000310▅▇█\u000303█\u0003| 38.72°F / 4.3 mph |\u000306↓\u000310↙←\u000311↖↑↗\u000308→\u0003| 12.71 mph / 98% chance of sun / 60m precip |\u000306❄\u000311▇\u000308▇\u000302_____________\u0003|")
|
176
179
|
end
|
177
180
|
|
178
181
|
it '!alerts' do
|
@@ -182,12 +185,22 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
182
185
|
|
183
186
|
it '!ansisun' do
|
184
187
|
send_message 'ansisun'
|
185
|
-
expect(replies.last).to eq("Portland, OR 8 day sun forecast |\u000308█\u000309▃\u000308▇\u000309▁_\u000307▅\u000309▃\u000307▅\u0003|")
|
188
|
+
expect(replies.last).to eq("Portland, OR 8 day sun forecast |\u000308█\u000309▃\u000308▇\u000309▁_\u000307▅\u000309▃\u000307▅\u0003| max 100%")
|
189
|
+
end
|
190
|
+
|
191
|
+
it '!asciisun' do
|
192
|
+
send_message 'asciisun'
|
193
|
+
expect(replies.last).to eq("Portland, OR 8 day sun forecast |\u000308'\u000309-\u000308*\u000309._\u000307~\u000309-\u000307~\u0003| max 100%")
|
186
194
|
end
|
187
195
|
|
188
196
|
it '!ansicloud' do
|
189
197
|
send_message 'ansicloud'
|
190
|
-
expect(replies.last).to eq('Portland, OR 24h cloud cover |___________▁▁▁▁▁▁▁▁▃▅▅▅|')
|
198
|
+
expect(replies.last).to eq('Portland, OR 24h cloud cover |___________▁▁▁▁▁▁▁▁▃▅▅▅| max 49.0%')
|
199
|
+
end
|
200
|
+
|
201
|
+
it '!asciicloud' do
|
202
|
+
send_message 'asciicloud'
|
203
|
+
expect(replies.last).to eq('Portland, OR 24h cloud cover |___________........-~~~| max 49.0%')
|
191
204
|
end
|
192
205
|
|
193
206
|
it '!asciitemp' do
|
@@ -197,7 +210,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
197
210
|
|
198
211
|
it '!asciirain' do
|
199
212
|
send_message 'asciirain'
|
200
|
-
expect(replies.last).to include("|\u000302_
|
213
|
+
expect(replies.last).to include("|\u000302_❄\u000306-\u000310~\u000303~\u000309~\u000311*\u000308*\u000307'\u000304'\u000313'\u000302__________________________________________________\u0003|")
|
201
214
|
end
|
202
215
|
|
203
216
|
it '!7day' do
|
@@ -207,12 +220,12 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
207
220
|
|
208
221
|
it '!dailyrain' do
|
209
222
|
send_message 'dailyrain'
|
210
|
-
expect(replies.last).to eq("Portland, OR 48 hr snows |\u000302_______________________
|
223
|
+
expect(replies.last).to eq("Portland, OR 48 hr snows |\u000302_______________________❄❄❄❄▁▁▁▁▁▁▁▁▁▁▁▁▁❄❄❄❄❄❄❄❄_\u0003| max 4.0%")
|
211
224
|
end
|
212
225
|
|
213
226
|
it '!7dayrain' do
|
214
227
|
send_message '7dayrain'
|
215
|
-
expect(replies.last).to eq("Portland, OR 7day snows |\u000302_▁▁\u000306▃\u000313█\u000303▅▅\u000310▃\u0003|")
|
228
|
+
expect(replies.last).to eq("Portland, OR 7day snows |\u000302_▁▁\u000306▃\u000313█\u000303▅▅\u000310▃\u0003| max 100%")
|
216
229
|
end
|
217
230
|
|
218
231
|
it '!ansiozone' do
|
@@ -314,13 +327,13 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
314
327
|
it '!forecastallthethings' do
|
315
328
|
send_message 'forecastallthethings'
|
316
329
|
expect(replies[0]).to eq("Portland, OR weather is currently 28.39°F and clear. Winds out of the E at 5.74 mph. It will be clear for the hour, and flurries tomorrow morning. There are also 357.71 ozones.")
|
317
|
-
expect(replies[1]).to include("|\u000302_
|
330
|
+
expect(replies[1]).to include("|\u000302_❄\u000306▃\u000310▅\u000303▅\u000309▅\u000311▇\u000308▇\u000307█\u000304█\u000313█\u000302__________________________________________________\u0003|")
|
318
331
|
expect(replies[2]).to include("|\u000302_\u000313▅\u000310▁\u000303▃\u000309▃\u000311▃\u000308▅\u000307▅\u000304▅\u000313▅\u000302___________________________________________________\u0003|")
|
319
332
|
expect(replies[3]).to eq("Portland, OR 24 hr temps: 28.3°F |\u000306_▁▃\u000310▅▇█\u000303██\u000310██▇▅\u000306▅▃▃▃▃▃▃▁▁▁▁\u0003| 28.4°F Range: 28.3°F - 39.0°F")
|
320
333
|
expect(replies[4]).to eq("Portland, OR 48h wind direction 4.3 mph|\u000306↓\u000310↙←\u000311↖↑↗\u000308→↘\u000311↓←←←←←←\u000310←←←←←←←\u000306←←←←←\u000302←←←↙↙↙↙↓↓↓\u000306↓↓↓↓↓↓↓↓↙↙\u0003|4.18 mph Range: 1.39 mph - 12.71 mph")
|
321
|
-
expect(replies[5]).to eq("Portland, OR 8 day sun forecast |\u000308█\u000309▃\u000308▇\u000309▁_\u000307▅\u000309▃\u000307▅\u0003|")
|
322
|
-
expect(replies[6]).to eq("Portland, OR 24h cloud cover |___________▁▁▁▁▁▁▁▁▃▅▅▅|")
|
323
|
-
expect(replies[7]).to eq("Portland, OR 48 hr snows |\u000302_______________________
|
334
|
+
expect(replies[5]).to eq("Portland, OR 8 day sun forecast |\u000308█\u000309▃\u000308▇\u000309▁_\u000307▅\u000309▃\u000307▅\u0003| max 100%")
|
335
|
+
expect(replies[6]).to eq("Portland, OR 24h cloud cover |___________▁▁▁▁▁▁▁▁▃▅▅▅| max 49.0%")
|
336
|
+
expect(replies[7]).to eq("Portland, OR 48 hr snows |\u000302_______________________❄❄❄❄▁▁▁▁▁▁▁▁▁▁▁▁▁❄❄❄❄❄❄❄❄_\u0003| max 4.0%")
|
324
337
|
end
|
325
338
|
|
326
339
|
it '!ansipressure' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-forecast-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -165,9 +165,9 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0.0'
|
167
167
|
description: |2
|
168
|
-
A rather different take on the weather.
|
169
|
-
!ansirain Portland, OR 97206, USA rain probability 21:30|████████████████████████████████████▇▇▇▇▇▇▇▇▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅|22:30 max 100%
|
170
|
-
!dailyrain Portland, OR 97206, USA 48 hr rains |▇▇▇▅▅▅▅▃▅▅▃▃▃▃▅▇▇▇▇▇▅▅▁▁▁▁▁______▁▁▁▁▁▁▁▁▁▃▃▃▁▁▁▁| max 59.0%
|
168
|
+
A rather different take on the weather. <br/>
|
169
|
+
!ansirain Portland, OR 97206, USA rain probability 21:30|████████████████████████████████████▇▇▇▇▇▇▇▇▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅|22:30 max 100% <br/>
|
170
|
+
!dailyrain Portland, OR 97206, USA 48 hr rains |▇▇▇▅▅▅▅▃▅▅▃▃▃▃▅▇▇▇▇▇▅▅▁▁▁▁▁______▁▁▁▁▁▁▁▁▁▃▃▃▁▁▁▁| max 59.0% <br/>
|
171
171
|
!ansitemp Portland, OR 97206, USA 24 hr temps: 8.44°C |▅▅▅▅▃▃▁_▁▁▅▅▇█████▇▅▅▃▁| 6.17°C Range: 5.89°C - 12.17°C
|
172
172
|
email:
|
173
173
|
- andrew.kreps@gmail.com
|