lita-onewheel-forecast-io 1.5.1 → 1.5.2
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: 6306585bcd405d2a55a7d681a5a4b0eaa6bb1fd1
|
4
|
+
data.tar.gz: 021fe05f724fdbe51e593630e41128cf05b47aab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d1405a61301b1ab37f853ae788daebc9fca980ef393b4fcb5b6db94c6b79e86d551049651a6b517ea49b5cc28e62f4831ae7f90ec5fa607d3d68d2954c65b6b
|
7
|
+
data.tar.gz: dc1cd1b647dea6288c25f9af39297530d39cbe472add185547d823bfdc0d2bc59fa427009a628de112e02d058508ee20a2e5c36156c91f4856a5246a12792805
|
@@ -447,6 +447,10 @@ module ForecastIo
|
|
447
447
|
# Get tomorrow's high
|
448
448
|
# Get tomorrow's rain chance
|
449
449
|
temp_diff = forecast['daily']['data'][0]['temperatureMax'] - forecast['daily']['data'][1]['temperatureMax']
|
450
|
+
get_daily_comparison_text(temp_diff)
|
451
|
+
end
|
452
|
+
|
453
|
+
def get_daily_comparison_text(temp_diff)
|
450
454
|
if temp_diff <= 1 and temp_diff >= -1
|
451
455
|
'about the same as'
|
452
456
|
elsif temp_diff > 1 and temp_diff <= 5
|
@@ -460,6 +464,14 @@ module ForecastIo
|
|
460
464
|
end
|
461
465
|
end
|
462
466
|
|
467
|
+
def do_the_today_thing(forecast)
|
468
|
+
# Get today's high
|
469
|
+
# Get tomorrow's high
|
470
|
+
# Get tomorrow's rain chance
|
471
|
+
temp_diff = forecast['daily']['data'][1]['temperatureMax'] - forecast['daily']['data'][0]['temperatureMax']
|
472
|
+
get_daily_comparison_text(temp_diff)
|
473
|
+
end
|
474
|
+
|
463
475
|
# Check for the time of day when it will hit 72F.
|
464
476
|
def do_the_windows_thing(forecast)
|
465
477
|
time_to_close_the_windows = nil
|
@@ -215,8 +215,8 @@ module ForecastIo
|
|
215
215
|
def handle_irc_today(response)
|
216
216
|
location = geo_lookup(response.user, response.match_data[1])
|
217
217
|
forecast = get_forecast_io_results(response.user, location)
|
218
|
-
|
219
|
-
response.reply "
|
218
|
+
toay_will_be = do_the_today_thing(forecast)
|
219
|
+
response.reply "Today will be #{toay_will_be} yesterday."
|
220
220
|
end
|
221
221
|
|
222
222
|
def handle_irc_windows(response)
|
@@ -541,10 +541,10 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
541
541
|
expect(replies.last).to eq(nil)
|
542
542
|
end
|
543
543
|
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
544
|
+
it 'will summarize !today in relation to yesterday' do
|
545
|
+
send_command 'today'
|
546
|
+
expect(replies.last).to eq('Today will be cooler than yesterday.')
|
547
|
+
end
|
548
548
|
|
549
549
|
# it 'colors strings' do
|
550
550
|
# cstr = Lita::Handlers::ForecastIo.get_colored_string([{:key => 1}], :key, 'x', {1 => :blue})
|
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: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|