lita-onewheel-forecast-io 1.5.1 → 1.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58bbfdeac54ce0c95c93b658a6acf0efc5638606
4
- data.tar.gz: 5aef9878adabe5658e9e71dc69373c95e67d2d19
3
+ metadata.gz: 6306585bcd405d2a55a7d681a5a4b0eaa6bb1fd1
4
+ data.tar.gz: 021fe05f724fdbe51e593630e41128cf05b47aab
5
5
  SHA512:
6
- metadata.gz: 9776b124c89adf72ee3ab20a06382744f13b38ba3e3e9d3192f8fe27143d8e9c57cdb1efb328982b53447ffe40297a34a4c6194c723cf8c7f60d197f0ef2c8b3
7
- data.tar.gz: a6798fc2b81506a79a220b62d6b485d51af239c115b1a4f125ac4895c1af21902132a92ec521ca53036f007e045e97f34386e65223c66ae3d2d8eed0dd8921bf
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
- tomorrow_will_be = do_the_tomorrow_thing(forecast)
219
- response.reply "Tomorrow will be #{tomorrow_will_be} today."
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)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-forecast-io'
3
- spec.version = '1.5.1'
3
+ spec.version = '1.5.2'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = <<-EOS
@@ -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
- # it 'will summarize !today in relation to yesterday' do
545
- # send_command 'today'
546
- # expect(replies.last).to eq('Today will be whatever')
547
- # end
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.1
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-29 00:00:00.000000000 Z
11
+ date: 2016-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita