lita-onewheel-apex-bar 0.0.0 → 0.1.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: 8a423ba187d1852826ec870e60b59585471e8652
|
4
|
+
data.tar.gz: 1e6f4129a28465b5b0f7a1181ea98a811baab29d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 429e32ba40d64ad1b299172987aa475ecf2949f96ba16a1b689541c078700a48c37cfb2ff044f7b37d45e4513167f91bb88158140aa1496b06b2eb562afdbbd9
|
7
|
+
data.tar.gz: bb445e5c6ef257234fe0455e6e40fbdd8f37193cf2babe61631ec81a9dc166c2db9dcbf9747e60100a78e934483605b94ee5303adbe619ac0ae380579a759013
|
@@ -49,6 +49,7 @@ module Lita
|
|
49
49
|
# reply += "Served in a #{datum[1]['glass']} glass. "
|
50
50
|
# reply += "#{get_display_prices datum[:prices]}, "
|
51
51
|
# reply += "#{datum[:remaining]}"
|
52
|
+
reply += "#{datum[:abv]}%"
|
52
53
|
|
53
54
|
Lita.logger.info "send_response: Replying with #{reply}"
|
54
55
|
|
@@ -84,25 +85,27 @@ module Lita
|
|
84
85
|
# gimme_what_you_got
|
85
86
|
tap_name = (index + 1).to_s
|
86
87
|
|
87
|
-
|
88
|
-
beer_name = beer_node.css('td')[0].children.to_s
|
88
|
+
brewery = beer_node.css('td')[2].children.to_s
|
89
|
+
beer_name = beer_node.css('td')[0].children.text.to_s
|
90
|
+
beer_type = beer_name.match(/\s*-\s*\w+$/).to_s
|
91
|
+
beer_type.sub! /\s+-\s+/, ''
|
89
92
|
# beer_desc = get_beer_desc(beer_node)
|
90
93
|
abv = beer_node.css('td')[4].children.to_s
|
91
|
-
|
94
|
+
full_text_search = "#{brewery} #{beer_name.to_s.gsub /(\d+|')/, ''}" # #{beer_desc.to_s.gsub /\d+\.*\d*%*/, ''}
|
92
95
|
# prices = get_prices(beer_node)
|
93
|
-
|
94
96
|
gimme_what_you_got[tap_name] = {
|
95
97
|
# type: tap_type,
|
96
98
|
# remaining: remaining,
|
97
|
-
|
99
|
+
brewery: brewery.to_s,
|
98
100
|
name: beer_name.to_s,
|
99
|
-
|
101
|
+
desc: beer_type.to_s,
|
100
102
|
abv: abv.to_f,
|
101
103
|
# prices: prices,
|
102
|
-
|
104
|
+
search: full_text_search
|
103
105
|
}
|
104
106
|
end
|
105
|
-
puts gimme_what_you_got.inspect
|
107
|
+
# puts gimme_what_you_got.inspect
|
108
|
+
|
106
109
|
gimme_what_you_got
|
107
110
|
end
|
108
111
|
|
@@ -3,8 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
4
4
|
it { is_expected.to route_command('apex') }
|
5
5
|
it { is_expected.to route_command('apex 4') }
|
6
|
-
|
7
|
-
|
6
|
+
it { is_expected.to route_command('apex nitro') }
|
7
|
+
it { is_expected.to route_command('apex CASK') }
|
8
8
|
it { is_expected.to route_command('apex <$4') }
|
9
9
|
it { is_expected.to route_command('apex < $4') }
|
10
10
|
it { is_expected.to route_command('apex <=$4') }
|
@@ -23,43 +23,38 @@ describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
|
23
23
|
|
24
24
|
it 'shows the Apex taps' do
|
25
25
|
send_command 'apex'
|
26
|
-
expect(replies.last).to eq("taps: 1)
|
26
|
+
expect(replies.last).to eq("taps: 1) Bayreuther Aktien Helles Lager 2) Boneyard Armored Fist - Big,Black&Hoppy 3) Magnolia Barrel Aged Old Thunderpussy 4) Russian River Blind Pig - IPA 5) Magnolia Blue Bell Bitter 6) Boneyard Bone-A-Fide - Pale 7) Knee Deep Breaking Bud - IPA 8) Hamm's Cheap, cold 9) Two Rivers Cider- Huckleberry 10) Cider Riot! Cider- NeverGiveAnInch -Rosé 11) Bockor Cuvée des Jacobins Rouge* 12) Magnolia Delilah Jones '15 - StrongRye 13) Alpine Duet - IPA 14) NewBelg&HofTenDormaal Golden - Herbs,Seeds,Spelt 15) Stiegl Grapefruit Radler 16) Barley Brown's Handtruck - Pale 17) Barley Brown's Head Shake - IIPA 18) Boneyard Hop Venom - IIPA 19) Ayinger Jahrhundert - Export Lager 20) Magnolia Kalifornia Kolsch 21) Weihenstephan Kristallweissbier 22) New Belgium Le Terroir* 23) Knee Deep Lupulin River - IPA 24) Gebruder Maisel Maisel's Weisse - Hefeweizen 25) Hair of the Dog Nitro- Adam -Drinking Tobacco 26) Dieu du Ciel! Nitro- Aphrodisiaque - Stout 27) North Coast Nitro- Old Rasputin - RIS 28) North Coast Nitro- Red Seal - Red 29) Boulder Nitro- Shake - Choco Porter 30) Guinness Nitro- Stout 31) Boneyard Notorious - IIIPA 32) Crux Off Leash - NW Session Ale 33) Rogue Old Crustacean '12-Barleywine 34) Barley Brown's Pallet Jack - IPA 35) Prairie Phantasmagoria - IPA 36) Radeberger Pilsner 37) Russian River Pliny The Elder 38) Prairie Prairie-Vous Francais - Saison Just Tapped 39) Magnolia Proving Ground - IPA 40) Crux Prowell Springs - Pilsner 41) Dupont Saison 42) Magnolia Saison de Lily 43) Against the Grain Sho' Nuff - Belgian Pale 44) To Øl Simple Life - Lacto Saison* 45) Magnolia Stout of Circumstance 46) Perennial Sump - Imp Coffee Stout 47) Against the Grain Tex Arcana - Stout 48) Bosteels Tripel Karmeliet 49) Gigantic Vivid - IIPA 50) Barley Brown's WFO - IPA")
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'displays details for tap 4' do
|
30
30
|
send_command 'apex 4'
|
31
|
-
expect(replies.last).to eq('Apex tap 4) Blind Pig - IPA ')
|
31
|
+
expect(replies.last).to eq('Apex tap 4) Blind Pig - IPA 6.1%')
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'doesn\'t explode on 1' do
|
35
|
-
send_command '
|
35
|
+
send_command 'apex 1'
|
36
36
|
expect(replies.count).to eq(1)
|
37
|
-
expect(replies.last).to eq('
|
37
|
+
expect(replies.last).to eq('Apex tap 1) Aktien Helles Lager 5.3%')
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'gets nitro' do
|
41
|
-
send_command '
|
42
|
-
expect(replies.last).to eq('
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'gets cask' do
|
46
|
-
send_command 'taps cask'
|
47
|
-
expect(replies.last).to eq("Bailey's tap 3) (Cask) Machine House Crystal Maze - ESB 4.0%, 10oz - $3 | 20oz - $5, 57% remaining")
|
41
|
+
send_command 'apex nitro'
|
42
|
+
expect(replies.last).to eq('Apex tap 30) Nitro- Stout 4.1%')
|
48
43
|
end
|
49
44
|
|
50
45
|
it 'searches for ipa' do
|
51
|
-
send_command '
|
52
|
-
expect(replies.last).to eq(
|
46
|
+
send_command 'apex ipa'
|
47
|
+
expect(replies.last).to eq('Apex tap 50) WFO - IPA 7.5%')
|
53
48
|
end
|
54
49
|
|
55
|
-
it 'searches for brown' do
|
56
|
-
|
57
|
-
|
58
|
-
end
|
50
|
+
# it 'searches for brown' do
|
51
|
+
# send_command 'apex brown'
|
52
|
+
# expect(replies.last).to eq("Bailey's tap 22) GoodLife 29er - India Brown Ale 6.0%, 10oz - $3 | 20oz - $5 | 32oz Crowler - $8, 37% remaining")
|
53
|
+
# end
|
59
54
|
|
60
55
|
it 'searches for abv >9%' do
|
61
|
-
send_command '
|
62
|
-
expect(replies.count).to eq(
|
56
|
+
send_command 'apex >9%'
|
57
|
+
expect(replies.count).to eq(8)
|
63
58
|
expect(replies[0]).to eq("Bailey's tap 8) Fat Head’s Zeus Juice - Belgian Strong Blonde 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $9, 44% remaining")
|
64
59
|
expect(replies[1]).to eq("Bailey's tap 9) Hopworks Noggin’ Floggin’ - Barleywine 11.0%, 4oz - $3 | 12oz - $6 | 32oz Crowler - $13, 34% remaining")
|
65
60
|
expect(replies[2]).to eq("Bailey's tap 18) Knee Deep Hop Surplus - Triple IPA 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $10, 25% remaining")
|
@@ -67,7 +62,7 @@ describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
|
67
62
|
end
|
68
63
|
|
69
64
|
it 'searches for abv > 9%' do
|
70
|
-
send_command '
|
65
|
+
send_command 'apex > 9%'
|
71
66
|
expect(replies.count).to eq(4)
|
72
67
|
expect(replies[0]).to eq("Bailey's tap 8) Fat Head’s Zeus Juice - Belgian Strong Blonde 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $9, 44% remaining")
|
73
68
|
expect(replies[1]).to eq("Bailey's tap 9) Hopworks Noggin’ Floggin’ - Barleywine 11.0%, 4oz - $3 | 12oz - $6 | 32oz Crowler - $13, 34% remaining")
|
@@ -76,7 +71,7 @@ describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
|
76
71
|
end
|
77
72
|
|
78
73
|
it 'searches for abv >= 9%' do
|
79
|
-
send_command '
|
74
|
+
send_command 'apex >= 9%'
|
80
75
|
expect(replies.count).to eq(5)
|
81
76
|
expect(replies[0]).to eq("Bailey's tap 8) Fat Head’s Zeus Juice - Belgian Strong Blonde 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $9, 44% remaining")
|
82
77
|
expect(replies[1]).to eq("Bailey's tap 9) Hopworks Noggin’ Floggin’ - Barleywine 11.0%, 4oz - $3 | 12oz - $6 | 32oz Crowler - $13, 34% remaining")
|
@@ -86,35 +81,35 @@ describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
|
86
81
|
end
|
87
82
|
|
88
83
|
it 'searches for abv <4.1%' do
|
89
|
-
send_command '
|
84
|
+
send_command 'apex <4.1%'
|
90
85
|
expect(replies.count).to eq(2)
|
91
86
|
expect(replies[0]).to eq("Bailey's tap 3) (Cask) Machine House Crystal Maze - ESB 4.0%, 10oz - $3 | 20oz - $5, 57% remaining")
|
92
87
|
expect(replies.last).to eq("Bailey's tap 11) Lagunitas Copper Fusion Ale - Copper Ale 4.0%, 10oz - $3 | 20oz - $5 | 32oz Crowler - $8, 19% remaining")
|
93
88
|
end
|
94
89
|
|
95
90
|
it 'searches for abv < 4.1%' do
|
96
|
-
send_command '
|
91
|
+
send_command 'apex < 4.1%'
|
97
92
|
expect(replies.count).to eq(2)
|
98
93
|
expect(replies[0]).to eq("Bailey's tap 3) (Cask) Machine House Crystal Maze - ESB 4.0%, 10oz - $3 | 20oz - $5, 57% remaining")
|
99
94
|
expect(replies.last).to eq("Bailey's tap 11) Lagunitas Copper Fusion Ale - Copper Ale 4.0%, 10oz - $3 | 20oz - $5 | 32oz Crowler - $8, 19% remaining")
|
100
95
|
end
|
101
96
|
|
102
97
|
it 'searches for abv <= 4%' do
|
103
|
-
send_command '
|
98
|
+
send_command 'apex <= 4%'
|
104
99
|
expect(replies.count).to eq(2)
|
105
100
|
expect(replies[0]).to eq("Bailey's tap 3) (Cask) Machine House Crystal Maze - ESB 4.0%, 10oz - $3 | 20oz - $5, 57% remaining")
|
106
101
|
expect(replies.last).to eq("Bailey's tap 11) Lagunitas Copper Fusion Ale - Copper Ale 4.0%, 10oz - $3 | 20oz - $5 | 32oz Crowler - $8, 19% remaining")
|
107
102
|
end
|
108
103
|
|
109
104
|
it 'searches for prices >$6' do
|
110
|
-
send_command '
|
105
|
+
send_command 'apex >$6'
|
111
106
|
expect(replies.count).to eq(2)
|
112
107
|
expect(replies[0]).to eq("Bailey's tap 1) Cider Riot! Plastic Paddy - Apple Cider w/ Irish tea 6.0%, 10oz - $4 | 20oz - $7 | 32oz Crowler - $10, 48% remaining")
|
113
108
|
expect(replies[1]).to eq("Bailey's tap 4) Wild Ride Solidarity - Abbey Dubbel – Barrel Aged (Pinot Noir) 8.2%, 4oz - $4 | 12oz - $7, 26% remaining")
|
114
109
|
end
|
115
110
|
|
116
111
|
it 'searches for prices >=$6' do
|
117
|
-
send_command '
|
112
|
+
send_command 'apex >=$6'
|
118
113
|
expect(replies.count).to eq(4)
|
119
114
|
expect(replies[0]).to eq("Bailey's tap 1) Cider Riot! Plastic Paddy - Apple Cider w/ Irish tea 6.0%, 10oz - $4 | 20oz - $7 | 32oz Crowler - $10, 48% remaining")
|
120
115
|
expect(replies[1]).to eq("Bailey's tap 4) Wild Ride Solidarity - Abbey Dubbel – Barrel Aged (Pinot Noir) 8.2%, 4oz - $4 | 12oz - $7, 26% remaining")
|
@@ -123,14 +118,14 @@ describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
|
123
118
|
end
|
124
119
|
|
125
120
|
it 'searches for prices > $6' do
|
126
|
-
send_command '
|
121
|
+
send_command 'apex > $6'
|
127
122
|
expect(replies.count).to eq(2)
|
128
123
|
expect(replies[0]).to eq("Bailey's tap 1) Cider Riot! Plastic Paddy - Apple Cider w/ Irish tea 6.0%, 10oz - $4 | 20oz - $7 | 32oz Crowler - $10, 48% remaining")
|
129
124
|
expect(replies[1]).to eq("Bailey's tap 4) Wild Ride Solidarity - Abbey Dubbel – Barrel Aged (Pinot Noir) 8.2%, 4oz - $4 | 12oz - $7, 26% remaining")
|
130
125
|
end
|
131
126
|
|
132
127
|
it 'searches for prices <$4.1' do
|
133
|
-
send_command '
|
128
|
+
send_command 'apex <$4.1'
|
134
129
|
expect(replies.count).to eq(3)
|
135
130
|
expect(replies[0]).to eq("Bailey's tap 8) Fat Head’s Zeus Juice - Belgian Strong Blonde 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $9, 44% remaining")
|
136
131
|
expect(replies[1]).to eq("Bailey's tap 18) Knee Deep Hop Surplus - Triple IPA 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $10, 25% remaining")
|
@@ -138,7 +133,7 @@ describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
|
138
133
|
end
|
139
134
|
|
140
135
|
it 'searches for prices < $4.01' do
|
141
|
-
send_command '
|
136
|
+
send_command 'apex < $4.01'
|
142
137
|
expect(replies.count).to eq(3)
|
143
138
|
expect(replies[0]).to eq("Bailey's tap 8) Fat Head’s Zeus Juice - Belgian Strong Blonde 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $9, 44% remaining")
|
144
139
|
expect(replies[1]).to eq("Bailey's tap 18) Knee Deep Hop Surplus - Triple IPA 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $10, 25% remaining")
|
@@ -146,7 +141,7 @@ describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
|
146
141
|
end
|
147
142
|
|
148
143
|
it 'searches for prices <= $4.00' do
|
149
|
-
send_command '
|
144
|
+
send_command 'apex <= $4.00'
|
150
145
|
expect(replies.count).to eq(3)
|
151
146
|
expect(replies[0]).to eq("Bailey's tap 8) Fat Head’s Zeus Juice - Belgian Strong Blonde 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $9, 44% remaining")
|
152
147
|
expect(replies[1]).to eq("Bailey's tap 18) Knee Deep Hop Surplus - Triple IPA 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $10, 25% remaining")
|
@@ -154,34 +149,29 @@ describe Lita::Handlers::OnewheelApexBar, lita_handler: true do
|
|
154
149
|
end
|
155
150
|
|
156
151
|
it 'runs a random beer through' do
|
157
|
-
send_command '
|
152
|
+
send_command 'apex roulette'
|
158
153
|
expect(replies.count).to eq(1)
|
159
154
|
expect(replies.last).to include("Bailey's tap")
|
160
155
|
end
|
161
156
|
|
162
157
|
it 'runs a random beer through' do
|
163
|
-
send_command '
|
158
|
+
send_command 'apex random'
|
164
159
|
expect(replies.count).to eq(1)
|
165
160
|
expect(replies.last).to include("Bailey's tap")
|
166
161
|
end
|
167
162
|
|
168
163
|
it 'searches with a space' do
|
169
|
-
send_command '
|
164
|
+
send_command 'apex zeus juice'
|
170
165
|
expect(replies.last).to eq("Bailey's tap 8) Fat Head’s Zeus Juice - Belgian Strong Blonde 10.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $9, 44% remaining")
|
171
166
|
end
|
172
167
|
|
173
|
-
it 'displays low taps' do
|
174
|
-
send_command 'tapslow'
|
175
|
-
expect(replies.last).to eq("Bailey's tap 25) Green Flash Passion Fruit Kicker - Wheat Ale w/ Passion Fruit 5.5%, 10oz - $3 | 20oz - $5, <= 1% remaining")
|
176
|
-
end
|
177
|
-
|
178
168
|
it 'displays low abv' do
|
179
|
-
send_command '
|
169
|
+
send_command 'apexabvhigh'
|
180
170
|
expect(replies.last).to eq("Bailey's tap 20) Knee Deep Dark Horse - Imperial Stout 12.0%, 4oz - $2 | 12oz - $4 | 32oz Crowler - $10, 39% remaining")
|
181
171
|
end
|
182
172
|
|
183
173
|
it 'displays high abv' do
|
184
|
-
send_command '
|
174
|
+
send_command 'apexabvlow'
|
185
175
|
expect(replies.last).to eq("Bailey's tap 3) (Cask) Machine House Crystal Maze - ESB 4.0%, 10oz - $3 | 20oz - $5, 57% remaining")
|
186
176
|
end
|
187
177
|
end
|