lita-onewheel-forecast-io 0.0.2 → 0.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c77c755bedbee74f17703c30b13b7490252e98b4
|
4
|
+
data.tar.gz: 7da86bdd011f972083d6a4f475aae630cffc7344
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbec25862c6ca80d83d771cae2d992bb302279052c071aa7904f42d593a631f07a4f72debc0209de19f3a888b9854395be63040cf084fc1d62eab1e028db8eb0
|
7
|
+
data.tar.gz: 9238a0aeb45b29ef4d766a80828f187eb98a91c52b9c9d90d9b37ddb797c0adad7631c0dfa8f347d8b1a0290eff02224717e07d8e494d58478414dcd6f4cb0c0
|
data/.travis.yml
CHANGED
@@ -238,14 +238,18 @@ module ForecastIo
|
|
238
238
|
data = forecast['hourly']['data'].slice(0,23)
|
239
239
|
|
240
240
|
max = 0
|
241
|
+
min = 1
|
241
242
|
data.each do |datum|
|
242
243
|
if datum['cloudCover'] > max
|
243
244
|
max = datum['cloudCover']
|
244
245
|
end
|
246
|
+
if datum['cloudCover'] < min
|
247
|
+
min = datum['cloudCover']
|
248
|
+
end
|
245
249
|
end
|
246
250
|
str = get_dot_str(chars, data, 0, 1, 'cloudCover')
|
247
251
|
|
248
|
-
"24h cloud cover |#{str}|
|
252
|
+
"24h cloud cover |#{str}| range #{min * 100}% - #{max * 100}%"
|
249
253
|
end
|
250
254
|
|
251
255
|
def do_the_sunrise_thing(forecast)
|
@@ -44,6 +44,13 @@ module ForecastIo
|
|
44
44
|
response.reply location.location_name + ' ' + ansi_temp_forecast(forecast)
|
45
45
|
end
|
46
46
|
|
47
|
+
def handle_irc_ieeetemp(response)
|
48
|
+
@scale = 'k'
|
49
|
+
location = geo_lookup(response.user, response.match_data[1])
|
50
|
+
forecast = get_forecast_io_results(response.user, location)
|
51
|
+
response.reply location.location_name + ' ' + ansi_temp_forecast(forecast)
|
52
|
+
end
|
53
|
+
|
47
54
|
def handle_irc_ascii_temp(response)
|
48
55
|
location = geo_lookup(response.user, response.match_data[1])
|
49
56
|
forecast = get_forecast_io_results(response.user, location)
|
@@ -36,6 +36,9 @@ module Lita
|
|
36
36
|
route(/^asciitemp\s*$/i, :handle_irc_ascii_temp)
|
37
37
|
route(/^asciitemp\s+(.+)/i, :handle_irc_ascii_temp,
|
38
38
|
help: { '!asciitemp [location]' => 'Like ansitemp, but with less ansi.'})
|
39
|
+
route(/^ieeetemp\s*$/i, :handle_irc_ieeetemp)
|
40
|
+
route(/^ieeetemp\s+(.+)/i, :handle_irc_ieeetemp,
|
41
|
+
help: {'!ieeetemp [location]' => 'The 24h temperature scale for [location], kelvin-style.'})
|
39
42
|
|
40
43
|
# General forecast routes
|
41
44
|
route(/^forecastallthethings\s*$/i, :handle_irc_all_the_things)
|
@@ -27,6 +27,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
27
27
|
it { is_expected.to route('ansihumidity') }
|
28
28
|
it { is_expected.to route('ansiintensity') }
|
29
29
|
it { is_expected.to route('ansitemp') }
|
30
|
+
it { is_expected.to route('ieeetemp') }
|
30
31
|
it { is_expected.to route('ansiwind') }
|
31
32
|
it { is_expected.to route('asciiwind') }
|
32
33
|
it { is_expected.to route('ansisun') }
|
@@ -164,6 +165,11 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
164
165
|
expect(replies.last).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")
|
165
166
|
end
|
166
167
|
|
168
|
+
it '!ieeetemp portland' do
|
169
|
+
send_message 'ieeetemp portland'
|
170
|
+
expect(replies.last).to eq("Portland, OR 24 hr temps: 271.09K |\u000306_▁▃\u000310▅▇█\u000303██\u000310██▇▅\u000306▅▃▃▃▃▃▃▁▁▁▁\u0003| 271.15K Range: 271.09K - 277.04K")
|
171
|
+
end
|
172
|
+
|
167
173
|
it '!dailytemp portland' do
|
168
174
|
send_message 'dailytemp portland'
|
169
175
|
expect(replies.last).to eq("Portland, OR 48 hr temps: 28.3°F |\u000306_▁▃\u000310▅▅▇\u000303██\u000310▇▇▅▅\u000306▅▃▃▃▃▃▁▁▁▁▁▁▁▃\u000310▅▅▇\u000303█████▇\u000310▇▇▇▅▅▅▅\u000306▅▃▃▃▃\u0003| 30.5°F Range: 28.3°F - 41.3°F")
|
@@ -201,12 +207,12 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
201
207
|
|
202
208
|
it '!ansicloud' do
|
203
209
|
send_message 'ansicloud'
|
204
|
-
expect(replies.last).to eq('Portland, OR 24h cloud cover |___________▁▁▁▁▁▁▁▁▃▅▅▅|
|
210
|
+
expect(replies.last).to eq('Portland, OR 24h cloud cover |___________▁▁▁▁▁▁▁▁▃▅▅▅| range 0% - 49.0%')
|
205
211
|
end
|
206
212
|
|
207
213
|
it '!asciicloud' do
|
208
214
|
send_message 'asciicloud'
|
209
|
-
expect(replies.last).to eq('Portland, OR 24h cloud cover |___________........-~~~|
|
215
|
+
expect(replies.last).to eq('Portland, OR 24h cloud cover |___________........-~~~| range 0% - 49.0%')
|
210
216
|
end
|
211
217
|
|
212
218
|
it '!asciitemp' do
|
@@ -338,7 +344,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
338
344
|
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")
|
339
345
|
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")
|
340
346
|
expect(replies[5]).to eq("Portland, OR 48hr sun forecast |\u000308████████████████████\u000307▇▇▅\u000309▅▅▃\u000303▁_▁\u000309▃▃▃\u000303▁▁▁▁▃\u000309▃▅\u000307▇▇▇▇\u000308▇▇▇▇▇▇\u0003| max 88%")
|
341
|
-
expect(replies[6]).to eq("Portland, OR 24h cloud cover |████████████████████▇▇▇|
|
347
|
+
expect(replies[6]).to eq("Portland, OR 24h cloud cover |████████████████████▇▇▇| range 51.0% - 100.0%")
|
342
348
|
expect(replies[7]).to eq("Portland, OR 48 hr snows |\u000302_______________________❄❄❄❄▁▁▁▁▁▁▁▁▁▁▁▁▁❄❄❄❄❄❄❄❄_\u0003| max 4.0%")
|
343
349
|
end
|
344
350
|
|
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.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|