lita-onewheel-beer-wework 2.2.0 → 2.3.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: 0f7deb12a83dbc03ee903a22ca7d755e66c034f6
4
- data.tar.gz: f4d2c8ee5ea12e279feae82cb9d6146a60168043
3
+ metadata.gz: 6f289e9ae9dd51c2b47a583e47757f5d0122abd2
4
+ data.tar.gz: 498633d766b1430e67ad633cd8c186174c61dcb6
5
5
  SHA512:
6
- metadata.gz: 7cc26dde47f1331f0fd781c2839759b8b741953e06c213bc0037222c8cc494b312f485e7768c875703972f93c5181dbd43ef73c0ab748818dba28c641014c08c
7
- data.tar.gz: f73e4a5a1994df727a8545e4f01a7a99edc7c2a2a77abc3b994051cf9aef185604d26fde08f2f46b0bc69e1e5e5ff9d4089a62f393ff7e72e0697ca61100a5dc
6
+ metadata.gz: 7c0b2e6d1eeba87d99f23fff44e58e700c6a338e2b26aaeffcbd9a55b200ee23d867334500cdea30185a3ed35f1b07232e7f88bd0895c718cdbd04f3a09b4f3d
7
+ data.tar.gz: 0d3d2e3e6182f701b0d758113890a8ba5fae4be15d0843386b0514b49b3efb894e7bec71fb53e3f086a1059b99660bb9a05e1de0bbf124c72b390133388429f8
@@ -36,6 +36,11 @@ module Lita
36
36
  stored['name'] += ' BLOWN'
37
37
  reply = "#{key} #{stored['name']}"
38
38
  value = stored.to_json
39
+ elsif %w(unblow unblown).include? beer_name.downcase
40
+ stored = JSON.parse(redis.hget(REDIS_KEY, key))
41
+ stored['name'].sub! ' BLOWN', ''
42
+ reply = "#{key} #{stored['name']}"
43
+ value = stored.to_json
39
44
  else
40
45
  value = {
41
46
  name: beer_name,
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-beer-wework'
3
- spec.version = '2.2.0'
3
+ spec.version = '2.3.0'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = 'Basic key/value store for wework beers.'
@@ -41,6 +41,14 @@ describe Lita::Handlers::OnewheelBeerWework, lita_handler: true do
41
41
  expect(replies.last).to eq('1fn ipa BLOWN')
42
42
  end
43
43
 
44
+ it 'unblows a keg' do
45
+ send_command 'wework 1fn ipa'
46
+ send_command 'wework 1fn blown'
47
+ expect(replies.last).to eq('1fn ipa BLOWN')
48
+ send_command 'wework 1fn unblow'
49
+ expect(replies.last).to eq('1fn ipa')
50
+ end
51
+
44
52
  # it 'wework http routes' do
45
53
  # send_command 'wework 2fs one'
46
54
  # send_command 'wework 2fN two'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-beer-wework
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.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-08-03 00:00:00.000000000 Z
11
+ date: 2016-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita