lita-onewheel-forecast-io 1.6.3 → 1.6.4
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: 282d3fc2cfdee6d76c4c6c26a240a31ff35d04df
|
4
|
+
data.tar.gz: d859b10ccccae9258013edce2fced69f7932b8f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e25b3fb4eac96214183dbc7caf3a46dc9372f356fa9d9f76beca087d5f3a055091d6d69b9be08ae561542f8bd4bfc5b8ffe655ca41da803b72b0bb299ffce98
|
7
|
+
data.tar.gz: 052cee91b5b0e65b4476e5bdc67e5d902d361f2fc38cd03dcd9a5ef512f810355cdeb1fe4c22254254da1f3214170f40fdc6735c460f2bfdcd89e4a284eec007
|
@@ -443,30 +443,27 @@ module ForecastIo
|
|
443
443
|
end
|
444
444
|
|
445
445
|
def do_the_today_thing(forecast, yesterday)
|
446
|
-
|
447
|
-
temp_diff
|
448
|
-
get_daily_comparison_text(temp_diff)
|
446
|
+
temp_diff = forecast['daily']['data'][0]['temperatureMax'] - yesterday['daily']['data'][0]['temperatureMax']
|
447
|
+
get_daily_comparison_text(temp_diff, forecast['daily']['data'][0]['temperatureMax'])
|
449
448
|
end
|
450
449
|
|
451
450
|
def do_the_tomorrow_thing(forecast)
|
452
|
-
puts "#{forecast['daily']['data'][0]['temperatureMax']} - #{forecast['daily']['data'][1]['temperatureMax']}"
|
453
|
-
forecast['daily']['data'][0]['temperatureMax'] - forecast['daily']['data'][1]['temperatureMax']
|
454
451
|
temp_diff = forecast['daily']['data'][0]['temperatureMax'] - forecast['daily']['data'][1]['temperatureMax']
|
455
|
-
get_daily_comparison_text(temp_diff)
|
452
|
+
get_daily_comparison_text(temp_diff, forecast['daily']['data'][0]['temperatureMax'])
|
456
453
|
end
|
457
454
|
|
458
455
|
# If the temperature difference is positive,
|
459
|
-
def get_daily_comparison_text(temp_diff)
|
456
|
+
def get_daily_comparison_text(temp_diff, high)
|
460
457
|
if temp_diff <= 1 and temp_diff >= -1
|
461
458
|
'about the same as'
|
462
459
|
elsif temp_diff > 1 and temp_diff <= 5
|
463
460
|
'cooler than'
|
464
461
|
elsif temp_diff > 5
|
465
|
-
'much colder than'
|
462
|
+
(high > 70)? 'much cooler than' : 'much colder than'
|
466
463
|
elsif temp_diff < -1 and temp_diff >= -5
|
467
464
|
'warmer than'
|
468
465
|
elsif temp_diff < -5
|
469
|
-
'much hotter than'
|
466
|
+
(high < 70)? 'much warmer than' : 'much hotter than'
|
470
467
|
end
|
471
468
|
end
|
472
469
|
|
@@ -507,7 +507,7 @@ describe Lita::Handlers::OnewheelForecastIo, lita_handler: true do
|
|
507
507
|
it '!tomorrows' do
|
508
508
|
mock_up 'much_warmer'
|
509
509
|
send_command 'tomorrow'
|
510
|
-
expect(replies.last).to eq('Tomorrow will be much
|
510
|
+
expect(replies.last).to eq('Tomorrow will be much warmer than today.')
|
511
511
|
end
|
512
512
|
|
513
513
|
it '!windows' 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: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|