lita-onewheel-wunderground 0.1.0 → 1.0.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: 9d3767543f41cdf95dc5012e2c728b744e9bf143
4
- data.tar.gz: b26046b0e5ccb0d0c188928e22dc0920ac55940c
3
+ metadata.gz: 36e761d59d1136a51743eb3792f57a509499b29a
4
+ data.tar.gz: 9b225468ecbc477024fe592af893eb9928bff2ad
5
5
  SHA512:
6
- metadata.gz: 2442a5966bd92c16f8f50fc50a5fae73350aca75204a26e45228947fceb7489767b4a765ab1e6322edecb5e5a011a1c14d457d3163d9d6d9181e3e158a143e4e
7
- data.tar.gz: 0e62125185dc39afd22daed384fbddfda3f15a21f7ac6f8518962e09e2507f231bce6c1723b357531db5f425f7b0ebed0db17f4eb5e9e128234a85e4c5bc1850
6
+ metadata.gz: 3d74b68f17acc6fc635ac5e94cafb469bf63b92d669f29172bc2bb9e7203018c9709403a8f4f0ce83d186428395857fceeaee1079e1c627a7d2d9b891f379477
7
+ data.tar.gz: 2bc76dea4d11a8cb9df90f53e5a41323e0806cf77385a4c9bf1adc6b44c8d830d347b7850151b36bac34a186a60f78d5da583519ba92b62b34e810067527b730
@@ -8,10 +8,16 @@ module Lita
8
8
  route /^recordhigh$/, :record_high, command: true
9
9
  route /^recordlow$/, :record_low, command: true
10
10
 
11
+ route /^reocrdhigh$/, :record_high, command: true
12
+ route /^reocrdlow$/, :record_low, command: true
13
+
11
14
  def record_high(response)
12
15
  data = get_data
13
16
 
14
- response.reply data['almanac']['temp_high']['record']['F'] + "F in " + data['almanac']['temp_high']['recordyear']
17
+ record_high = data['almanac']['temp_high']['record']['F']
18
+ record_year = data['almanac']['temp_high']['recordyear']
19
+ normal_high = data['almanac']['temp_high']['normal']['F']
20
+ response.reply "Normally #{normal_high}F, record high #{record_high}F in #{record_year}"
15
21
  end
16
22
 
17
23
  def get_data
@@ -24,7 +30,10 @@ module Lita
24
30
  def record_low(response)
25
31
  data = get_data
26
32
 
27
- response.reply data['almanac']['temp_low']['record']['F'] + "F in " + data['almanac']['temp_low']['recordyear']
33
+ record_low = data['almanac']['temp_low']['record']['F']
34
+ normal_low = data['almanac']['temp_low']['normal']['F']
35
+ record_year = data['almanac']['temp_low']['recordyear']
36
+ response.reply "Normally #{normal_low}F, record low #{record_low}F in #{record_year}"
28
37
  end
29
38
 
30
39
  Lita.register_handler(self)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-wunderground'
3
- spec.version = '0.1.0'
3
+ spec.version = '1.0.0'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita interface to reveal today's record high temperature.}
@@ -3,6 +3,8 @@ require 'spec_helper'
3
3
  describe Lita::Handlers::OnewheelWunderground, lita_handler: true do
4
4
  it { is_expected.to route_command('recordhigh') }
5
5
  it { is_expected.to route_command('recordlow') }
6
+ it { is_expected.to route_command('reocrdhigh') }
7
+ it { is_expected.to route_command('reocrdlow') }
6
8
 
7
9
  before do
8
10
  mock = File.open('spec/fixtures/Portland.json').read
@@ -11,11 +13,11 @@ describe Lita::Handlers::OnewheelWunderground, lita_handler: true do
11
13
 
12
14
  it 'gives a record high number' do
13
15
  send_command 'recordhigh'
14
- expect(replies.last).to eq('78F in 1983')
16
+ expect(replies.last).to eq('Normally 62F, record high 78F in 1983')
15
17
  end
16
18
 
17
19
  it 'gives a record low number' do
18
20
  send_command 'recordlow'
19
- expect(replies.last).to eq('31F in 1977')
21
+ expect(replies.last).to eq('Normally 43F, record low 31F in 1977')
20
22
  end
21
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-wunderground
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.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: 2016-05-13 00:00:00.000000000 Z
11
+ date: 2016-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita