lita-onewheel-election-cnn 3.0.1 → 3.0.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: 86b0d7c7da63913d2053fe00151d673131d4b5b5
4
- data.tar.gz: b038435540dfca7e05a9c42385d526bb4b97ec44
3
+ metadata.gz: 9ffdce43ce0663e40c0243ca5b7b4e5f20b2c1be
4
+ data.tar.gz: 10f84a8bc0124f72e20de0aa7489fd1920285a14
5
5
  SHA512:
6
- metadata.gz: 4c65712ee3d6b986fea2d802cb55fa1eb73c9f372e499922cb2022fbfc8890ea354bb09277a7ec6f8ed8a95129f0471cd45a50da3389fb567f9b92f6155e5b28
7
- data.tar.gz: e61420adb710a7397158fec56b31f59d6d532570e41c6c17bce727e754d2af25396a2ecaed15aa3dd6bd97c9abda6a09b4268ecbfd7f8863a48a184ea7669f49
6
+ metadata.gz: 3ae7e0a146d0ea6902d7d0af89e5004d3b473adb9d0c6033e7ff0294d90c076297231538c96455f974663e438b751d1b9799cab7c1f206ec2156643dc7c15451
7
+ data.tar.gz: 28c39eb7b418884c02edc62f23d547528ed26faf65aa45c1d1b9efaa2def61747db11e9da0a550c29e7049bf85fb61739b6a748f04d67cdc9f1342e5fc53251f
@@ -8,11 +8,19 @@ module Lita
8
8
  command: true,
9
9
  help: {'election' => 'Display the current election results.'}
10
10
 
11
+ route /^e$/i,
12
+ :election,
13
+ command: true
14
+
11
15
  route /^e[rl]ection\s+(.*)$/i,
12
16
  :election_by_state,
13
17
  command: true,
14
18
  help: {'election AB' => 'Display the current election results in Alabama.'}
15
19
 
20
+ route /^e\s+(.*)$/i,
21
+ :election_by_state,
22
+ command: true
23
+
16
24
  def election(response)
17
25
  Lita.logger.debug 'Getting election data'
18
26
  results = JSON.parse(RestClient.get('http://data.cnn.com/ELECTION/2016/full/P.full.json'))
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-election-cnn'
3
- spec.version = '3.0.1'
3
+ spec.version = '3.0.2'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita interface to CNN's 2016 Presidential Election JSON.}
@@ -2,6 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  describe Lita::Handlers::OnewheelElectionCnn, lita_handler: true do
4
4
  it { is_expected.to route_command('election') }
5
+ it { is_expected.to route_command('e') }
6
+ it { is_expected.to route_command('election ny') }
7
+ it { is_expected.to route_command('e ny') }
5
8
 
6
9
  it 'shows the current election results' do
7
10
  mock = File.open('spec/fixtures/election.json').read
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-election-cnn
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.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-11-08 00:00:00.000000000 Z
11
+ date: 2016-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita