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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36e761d59d1136a51743eb3792f57a509499b29a
|
4
|
+
data.tar.gz: 9b225468ecbc477024fe592af893eb9928bff2ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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 = '
|
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:
|
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-
|
11
|
+
date: 2016-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|