lita-onewheel-beer-loyal-legion 0.0.1 → 0.1.1

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: 363a67ace1bf18e78d8ddaa2db1de2080d69e7e1
4
- data.tar.gz: 74eb4d5d16e45bae8bcdb74535b3382505131f02
3
+ metadata.gz: 07c772f6c34f2251609bffcdcd749d1b90f767d2
4
+ data.tar.gz: 82947deea6d01f9761f8c02087c142b1a2349b1b
5
5
  SHA512:
6
- metadata.gz: f041e7955f6f821c32fb9628664cfca3105a7eb0751488d6089e58ce8cd60d8fb7e877839fdfb9bc856d6c3157a66031c008fe285020dbd2cc9c7f1c04131b9c
7
- data.tar.gz: d976b0b55f8a9afe2dbee35b0800b0b9a3c3f468bfd9b3c3ab8f5019ffb877523085489ff2647b64d761c8a14029c129eae642bafe2cda696a287406eacd4ba1
6
+ metadata.gz: 303c8bd0db2102148b1fed5dfd7c1370e564ef3d774efcd7ee988c7b3f1fce2cd7524cc4fbddb91af41f0c3a19006af05aa395eea90369da65f3222ee71edf72
7
+ data.tar.gz: edac95090c00f979611b006f4f64815b963724ada8bc0c565aa6642bf8eb4fd4184228181ecce3cfbd63f01f55a5240cabfbc7cef3ada4275e2e8f9e7011dfc6
@@ -44,12 +44,13 @@ module Lita
44
44
  def send_response(tap, datum, response)
45
45
  reply = "Loyal Legion tap #{tap}) #{get_tap_type_text(datum[:type])}"
46
46
  # reply += "#{datum[:brewery]} "
47
- reply += "#{datum[:name]}"
47
+ reply += "#{datum[:name]}, "
48
48
  # reply += "- #{datum[:desc]}, "
49
49
  # reply += "Served in a #{datum[1]['glass']} glass. "
50
50
  # reply += "#{datum[:remaining]}"
51
- # reply += "#{datum[:abv]}%, "
52
- # reply += "$#{datum[:price].to_s.sub '.0', ''}"
51
+ reply += "#{datum[:abv]}%, "
52
+ reply += "#{datum[:ibu]} IBU, "
53
+ reply += "$#{datum[:price].to_s}"
53
54
 
54
55
  Lita.logger.info "send_response: Replying with #{reply}"
55
56
 
@@ -80,16 +81,28 @@ module Lita
80
81
  next if tap_name.empty?
81
82
 
82
83
  beer_name = beer_node.css('div.tap-content h1').children.to_s.strip
83
- full_text_search = beer_name
84
+
85
+ greyout = beer_node.css('small.grayout').children.to_s
86
+ greyedouts = greyout.split /\|/
87
+ beer_type = greyedouts[0].strip
88
+ abv = greyedouts[1].match(/\d+\.*\d*/).to_s
89
+ if greyedouts[2]
90
+ ibu = greyedouts[2].match(/\d+/).to_s
91
+ end
92
+
93
+ price = beer_node.css('div.beer-price').children.first.to_s.strip.sub '$', ''
94
+
95
+ full_text_search = "#{beer_name} #{beer_type}"
84
96
 
85
97
  gimme_what_you_got[tap_name] = {
86
98
  # type: tap_type,
87
99
  # remaining: remaining,
88
100
  # brewery: brewery.to_s,
89
101
  name: beer_name.to_s,
90
- # desc: beer_type.to_s,
91
- # abv: abv.to_f,
92
- # price: price,
102
+ desc: beer_type.to_s,
103
+ abv: abv.to_f,
104
+ ibu: ibu.to_f,
105
+ price: price,
93
106
  search: full_text_search
94
107
  }
95
108
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-beer-loyal-legion'
3
- spec.version = '0.0.1'
3
+ spec.version = '0.1.1'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita interface to Loyal Legion's listings.}
@@ -23,133 +23,120 @@ describe Lita::Handlers::OnewheelBeerLoyalLegion, lita_handler: true do
23
23
 
24
24
  it 'shows the loyallegion taps' do
25
25
  send_command 'loyallegion'
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")
26
+ expect(replies.last).to eq('taps: 1) Coldfire Spring IPA 2) Block 15 Sticky Hands Imp. IPA 3) Red Ox ISA 4) Coalition Space Fruit IPA 5) Ruse Translator IPA 7) Leikam Across The Universe IPA 9) Rogue Cold Brew IPA 10) Rogue 6 Hop IPA 11) Migration Straight Outta Portland IPA 12) Silver Moon Crazy Horse IIPA 15) Alameda Admiration IPA 16) Gigantic Ginormous IIPA 19) Coalition Droppin’ Science IIPA 20) Ordnance Double Recoil Double IPA 21) Old Town Summer Of ’74 Tangerine Ale 22) Hopworks Lager 23) Ex Novo Hoppy Pils 24) Ex Novo The Most Interesting Lager In The World 25) Full Sail Session Lager $3 Pint 26) Heater Allen Helles Lager With German Malt 27) Heater Allen Helles Lager Made With Oregon Malt 28) Rogue Anniversary Charlie Strong Ale 29) Barley Browns Pygmy Pale Ale 30) Rogue Fresh Roast Ale 31) Fort George Quick Wit 32) Oakshire Hot Cakes Breakfast Brown Ale 33) FERMENT Pale 34) Gigantic/Half Acre Grimalkin Anomorphotron Imp. Stout/IPA 36) Coldfire St. James Red 38) Agrarian Amber Is The Color Of Your Energy 39) Double Mountain Vaporizer Dry Hop Plae 40) Coalition King Kitty Red 41) Cascade Lakes 20″ Brown 42) Double Mountain The Divine 9th Anni. Barrel Aged Brown 43) Breakside Guava Red 44) Hopworks Mother Russia Imp. Stout 45) Baerlic Old Blood And Guts Barleywine 46) Three Creeks 10 Pine Chocolate Porter 48) LEGION OF DOOM! Collab. Fruit Stout 51) Hopworks Evelyn Radshine Imp IPA Radler 53) Rogue Good Chit Pilsner 55) Laurelwood Dos Excellente Mexican Style Lager 56) Gigantic KolschTastic 57) Rogue 4 Hop Session IPA 58) Thunder Island Galaxy Single Hop Pale 59) Coalition Serendipity Session IPA 60) Hi Wheel Cranberry Zozzle 63) Deschutes Nitro Cream Ale 64) Wild Ride Nut Crusher Peanut Porter Nitro 65) Migration Clem’s Cream Ale Nitro 66) Fat Heads Rocket Man Red Nitro 67) Ex Novo Nautical By Nature Oyster Stout Nitro 68) Hopworks Velvet ESB Nitro 69) Hopworks Rise Up Red Nitro 70) Alameda Black Bear Nitro Stout 73) Upright Saison 74) Breakside Bergamot Special Bitter 75) Hopworks Pink Drink Rasp. Belgian Tripel 77) Occidental Sticke Alt 78) Rogue Doppelbock 79) Occidental Maibock 80) Commons Myrtle 81) Cider Riot Never Give A Inch Blkberry Cider 82) Alameda Betty Bunny Ale With Fruit 83) Hi Wheel Lemon Ginger Citrus Wine 84) Wildcraft Barrel Aged Kiwi Cider 85) Ecliptic Callisto Black Currant Tripel 86) Rogue New Crustacean Barleywine/Trip IPA 87) Swift Dank Cider 88) Alameda A Is For Apricot Tart Ale 89) Anthem Apple Cider 90) Ground Breaker IPA #5 91) Alter Ego Sunny Cider 92) Coldfire Berliner Weiss 93) Hopworks Senior Saul T. Plum Gose 94) Stickmen Passionfruit Wheat 95) Culmination #PDXNOW Cali Common 96) Coalition Bose Mode Wild Ale Barrel Aged With Pears 97) Rogue YSB Cask')
27
27
  end
28
28
 
29
29
  it 'displays details for tap 4' do
30
30
  send_command 'loyallegion 4'
31
- expect(replies.last).to eq('loyallegion tap 4) Blind Pig - IPA 6.1%, $6')
31
+ expect(replies.last).to eq('Loyal Legion tap 4) Coalition Space Fruit IPA, 7.0%, 50.0 IBU, $6.00')
32
32
  end
33
33
 
34
34
  it 'doesn\'t explode on 1' do
35
35
  send_command 'loyallegion 1'
36
36
  expect(replies.count).to eq(1)
37
- expect(replies.last).to eq('loyallegion tap 1) Aktien Helles Lager 5.3%, $5')
37
+ expect(replies.last).to eq('Loyal Legion tap 1) Coldfire Spring IPA, 6.9%, 85.0 IBU, $6.00')
38
38
  end
39
39
 
40
40
  it 'gets nitro' do
41
41
  send_command 'loyallegion nitro'
42
- expect(replies.last).to eq('loyallegion tap 30) Nitro- Stout 4.1%, $4')
42
+ expect(replies.last).to eq('Loyal Legion tap 70) Alameda Black Bear Nitro Stout, 6.8%, 55.0 IBU, $6.00')
43
43
  end
44
44
 
45
45
  it 'searches for ipa' do
46
46
  send_command 'loyallegion ipa'
47
- expect(replies.last).to eq('loyallegion tap 50) WFO - IPA 7.5%, $5')
47
+ expect(replies.last).to eq('Loyal Legion tap 90) Ground Breaker IPA #5, 5.6%, 60.0 IBU, $5.00')
48
48
  end
49
49
 
50
- # it 'searches for brown' do
51
- # send_command 'loyallegion 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
54
-
55
50
  it 'searches for abv >9%' do
56
51
  send_command 'loyallegion >9%'
57
- expect(replies.count).to eq(8)
58
- expect(replies[0]).to eq('loyallegion tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
59
- expect(replies[1]).to eq('loyallegion tap 3) Barrel Aged Old Thunderpussy 10.8%, $5')
60
- expect(replies.last).to eq('loyallegion tap 46) Sump - Imp Coffee Stout 10.5%, $5')
52
+ expect(replies.count).to eq(6)
53
+ expect(replies[0]).to eq('Loyal Legion tap 20) Ordnance Double Recoil Double IPA, 10.5%, 80.0 IBU, $6.00')
61
54
  end
62
55
 
63
56
  it 'searches for abv > 9%' do
64
57
  send_command 'loyallegion > 9%'
65
- expect(replies.count).to eq(8)
66
- expect(replies[0]).to eq('loyallegion tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
67
- expect(replies[1]).to eq('loyallegion tap 3) Barrel Aged Old Thunderpussy 10.8%, $5')
68
- expect(replies.last).to eq('loyallegion tap 46) Sump - Imp Coffee Stout 10.5%, $5')
58
+ expect(replies.count).to eq(6)
59
+ expect(replies[0]).to eq('Loyal Legion tap 20) Ordnance Double Recoil Double IPA, 10.5%, 80.0 IBU, $6.00')
69
60
  end
70
61
 
71
62
  it 'searches for abv >= 9%' do
72
63
  send_command 'loyallegion >= 9%'
73
- expect(replies.count).to eq(10)
74
- expect(replies[0]).to eq('loyallegion tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
75
- expect(replies.last).to eq('loyallegion tap 46) Sump - Imp Coffee Stout 10.5%, $5')
64
+ expect(replies.count).to eq(8)
65
+ expect(replies[0]).to eq('Loyal Legion tap 20) Ordnance Double Recoil Double IPA, 10.5%, 80.0 IBU, $6.00')
76
66
  end
77
67
 
78
68
  it 'searches for abv <4.1%' do
79
69
  send_command 'loyallegion <4.1%'
80
- expect(replies.count).to eq(2)
81
- expect(replies[0]).to eq('loyallegion tap 15) Grapefruit Radler 2.5%, $5')
82
- expect(replies.last).to eq('loyallegion tap 38) Prairie-Vous Francais - Saison   Just Tapped 3.9%, $5')
70
+ expect(replies.count).to eq(3)
71
+ expect(replies[0]).to eq('Loyal Legion tap 51) Hopworks Evelyn Radshine Imp IPA Radler, 4.0%, 0.0 IBU, $6.00')
83
72
  end
84
73
 
85
74
  it 'searches for abv <= 4%' do
86
75
  send_command 'loyallegion <= 4%'
87
- expect(replies.count).to eq(2)
88
- expect(replies[0]).to eq('loyallegion tap 15) Grapefruit Radler 2.5%, $5')
89
- expect(replies.last).to eq('loyallegion tap 38) Prairie-Vous Francais - Saison   Just Tapped 3.9%, $5')
76
+ expect(replies.count).to eq(3)
77
+ expect(replies[0]).to eq('Loyal Legion tap 51) Hopworks Evelyn Radshine Imp IPA Radler, 4.0%, 0.0 IBU, $6.00')
90
78
  end
91
79
 
92
80
  it 'searches for prices >$5' do
93
81
  send_command 'loyallegion >$5'
94
- expect(replies.count).to eq(11)
95
- expect(replies[0]).to eq('loyallegion tap 4) Blind Pig - IPA 6.1%, $6')
96
- expect(replies[1]).to eq('loyallegion tap 21) Kristallweissbier 5.4%, $6')
82
+ expect(replies.count).to eq(77)
83
+ expect(replies[1]).to eq('Loyal Legion tap 2) Block 15 Sticky Hands Imp. IPA, 8.1%, 110.0 IBU, $6.00')
97
84
  end
98
85
 
99
86
  it 'searches for prices >=$6' do
100
87
  send_command 'loyallegion >=$6'
101
- expect(replies.count).to eq(11)
102
- expect(replies[0]).to eq('loyallegion tap 4) Blind Pig - IPA 6.1%, $6')
88
+ expect(replies.count).to eq(77)
89
+ expect(replies[0]).to eq('Loyal Legion tap 1) Coldfire Spring IPA, 6.9%, 85.0 IBU, $6.00')
103
90
  end
104
91
 
105
- it 'searches for prices > $6' do
106
- send_command 'loyallegion > $6'
107
- expect(replies.count).to eq(3)
108
- expect(replies[0]).to eq('loyallegion tap 29) Nitro- Shake - Choco Porter 5.9%, $8')
92
+ it 'searches for prices > $5.99' do
93
+ send_command 'loyallegion > $5.99'
94
+ expect(replies.count).to eq(77)
95
+ expect(replies[0]).to eq('Loyal Legion tap 1) Coldfire Spring IPA, 6.9%, 85.0 IBU, $6.00')
109
96
  end
110
97
 
111
98
  it 'searches for prices <$4.1' do
112
99
  send_command 'loyallegion <$4.1'
113
- expect(replies.count).to eq(4)
114
- expect(replies[0]).to eq('loyallegion tap 8) Cheap, cold 4.7%, $3')
100
+ expect(replies.count).to eq(1)
101
+ expect(replies[0]).to eq('Loyal Legion tap 25) Full Sail Session Lager $3 Pint, 5.1%, 18.0 IBU, $3.00')
115
102
  end
116
103
 
117
104
  it 'searches for prices < $4.01' do
118
105
  send_command 'loyallegion < $4.01'
119
- expect(replies.count).to eq(4)
120
- expect(replies[0]).to eq('loyallegion tap 8) Cheap, cold 4.7%, $3')
106
+ expect(replies.count).to eq(1)
107
+ expect(replies[0]).to eq('Loyal Legion tap 25) Full Sail Session Lager $3 Pint, 5.1%, 18.0 IBU, $3.00')
121
108
  end
122
109
 
123
110
  it 'searches for prices <= $4.00' do
124
111
  send_command 'loyallegion <= $4.00'
125
- expect(replies.count).to eq(4)
126
- expect(replies[0]).to eq('loyallegion tap 8) Cheap, cold 4.7%, $3')
112
+ expect(replies.count).to eq(1)
113
+ expect(replies[0]).to eq('Loyal Legion tap 25) Full Sail Session Lager $3 Pint, 5.1%, 18.0 IBU, $3.00')
127
114
  end
128
115
 
129
116
  it 'runs a random beer through' do
130
117
  send_command 'loyallegion roulette'
131
118
  expect(replies.count).to eq(1)
132
- expect(replies.last).to include('loyallegion tap')
119
+ expect(replies.last).to include('Loyal Legion tap')
133
120
  end
134
121
 
135
122
  it 'runs a random beer through' do
136
123
  send_command 'loyallegion random'
137
124
  expect(replies.count).to eq(1)
138
- expect(replies.last).to include('loyallegion tap')
125
+ expect(replies.last).to include('Loyal Legion tap')
139
126
  end
140
127
 
141
128
  it 'searches with a space' do
142
- send_command 'loyallegion cider riot'
143
- expect(replies.last).to eq('loyallegion tap 10) Cider- NeverGiveAnInch -Rosé 6.9%, $5')
129
+ send_command 'loyallegion chocolate'
130
+ expect(replies.last).to eq('Loyal Legion tap 46) Three Creeks 10 Pine Chocolate Porter, 8.4%, 26.0 IBU, $6.00')
144
131
  end
145
132
 
146
133
  it 'displays low abv' do
147
134
  send_command 'loyallegionabvhigh'
148
- expect(replies.last).to eq('loyallegion tap 31) Notorious - IIIPA 11.5%, $5')
135
+ expect(replies.last).to eq('Loyal Legion tap 45) Baerlic Old Blood And Guts Barleywine, 11.4%, 100.0 IBU, $6.00')
149
136
  end
150
137
 
151
138
  it 'displays high abv' do
152
139
  send_command 'loyallegionabvlow'
153
- expect(replies.last).to eq('loyallegion tap 15) Grapefruit Radler 2.5%, $5')
140
+ expect(replies.last).to eq('Loyal Legion tap 92) Coldfire Berliner Weiss, 3.6%, 7.0 IBU, $6.00')
154
141
  end
155
142
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-beer-loyal-legion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.1
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-15 00:00:00.000000000 Z
11
+ date: 2016-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita