lita-onewheel-beer-apex 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.travis.yml +16 -0
- data/Gemfile +6 -0
- data/README.md +30 -0
- data/Rakefile +6 -0
- data/lib/lita/handlers/onewheel_beer_apex.rb +111 -0
- data/lib/lita-onewheel-beer-apex.rb +12 -0
- data/lita-onewheel-beer-apex.gemspec +31 -0
- data/spec/fixtures/apex.html +689 -0
- data/spec/lita/handlers/onewheel_apex_bar_spec.rb +155 -0
- data/spec/spec_helper.rb +14 -0
- metadata +213 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 12f871eabb1a0a50b12655f79d6981b6c68899f9
|
4
|
+
data.tar.gz: 393726319625775c72ab424bec8d7f5a33ed7670
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 482140aa6c45ed052608d6176b2b8500e72001172811b2d8b89a0fb404e7bcd57fdaa19496315e0cb90213bcb30d1014a0947d02238e00586caa7246b14c64c0
|
7
|
+
data.tar.gz: b21f2e53f17813220336e7d7acf44edf756a52a085bc2671a7f52ae7af043031793300d589edf9bf405a160503d4ea7f0fbe35de65b2d433820866d46ebbfbab
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- 2.2.4
|
5
|
+
- 2.3.0
|
6
|
+
|
7
|
+
script: bundle exec rspec -fp spec
|
8
|
+
|
9
|
+
# Travis CI has an outdated version of bundler on older versions of ruby.
|
10
|
+
# See bundler/bundler#3558 for more information
|
11
|
+
#before_install:
|
12
|
+
# - gem update --system
|
13
|
+
# - gem update bundler
|
14
|
+
|
15
|
+
services:
|
16
|
+
- redis-server
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# lita-onewheel-apex-bar
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/onewheelskyward/lita-onewheel-apex-bar.png?branch=master)](https://travis-ci.org/onewheelskyward/lita-onewheel-apex-bar)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/onewheelskyward/lita-onewheel-apex-bar/badge.png)](https://coveralls.io/r/onewheelskyward/lita-onewheel-apex-bar)
|
5
|
+
|
6
|
+
Searches Apex Bar's draft list for data and displays it in IRC.
|
7
|
+
http://apexbar.com/menu
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add lita-onewheel-apex-bar to your Lita instance's Gemfile:
|
12
|
+
|
13
|
+
``` ruby
|
14
|
+
gem 'lita-onewheel-apex-bar'
|
15
|
+
```
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
apex
|
20
|
+
|
21
|
+
apex 4
|
22
|
+
|
23
|
+
apex nitro
|
24
|
+
|
25
|
+
apex >(=)5%
|
26
|
+
|
27
|
+
apex <(=)$5
|
28
|
+
|
29
|
+
apex roulette|random
|
30
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'sanitize'
|
4
|
+
require 'lita-onewheel-beer-base'
|
5
|
+
|
6
|
+
module Lita
|
7
|
+
module Handlers
|
8
|
+
class OnewheelBeerApex < OnewheelBeerBase
|
9
|
+
route /^apex$/i,
|
10
|
+
:taps_list,
|
11
|
+
command: true,
|
12
|
+
help: {'taps' => 'Display the current Apex Bar taps.'}
|
13
|
+
|
14
|
+
route /^apex ([\w ]+)$/i,
|
15
|
+
:taps_deets,
|
16
|
+
command: true,
|
17
|
+
help: {'taps 4' => 'Display the tap 4 deets, including prices.'}
|
18
|
+
|
19
|
+
route /^apex ([<>=\w.\s]+)%$/i,
|
20
|
+
:taps_by_abv,
|
21
|
+
command: true,
|
22
|
+
help: {'taps >4%' => 'Display beers over 4% ABV.'}
|
23
|
+
|
24
|
+
route /^apex ([<>=\$\w.\s]+)$/i,
|
25
|
+
:taps_by_price,
|
26
|
+
command: true,
|
27
|
+
help: {'taps <$5' => 'Display beers under $5.'}
|
28
|
+
|
29
|
+
route /^apex (roulette|random|rand|ran|ra|r)$/i,
|
30
|
+
:taps_by_random,
|
31
|
+
command: true,
|
32
|
+
help: {'taps roulette' => 'Can\'t decide? Let me do it for you!'}
|
33
|
+
|
34
|
+
route /^apexabvlow$/i,
|
35
|
+
:taps_low_abv,
|
36
|
+
command: true,
|
37
|
+
help: {'tapslow' => 'Show me the lowest abv keg.'}
|
38
|
+
|
39
|
+
route /^apexabvhigh$/i,
|
40
|
+
:taps_high_abv,
|
41
|
+
command: true,
|
42
|
+
help: {'tapslow' => 'Show me the highest abv keg.'}
|
43
|
+
|
44
|
+
def send_response(tap, datum, response)
|
45
|
+
reply = "Apex tap #{tap}) #{get_tap_type_text(datum[:type])}"
|
46
|
+
# reply += "#{datum[:brewery]} "
|
47
|
+
reply += "#{datum[:name]} "
|
48
|
+
# reply += "- #{datum[:desc]}, "
|
49
|
+
# reply += "Served in a #{datum[1]['glass']} glass. "
|
50
|
+
# reply += "#{datum[:remaining]}"
|
51
|
+
reply += "#{datum[:abv]}%, "
|
52
|
+
reply += "$#{datum[:price].to_s.sub '.0', ''}"
|
53
|
+
|
54
|
+
Lita.logger.info "send_response: Replying with #{reply}"
|
55
|
+
|
56
|
+
response.reply reply
|
57
|
+
end
|
58
|
+
|
59
|
+
def get_source
|
60
|
+
Lita.logger.debug 'get_source started'
|
61
|
+
unless (response = redis.get('page_response'))
|
62
|
+
Lita.logger.info 'No cached result found, fetching.'
|
63
|
+
response = RestClient.get('http://apexbar.com/menu')
|
64
|
+
redis.setex('page_response', 1800, response)
|
65
|
+
end
|
66
|
+
parse_response response
|
67
|
+
end
|
68
|
+
|
69
|
+
# This is the worker bee- decoding the html into our "standard" document.
|
70
|
+
# Future implementations could simply override this implementation-specific
|
71
|
+
# code to help this grow more widely.
|
72
|
+
def parse_response(response)
|
73
|
+
Lita.logger.debug 'parse_response started.'
|
74
|
+
gimme_what_you_got = {}
|
75
|
+
noko = Nokogiri.HTML response
|
76
|
+
noko.css('table.table tbody tr').each_with_index do |beer_node, index|
|
77
|
+
# gimme_what_you_got
|
78
|
+
tap_name = (index + 1).to_s
|
79
|
+
|
80
|
+
brewery = beer_node.css('td')[2].children.to_s
|
81
|
+
beer_name = beer_node.css('td')[0].children.text.to_s
|
82
|
+
beer_type = beer_name.match(/\s*-\s*\w+$/).to_s
|
83
|
+
beer_type.sub! /\s+-\s+/, ''
|
84
|
+
# beer_desc = get_beer_desc(beer_node)
|
85
|
+
abv = beer_node.css('td')[4].children.to_s
|
86
|
+
full_text_search = "#{brewery} #{beer_name.to_s.gsub /(\d+|')/, ''}" # #{beer_desc.to_s.gsub /\d+\.*\d*%*/, ''}
|
87
|
+
price_node = beer_node.css('td')[1].children.to_s
|
88
|
+
price = (price_node.sub /\$/, '').to_f
|
89
|
+
|
90
|
+
Lita.logger.debug "Price #{price}"
|
91
|
+
|
92
|
+
gimme_what_you_got[tap_name] = {
|
93
|
+
# type: tap_type,
|
94
|
+
# remaining: remaining,
|
95
|
+
brewery: brewery.to_s,
|
96
|
+
name: beer_name.to_s,
|
97
|
+
desc: beer_type.to_s,
|
98
|
+
abv: abv.to_f,
|
99
|
+
price: price,
|
100
|
+
search: full_text_search
|
101
|
+
}
|
102
|
+
end
|
103
|
+
# puts gimme_what_you_got.inspect
|
104
|
+
|
105
|
+
gimme_what_you_got
|
106
|
+
end
|
107
|
+
|
108
|
+
Lita.register_handler(self)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'lita'
|
2
|
+
|
3
|
+
Lita.load_locales Dir[File.expand_path(
|
4
|
+
File.join('..', '..', 'locales', '*.yml'), __FILE__
|
5
|
+
)]
|
6
|
+
|
7
|
+
require 'lita/handlers/onewheel_beer_apex'
|
8
|
+
|
9
|
+
Lita::Handlers::OnewheelBeerApex.template_root File.expand_path(
|
10
|
+
File.join('..', '..', 'templates'),
|
11
|
+
__FILE__
|
12
|
+
)
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
spec.name = 'lita-onewheel-beer-apex'
|
3
|
+
spec.version = '0.2.2'
|
4
|
+
spec.authors = ['Andrew Kreps']
|
5
|
+
spec.email = ['andrew.kreps@gmail.com']
|
6
|
+
spec.description = %q{Lita interface to Apex Bar's listings.}
|
7
|
+
spec.summary = %q{See above.}
|
8
|
+
spec.homepage = 'https://github.com/onewheelskyward/lita-onewheel-beer-apex'
|
9
|
+
spec.license = 'MIT'
|
10
|
+
spec.metadata = { 'lita_plugin_type' => 'handler' }
|
11
|
+
|
12
|
+
spec.files = `git ls-files`.split($/)
|
13
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
14
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
15
|
+
spec.require_paths = ['lib']
|
16
|
+
|
17
|
+
spec.add_runtime_dependency 'lita', '~> 4.7'
|
18
|
+
spec.add_runtime_dependency 'rest-client', '~> 1.8'
|
19
|
+
spec.add_runtime_dependency 'nokogiri', '~> 1.6'
|
20
|
+
spec.add_runtime_dependency 'sanitize', '~> 4.0'
|
21
|
+
spec.add_runtime_dependency 'lita-onewheel-beer-base', '>= 1'
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
24
|
+
|
25
|
+
# spec.add_development_dependency 'pry-byebug', '~> 3.1'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.4'
|
27
|
+
spec.add_development_dependency 'rack-test', '~> 0.6'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
29
|
+
spec.add_development_dependency 'simplecov', '~> 0.10'
|
30
|
+
spec.add_development_dependency 'coveralls', '~> 0.8'
|
31
|
+
end
|
@@ -0,0 +1,689 @@
|
|
1
|
+
|
2
|
+
<!DOCTYPE html>
|
3
|
+
<html lang="en" class="no-js">
|
4
|
+
|
5
|
+
|
6
|
+
<head>
|
7
|
+
<meta charset="utf-8">
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
9
|
+
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
|
10
|
+
<title>Apex Bar PDX</title>
|
11
|
+
<link href="/static/css/bootstrap-2.2.1-cyborg.min.css" rel="stylesheet" />
|
12
|
+
<link href="/static/css/bootstrap-responsive-2.2.2.min.css" rel="stylesheet" />
|
13
|
+
<link rel="stylesheet" href="/static/css/font-awesome.min.css">
|
14
|
+
<link href="/static/css/main.css" rel="stylesheet" />
|
15
|
+
<link rel="shortcut icon" href="/static/img/favicon.ico" />
|
16
|
+
|
17
|
+
<style type="text/css">
|
18
|
+
table.table { width: auto; }
|
19
|
+
.marketing .span12 {margin-top: 90px; }
|
20
|
+
.table th {font-weight: bolder; color: #FCFCFC; }
|
21
|
+
.table td {font-weight: normal;}
|
22
|
+
|
23
|
+
.table-striped tbody > tr:nth-child(odd) > td,
|
24
|
+
.table-striped tbody > tr:nth-child(odd) > th {
|
25
|
+
background-color: #2B2828;
|
26
|
+
}
|
27
|
+
</style>
|
28
|
+
|
29
|
+
<script src="/static/js/lib/modernizr-2.6.2.min.js"></script>
|
30
|
+
<!-- defer-incapable JS block -->
|
31
|
+
</head>
|
32
|
+
<body>
|
33
|
+
<div id="header">
|
34
|
+
<!--suppress HtmlUnknownTarget -->
|
35
|
+
<div class="navbar-wrapper">
|
36
|
+
<div class="container">
|
37
|
+
|
38
|
+
<!-- Desktop/Tablet version -->
|
39
|
+
<div class="navbar navbar-inverse hidden-phone">
|
40
|
+
<div class="navbar-inner">
|
41
|
+
<a class="brand" href="/">APEX</a><a class="brand" href="/" style="font-size: 120%; font-style: italic">A Beer Bar</a>
|
42
|
+
<ul class="nav pull-right">
|
43
|
+
|
44
|
+
<li>
|
45
|
+
<a href="/faq">FAQ</a>
|
46
|
+
</li>
|
47
|
+
<!-- <li>
|
48
|
+
<a href="/bottlemenu">Bottle Menu</a>
|
49
|
+
</li> -->
|
50
|
+
<li>
|
51
|
+
<a href="/menu">Live Beer Menu</a>
|
52
|
+
</li>
|
53
|
+
</ul>
|
54
|
+
</div><!-- /.navbar .container -->
|
55
|
+
</div><!-- /.navbar-inner -->
|
56
|
+
|
57
|
+
<!-- phone version -->
|
58
|
+
<div class="navbar navbar-inverse visible-phone">
|
59
|
+
<div class="navbar-inner" style="font-size: 90%">
|
60
|
+
<a class="brand" href="/" style="font-size: 180%; font-style: normal">APEX</a>
|
61
|
+
<a class="brand" href="/" style="font-size: 150%; font-style: italic">A Beer Bar</a>
|
62
|
+
<ul class="nav pull-right">
|
63
|
+
|
64
|
+
<li>
|
65
|
+
<a href="/faq">FAQ</a>
|
66
|
+
</li>
|
67
|
+
<!-- <li>
|
68
|
+
<a href="/bottlemenu">Bottle Menu</a>
|
69
|
+
</li> -->
|
70
|
+
<li>
|
71
|
+
<a href="/menu">Live Beer Menu</a>
|
72
|
+
</li>
|
73
|
+
</ul>
|
74
|
+
</div><!-- /.navbar .container -->
|
75
|
+
</div><!-- /.navbar-inner -->
|
76
|
+
|
77
|
+
|
78
|
+
</div>
|
79
|
+
</div><!-- /navbar -->
|
80
|
+
|
81
|
+
|
82
|
+
</div>
|
83
|
+
<div class="container" id="maincontent">
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
<div id="body_content">
|
88
|
+
|
89
|
+
|
90
|
+
<div class="container marketing">
|
91
|
+
<div class="row-fluid">
|
92
|
+
<div class="span12">
|
93
|
+
<h2>Live Beers on Tap</h2>
|
94
|
+
<table class="table table-striped table-bordered table-hover table-condensed">
|
95
|
+
<thead>
|
96
|
+
<tr>
|
97
|
+
<th class="span4">Name</th>
|
98
|
+
<th class="span1">Price</th>
|
99
|
+
<th class="span4">Brewery</th>
|
100
|
+
<th class="span1">Origin</th>
|
101
|
+
<th class="span1">ABV</th>
|
102
|
+
<th class="span1">Size</th>
|
103
|
+
</tr>
|
104
|
+
</thead>
|
105
|
+
<tbody>
|
106
|
+
|
107
|
+
<tr onclick="window.open('http://www.ratebeer.com/beer/bayreuther-aktien-original/44444/5328/','_blank');">
|
108
|
+
|
109
|
+
<td>Aktien Helles Lager</td>
|
110
|
+
|
111
|
+
<td>$5</td>
|
112
|
+
<td>Bayreuther</td>
|
113
|
+
<td>GER</td>
|
114
|
+
<td>5.3</td>
|
115
|
+
<td>0.5L</td>
|
116
|
+
</tr>
|
117
|
+
|
118
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/23066/63088','_blank');">
|
119
|
+
|
120
|
+
<td>Armored Fist - Big,Black&Hoppy</td>
|
121
|
+
|
122
|
+
<td>$5</td>
|
123
|
+
<td>Boneyard</td>
|
124
|
+
<td>BND</td>
|
125
|
+
<td>10</td>
|
126
|
+
<td>12oz</td>
|
127
|
+
</tr>
|
128
|
+
|
129
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/463/14719/','_blank');">
|
130
|
+
|
131
|
+
<td>Barrel Aged Old Thunderpussy</td>
|
132
|
+
|
133
|
+
<td>$5</td>
|
134
|
+
<td>Magnolia</td>
|
135
|
+
<td>CA</td>
|
136
|
+
<td>10.8</td>
|
137
|
+
<td>6oz</td>
|
138
|
+
</tr>
|
139
|
+
|
140
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/863/22790','_blank');">
|
141
|
+
|
142
|
+
<td>Blind Pig - IPA</td>
|
143
|
+
|
144
|
+
<td>$6</td>
|
145
|
+
<td>Russian River</td>
|
146
|
+
<td>CA</td>
|
147
|
+
<td>6.1</td>
|
148
|
+
<td>16oz</td>
|
149
|
+
</tr>
|
150
|
+
|
151
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/463/4647/','_blank');">
|
152
|
+
|
153
|
+
<td>Blue Bell Bitter </td>
|
154
|
+
|
155
|
+
<td>$5</td>
|
156
|
+
<td>Magnolia</td>
|
157
|
+
<td>CA</td>
|
158
|
+
<td>5.4</td>
|
159
|
+
<td>16oz</td>
|
160
|
+
</tr>
|
161
|
+
|
162
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/23066/59798/','_blank');">
|
163
|
+
|
164
|
+
<td>Bone-A-Fide - Pale</td>
|
165
|
+
|
166
|
+
<td>$5</td>
|
167
|
+
<td>Boneyard</td>
|
168
|
+
<td>BND</td>
|
169
|
+
<td>5.5</td>
|
170
|
+
<td>16oz</td>
|
171
|
+
</tr>
|
172
|
+
|
173
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/23200/159885/','_blank');">
|
174
|
+
|
175
|
+
<td>Breaking Bud - IPA</td>
|
176
|
+
|
177
|
+
<td>$5</td>
|
178
|
+
<td>Knee Deep</td>
|
179
|
+
<td>CA</td>
|
180
|
+
<td>6.5</td>
|
181
|
+
<td>16oz</td>
|
182
|
+
</tr>
|
183
|
+
|
184
|
+
<tr onclick="window.open('http://yearinbeer.tumblr.com/post/765411490/hamms-premium','_blank');">
|
185
|
+
|
186
|
+
<td>Cheap, cold</td>
|
187
|
+
|
188
|
+
<td>$3</td>
|
189
|
+
<td>Hamm's</td>
|
190
|
+
<td>USA</td>
|
191
|
+
<td>4.7</td>
|
192
|
+
<td>16oz</td>
|
193
|
+
</tr>
|
194
|
+
|
195
|
+
<tr onclick="window.open('https://untappd.com/b/two-rivers-cider-company-pomegranate-cider/30498','_blank');">
|
196
|
+
|
197
|
+
<td>Cider- Huckleberry</td>
|
198
|
+
|
199
|
+
<td>$5</td>
|
200
|
+
<td>Two Rivers</td>
|
201
|
+
<td>CA</td>
|
202
|
+
<td>5</td>
|
203
|
+
<td>16oz</td>
|
204
|
+
</tr>
|
205
|
+
|
206
|
+
<tr onclick="window.open('https://untappd.com/b/cider-riot-never-give-an-inch/749700','_blank');">
|
207
|
+
|
208
|
+
<td>Cider- NeverGiveAnInch -Rosé </td>
|
209
|
+
|
210
|
+
<td>$5</td>
|
211
|
+
<td>Cider Riot!</td>
|
212
|
+
<td>PDX</td>
|
213
|
+
<td>6.9</td>
|
214
|
+
<td>16oz</td>
|
215
|
+
</tr>
|
216
|
+
|
217
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/223/50772','_blank');">
|
218
|
+
|
219
|
+
<td>Cuvée des Jacobins Rouge*</td>
|
220
|
+
|
221
|
+
<td>$5</td>
|
222
|
+
<td>Bockor</td>
|
223
|
+
<td>BEL</td>
|
224
|
+
<td>5.5</td>
|
225
|
+
<td>6oz</td>
|
226
|
+
</tr>
|
227
|
+
|
228
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/463/122803/','_blank');">
|
229
|
+
|
230
|
+
<td>Delilah Jones '15 - StrongRye</td>
|
231
|
+
|
232
|
+
<td>$5</td>
|
233
|
+
<td>Magnolia</td>
|
234
|
+
<td>CA</td>
|
235
|
+
<td>10.8</td>
|
236
|
+
<td>6oz</td>
|
237
|
+
</tr>
|
238
|
+
|
239
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/3120/27604','_blank');">
|
240
|
+
|
241
|
+
<td>Duet - IPA</td>
|
242
|
+
|
243
|
+
<td>$5</td>
|
244
|
+
<td>Alpine</td>
|
245
|
+
<td>CA</td>
|
246
|
+
<td>7</td>
|
247
|
+
<td>16oz</td>
|
248
|
+
</tr>
|
249
|
+
|
250
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/192/210034/','_blank');">
|
251
|
+
|
252
|
+
<td>Golden - Herbs,Seeds,Spelt</td>
|
253
|
+
|
254
|
+
<td>$5</td>
|
255
|
+
<td>NewBelg&HofTenDormaal</td>
|
256
|
+
<td>CO</td>
|
257
|
+
<td>7</td>
|
258
|
+
<td>12oz</td>
|
259
|
+
</tr>
|
260
|
+
|
261
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/817/68049','_blank');">
|
262
|
+
|
263
|
+
<td>Grapefruit Radler</td>
|
264
|
+
|
265
|
+
<td>$5</td>
|
266
|
+
<td>Stiegl</td>
|
267
|
+
<td>AUT</td>
|
268
|
+
<td>2.5</td>
|
269
|
+
<td>0.5L</td>
|
270
|
+
</tr>
|
271
|
+
|
272
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/5077/101316','_blank');">
|
273
|
+
|
274
|
+
<td>Handtruck - Pale</td>
|
275
|
+
|
276
|
+
<td>$5</td>
|
277
|
+
<td>Barley Brown's</td>
|
278
|
+
<td>OR</td>
|
279
|
+
<td>5.5</td>
|
280
|
+
<td>16oz</td>
|
281
|
+
</tr>
|
282
|
+
|
283
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/5077/61448/','_blank');">
|
284
|
+
|
285
|
+
<td>Head Shake - IIPA</td>
|
286
|
+
|
287
|
+
<td>$5</td>
|
288
|
+
<td>Barley Brown's</td>
|
289
|
+
<td>OR</td>
|
290
|
+
<td>8.75</td>
|
291
|
+
<td>12oz</td>
|
292
|
+
</tr>
|
293
|
+
|
294
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/23066/72750','_blank');">
|
295
|
+
|
296
|
+
<td>Hop Venom - IIPA</td>
|
297
|
+
|
298
|
+
<td>$5</td>
|
299
|
+
<td>Boneyard</td>
|
300
|
+
<td>BND</td>
|
301
|
+
<td>9</td>
|
302
|
+
<td>12oz</td>
|
303
|
+
</tr>
|
304
|
+
|
305
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/39/133/','_blank');">
|
306
|
+
|
307
|
+
<td>Jahrhundert - Export Lager</td>
|
308
|
+
|
309
|
+
<td>$5</td>
|
310
|
+
<td>Ayinger</td>
|
311
|
+
<td>GER</td>
|
312
|
+
<td>5.5</td>
|
313
|
+
<td>0.5L</td>
|
314
|
+
</tr>
|
315
|
+
|
316
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/463/17590/','_blank');">
|
317
|
+
|
318
|
+
<td>Kalifornia Kolsch</td>
|
319
|
+
|
320
|
+
<td>$5</td>
|
321
|
+
<td>Magnolia</td>
|
322
|
+
<td>CA</td>
|
323
|
+
<td>4.8</td>
|
324
|
+
<td>16oz</td>
|
325
|
+
</tr>
|
326
|
+
|
327
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/252/760','_blank');">
|
328
|
+
|
329
|
+
<td>Kristallweissbier</td>
|
330
|
+
|
331
|
+
<td>$6</td>
|
332
|
+
<td>Weihenstephan</td>
|
333
|
+
<td>GER</td>
|
334
|
+
<td>5.4</td>
|
335
|
+
<td>0.5L</td>
|
336
|
+
</tr>
|
337
|
+
|
338
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/192/26541','_blank');">
|
339
|
+
|
340
|
+
<td>Le Terroir*</td>
|
341
|
+
|
342
|
+
<td>$6</td>
|
343
|
+
<td>New Belgium</td>
|
344
|
+
<td>CO</td>
|
345
|
+
<td>7.5</td>
|
346
|
+
<td>6oz</td>
|
347
|
+
</tr>
|
348
|
+
|
349
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/23200/159480/','_blank');">
|
350
|
+
|
351
|
+
<td>Lupulin River - IPA</td>
|
352
|
+
|
353
|
+
<td>$6</td>
|
354
|
+
<td>Knee Deep</td>
|
355
|
+
<td>CA</td>
|
356
|
+
<td>8</td>
|
357
|
+
<td>16oz</td>
|
358
|
+
</tr>
|
359
|
+
|
360
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/585/2637','_blank');">
|
361
|
+
|
362
|
+
<td>Maisel's Weisse - Hefeweizen </td>
|
363
|
+
|
364
|
+
<td>$5</td>
|
365
|
+
<td>Gebruder Maisel</td>
|
366
|
+
<td>GER</td>
|
367
|
+
<td>5.4</td>
|
368
|
+
<td>0.5L</td>
|
369
|
+
</tr>
|
370
|
+
|
371
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/173/945/','_blank');">
|
372
|
+
|
373
|
+
<td>Nitro- Adam -Drinking Tobacco</td>
|
374
|
+
|
375
|
+
<td>$6</td>
|
376
|
+
<td>Hair of the Dog</td>
|
377
|
+
<td>PDX</td>
|
378
|
+
<td>10</td>
|
379
|
+
<td>12oz</td>
|
380
|
+
</tr>
|
381
|
+
|
382
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/1141/10330','_blank');">
|
383
|
+
|
384
|
+
<td>Nitro- Aphrodisiaque - Stout </td>
|
385
|
+
|
386
|
+
<td>$6</td>
|
387
|
+
<td>Dieu du Ciel!</td>
|
388
|
+
<td>CAN</td>
|
389
|
+
<td>6.5</td>
|
390
|
+
<td>12oz</td>
|
391
|
+
</tr>
|
392
|
+
|
393
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/112/412/','_blank');">
|
394
|
+
|
395
|
+
<td>Nitro- Old Rasputin - RIS</td>
|
396
|
+
|
397
|
+
<td>$4</td>
|
398
|
+
<td>North Coast</td>
|
399
|
+
<td>CA</td>
|
400
|
+
<td>9</td>
|
401
|
+
<td>12oz</td>
|
402
|
+
</tr>
|
403
|
+
|
404
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/112/410/','_blank');">
|
405
|
+
|
406
|
+
<td>Nitro- Red Seal - Red</td>
|
407
|
+
|
408
|
+
<td>$5</td>
|
409
|
+
<td>North Coast</td>
|
410
|
+
<td>CA</td>
|
411
|
+
<td>5.4</td>
|
412
|
+
<td>16oz</td>
|
413
|
+
</tr>
|
414
|
+
|
415
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/130/101458','_blank');">
|
416
|
+
|
417
|
+
<td>Nitro- Shake - Choco Porter</td>
|
418
|
+
|
419
|
+
<td>$8</td>
|
420
|
+
<td>Boulder</td>
|
421
|
+
<td>CO</td>
|
422
|
+
<td>5.9</td>
|
423
|
+
<td>1L</td>
|
424
|
+
</tr>
|
425
|
+
|
426
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/209/754','_blank');">
|
427
|
+
|
428
|
+
<td>Nitro- Stout</td>
|
429
|
+
|
430
|
+
<td>$4</td>
|
431
|
+
<td>Guinness</td>
|
432
|
+
<td>IRL</td>
|
433
|
+
<td>4.1</td>
|
434
|
+
<td>20oz</td>
|
435
|
+
</tr>
|
436
|
+
|
437
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/23066/70013','_blank');">
|
438
|
+
|
439
|
+
<td>Notorious - IIIPA</td>
|
440
|
+
|
441
|
+
<td>$5</td>
|
442
|
+
<td>Boneyard</td>
|
443
|
+
<td>BND</td>
|
444
|
+
<td>11.5</td>
|
445
|
+
<td>6oz</td>
|
446
|
+
</tr>
|
447
|
+
|
448
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/29415/95513/','_blank');">
|
449
|
+
|
450
|
+
<td>Off Leash - NW Session Ale</td>
|
451
|
+
|
452
|
+
<td>$5</td>
|
453
|
+
<td>Crux</td>
|
454
|
+
<td>BND</td>
|
455
|
+
<td>4.5</td>
|
456
|
+
<td>16oz</td>
|
457
|
+
</tr>
|
458
|
+
|
459
|
+
<tr onclick="window.open('http://www.ratebeer.com/beer/rogue-old-crustacean-barleywine/594/','_blank');">
|
460
|
+
|
461
|
+
<td>Old Crustacean '12-Barleywine</td>
|
462
|
+
|
463
|
+
<td>$4</td>
|
464
|
+
<td>Rogue</td>
|
465
|
+
<td>OR</td>
|
466
|
+
<td>11.5</td>
|
467
|
+
<td>6oz</td>
|
468
|
+
</tr>
|
469
|
+
|
470
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/5077/81755','_blank');">
|
471
|
+
|
472
|
+
<td>Pallet Jack - IPA</td>
|
473
|
+
|
474
|
+
<td>$6</td>
|
475
|
+
<td>Barley Brown's</td>
|
476
|
+
<td>OR</td>
|
477
|
+
<td>7</td>
|
478
|
+
<td>16oz</td>
|
479
|
+
</tr>
|
480
|
+
|
481
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/30356/145616/','_blank');">
|
482
|
+
|
483
|
+
<td>Phantasmagoria - IPA</td>
|
484
|
+
|
485
|
+
<td>$5</td>
|
486
|
+
<td>Prairie</td>
|
487
|
+
<td>OK</td>
|
488
|
+
<td>8</td>
|
489
|
+
<td>12oz</td>
|
490
|
+
</tr>
|
491
|
+
|
492
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/2974/799/','_blank');">
|
493
|
+
|
494
|
+
<td>Pilsner</td>
|
495
|
+
|
496
|
+
<td>$5</td>
|
497
|
+
<td>Radeberger</td>
|
498
|
+
<td>GER</td>
|
499
|
+
<td>4.8</td>
|
500
|
+
<td>0.5L</td>
|
501
|
+
</tr>
|
502
|
+
|
503
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/863/7971','_blank');">
|
504
|
+
|
505
|
+
<td>Pliny The Elder</td>
|
506
|
+
|
507
|
+
<td>$8</td>
|
508
|
+
<td>Russian River</td>
|
509
|
+
<td>CA</td>
|
510
|
+
<td>8</td>
|
511
|
+
<td>16oz</td>
|
512
|
+
</tr>
|
513
|
+
|
514
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/30356/148836/','_blank');">
|
515
|
+
|
516
|
+
<td>Prairie-Vous Francais - Saison <div class="btn btn-danger btn-mini"><i class="icon-star icon-white"></i> Just Tapped<i class="icon-star icon-white"></i></div></td>
|
517
|
+
|
518
|
+
<td>$5</td>
|
519
|
+
<td>Prairie</td>
|
520
|
+
<td>OK</td>
|
521
|
+
<td>3.9</td>
|
522
|
+
<td>12oz</td>
|
523
|
+
</tr>
|
524
|
+
|
525
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/463/15217/','_blank');">
|
526
|
+
|
527
|
+
<td>Proving Ground - IPA</td>
|
528
|
+
|
529
|
+
<td>$5</td>
|
530
|
+
<td>Magnolia</td>
|
531
|
+
<td>CA</td>
|
532
|
+
<td>7.2</td>
|
533
|
+
<td>16oz</td>
|
534
|
+
</tr>
|
535
|
+
|
536
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/29415/180807/','_blank');">
|
537
|
+
|
538
|
+
<td>Prowell Springs - Pilsner</td>
|
539
|
+
|
540
|
+
<td>$5</td>
|
541
|
+
<td>Crux</td>
|
542
|
+
<td>BND</td>
|
543
|
+
<td>5.5</td>
|
544
|
+
<td>16oz</td>
|
545
|
+
</tr>
|
546
|
+
|
547
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/637/1717','_blank');">
|
548
|
+
|
549
|
+
<td>Saison</td>
|
550
|
+
|
551
|
+
<td>$6</td>
|
552
|
+
<td>Dupont</td>
|
553
|
+
<td>BEL</td>
|
554
|
+
<td>6.5</td>
|
555
|
+
<td>12oz</td>
|
556
|
+
</tr>
|
557
|
+
|
558
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/463/22214/','_blank');">
|
559
|
+
|
560
|
+
<td>Saison de Lily</td>
|
561
|
+
|
562
|
+
<td>$5</td>
|
563
|
+
<td>Magnolia</td>
|
564
|
+
<td>CA</td>
|
565
|
+
<td>7.3</td>
|
566
|
+
<td>16oz</td>
|
567
|
+
</tr>
|
568
|
+
|
569
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/26850/174328/?ba=StonedTrippin','_blank');">
|
570
|
+
|
571
|
+
<td>Sho' Nuff - Belgian Pale</td>
|
572
|
+
|
573
|
+
<td>$5</td>
|
574
|
+
<td>Against the Grain</td>
|
575
|
+
<td>KY</td>
|
576
|
+
<td>4.9</td>
|
577
|
+
<td>16oz</td>
|
578
|
+
</tr>
|
579
|
+
|
580
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/24299/175395/','_blank');">
|
581
|
+
|
582
|
+
<td>Simple Life - Lacto Saison*</td>
|
583
|
+
|
584
|
+
<td>$5</td>
|
585
|
+
<td>To Øl</td>
|
586
|
+
<td>DEN</td>
|
587
|
+
<td>10</td>
|
588
|
+
<td>6oz</td>
|
589
|
+
</tr>
|
590
|
+
|
591
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/463/17591/','_blank');">
|
592
|
+
|
593
|
+
<td>Stout of Circumstance</td>
|
594
|
+
|
595
|
+
<td>$5</td>
|
596
|
+
<td>Magnolia</td>
|
597
|
+
<td>CA</td>
|
598
|
+
<td>6.1</td>
|
599
|
+
<td>16oz</td>
|
600
|
+
</tr>
|
601
|
+
|
602
|
+
<tr onclick="window.open('http://www.beeradvocate.com/beer/profile/25888/113523/','_blank');">
|
603
|
+
|
604
|
+
<td>Sump - Imp Coffee Stout</td>
|
605
|
+
|
606
|
+
<td>$5</td>
|
607
|
+
<td>Perennial </td>
|
608
|
+
<td>MO</td>
|
609
|
+
<td>10.5</td>
|
610
|
+
<td>6oz</td>
|
611
|
+
</tr>
|
612
|
+
|
613
|
+
<tr onclick="window.open('http://www.atgbrewery.com/Menu/Beer/2/Dark/3/Tex-Arcana/431','_blank');">
|
614
|
+
|
615
|
+
<td>Tex Arcana - Stout</td>
|
616
|
+
|
617
|
+
<td>$5</td>
|
618
|
+
<td>Against the Grain</td>
|
619
|
+
<td>KY</td>
|
620
|
+
<td>6.5</td>
|
621
|
+
<td>12oz</td>
|
622
|
+
</tr>
|
623
|
+
|
624
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/202/656','_blank');">
|
625
|
+
|
626
|
+
<td>Tripel Karmeliet</td>
|
627
|
+
|
628
|
+
<td>$7</td>
|
629
|
+
<td>Bosteels</td>
|
630
|
+
<td>BEL</td>
|
631
|
+
<td>8</td>
|
632
|
+
<td>0.33L</td>
|
633
|
+
</tr>
|
634
|
+
|
635
|
+
<tr onclick="window.open('https://untappd.com/b/gigantic-brewing-company-vivid/1529256/photos','_blank');">
|
636
|
+
|
637
|
+
<td>Vivid - IIPA</td>
|
638
|
+
|
639
|
+
<td>$5</td>
|
640
|
+
<td>Gigantic</td>
|
641
|
+
<td>PDX</td>
|
642
|
+
<td>8.5</td>
|
643
|
+
<td>12oz</td>
|
644
|
+
</tr>
|
645
|
+
|
646
|
+
<tr onclick="window.open('http://beeradvocate.com/beer/profile/5077/53343','_blank');">
|
647
|
+
|
648
|
+
<td>WFO - IPA</td>
|
649
|
+
|
650
|
+
<td>$5</td>
|
651
|
+
<td>Barley Brown's</td>
|
652
|
+
<td>OR</td>
|
653
|
+
<td>7.5</td>
|
654
|
+
<td>16oz</td>
|
655
|
+
</tr>
|
656
|
+
|
657
|
+
</tbody>
|
658
|
+
</table>
|
659
|
+
</div>
|
660
|
+
</div>
|
661
|
+
</div>
|
662
|
+
|
663
|
+
|
664
|
+
</div>
|
665
|
+
</div><!-- /container -->
|
666
|
+
|
667
|
+
<footer>
|
668
|
+
<div id="footer" class="container">
|
669
|
+
<p class="pull-right">© 2012 Apex Bar · All Rights Reserved<br>
|
670
|
+
<!-- <a href="/login?continue=/admin">Login</a></p> -->
|
671
|
+
|
672
|
+
<a href="https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttp://apexbar.com/&ltmpl=gm&shdf=Ch4LEgZhaG5hbWUaEkFwZXggQmFyIEJlZXIgTWVudQwSAmFoIhSC3NC0sX82AlsVtDm3KH3BFt63tigBMhTbqeik6xdNgcwuRV_0PC-q-ffmmQ" style="color: #5A5A5A">Log In</a>
|
673
|
+
|
674
|
+
</p>
|
675
|
+
<!-- footer -->
|
676
|
+
</div><!-- /footer -->
|
677
|
+
</footer>
|
678
|
+
|
679
|
+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
680
|
+
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> -->
|
681
|
+
<!-- <script src="/static/js/lib/jquery-1.8.2.min.js" type="text/javascript" ></script> -->
|
682
|
+
<script src="/static/js/lib/bootstrap-2.2.2.min.js"></script>
|
683
|
+
<script src="/static/js/main.js"></script>
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
|
688
|
+
</body>
|
689
|
+
</html>
|
@@ -0,0 +1,155 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Lita::Handlers::OnewheelBeerApex, lita_handler: true do
|
4
|
+
it { is_expected.to route_command('apex') }
|
5
|
+
it { is_expected.to route_command('apex 4') }
|
6
|
+
it { is_expected.to route_command('apex nitro') }
|
7
|
+
it { is_expected.to route_command('apex CASK') }
|
8
|
+
it { is_expected.to route_command('apex <$4') }
|
9
|
+
it { is_expected.to route_command('apex < $4') }
|
10
|
+
it { is_expected.to route_command('apex <=$4') }
|
11
|
+
it { is_expected.to route_command('apex <= $4') }
|
12
|
+
it { is_expected.to route_command('apex >4%') }
|
13
|
+
it { is_expected.to route_command('apex > 4%') }
|
14
|
+
it { is_expected.to route_command('apex >=4%') }
|
15
|
+
it { is_expected.to route_command('apex >= 4%') }
|
16
|
+
it { is_expected.to route_command('apexabvhigh') }
|
17
|
+
it { is_expected.to route_command('apexabvlow') }
|
18
|
+
|
19
|
+
before do
|
20
|
+
mock = File.open('spec/fixtures/apex.html').read
|
21
|
+
allow(RestClient).to receive(:get) { mock }
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'shows the Apex taps' do
|
25
|
+
send_command 'apex'
|
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
|
+
end
|
28
|
+
|
29
|
+
it 'displays details for tap 4' do
|
30
|
+
send_command 'apex 4'
|
31
|
+
expect(replies.last).to eq('Apex tap 4) Blind Pig - IPA 6.1%, $6')
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'doesn\'t explode on 1' do
|
35
|
+
send_command 'apex 1'
|
36
|
+
expect(replies.count).to eq(1)
|
37
|
+
expect(replies.last).to eq('Apex tap 1) Aktien Helles Lager 5.3%, $5')
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'gets nitro' do
|
41
|
+
send_command 'apex nitro'
|
42
|
+
expect(replies.last).to eq('Apex tap 30) Nitro- Stout 4.1%, $4')
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'searches for ipa' do
|
46
|
+
send_command 'apex ipa'
|
47
|
+
expect(replies.last).to eq('Apex tap 50) WFO - IPA 7.5%, $5')
|
48
|
+
end
|
49
|
+
|
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
|
54
|
+
|
55
|
+
it 'searches for abv >9%' do
|
56
|
+
send_command 'apex >9%'
|
57
|
+
expect(replies.count).to eq(8)
|
58
|
+
expect(replies[0]).to eq('Apex tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
|
59
|
+
expect(replies[1]).to eq('Apex tap 3) Barrel Aged Old Thunderpussy 10.8%, $5')
|
60
|
+
expect(replies.last).to eq('Apex tap 46) Sump - Imp Coffee Stout 10.5%, $5')
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'searches for abv > 9%' do
|
64
|
+
send_command 'apex > 9%'
|
65
|
+
expect(replies.count).to eq(8)
|
66
|
+
expect(replies[0]).to eq('Apex tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
|
67
|
+
expect(replies[1]).to eq('Apex tap 3) Barrel Aged Old Thunderpussy 10.8%, $5')
|
68
|
+
expect(replies.last).to eq('Apex tap 46) Sump - Imp Coffee Stout 10.5%, $5')
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'searches for abv >= 9%' do
|
72
|
+
send_command 'apex >= 9%'
|
73
|
+
expect(replies.count).to eq(10)
|
74
|
+
expect(replies[0]).to eq('Apex tap 2) Armored Fist - Big,Black&Hoppy 10.0%, $5')
|
75
|
+
expect(replies.last).to eq('Apex tap 46) Sump - Imp Coffee Stout 10.5%, $5')
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'searches for abv <4.1%' do
|
79
|
+
send_command 'apex <4.1%'
|
80
|
+
expect(replies.count).to eq(2)
|
81
|
+
expect(replies[0]).to eq('Apex tap 15) Grapefruit Radler 2.5%, $5')
|
82
|
+
expect(replies.last).to eq('Apex tap 38) Prairie-Vous Francais - Saison Just Tapped 3.9%, $5')
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'searches for abv <= 4%' do
|
86
|
+
send_command 'apex <= 4%'
|
87
|
+
expect(replies.count).to eq(2)
|
88
|
+
expect(replies[0]).to eq('Apex tap 15) Grapefruit Radler 2.5%, $5')
|
89
|
+
expect(replies.last).to eq('Apex tap 38) Prairie-Vous Francais - Saison Just Tapped 3.9%, $5')
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'searches for prices >$5' do
|
93
|
+
send_command 'apex >$5'
|
94
|
+
expect(replies.count).to eq(11)
|
95
|
+
expect(replies[0]).to eq('Apex tap 4) Blind Pig - IPA 6.1%, $6')
|
96
|
+
expect(replies[1]).to eq('Apex tap 21) Kristallweissbier 5.4%, $6')
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'searches for prices >=$6' do
|
100
|
+
send_command 'apex >=$6'
|
101
|
+
expect(replies.count).to eq(11)
|
102
|
+
expect(replies[0]).to eq('Apex tap 4) Blind Pig - IPA 6.1%, $6')
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'searches for prices > $6' do
|
106
|
+
send_command 'apex > $6'
|
107
|
+
expect(replies.count).to eq(3)
|
108
|
+
expect(replies[0]).to eq('Apex tap 29) Nitro- Shake - Choco Porter 5.9%, $8')
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'searches for prices <$4.1' do
|
112
|
+
send_command 'apex <$4.1'
|
113
|
+
expect(replies.count).to eq(4)
|
114
|
+
expect(replies[0]).to eq('Apex tap 8) Cheap, cold 4.7%, $3')
|
115
|
+
end
|
116
|
+
|
117
|
+
it 'searches for prices < $4.01' do
|
118
|
+
send_command 'apex < $4.01'
|
119
|
+
expect(replies.count).to eq(4)
|
120
|
+
expect(replies[0]).to eq('Apex tap 8) Cheap, cold 4.7%, $3')
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'searches for prices <= $4.00' do
|
124
|
+
send_command 'apex <= $4.00'
|
125
|
+
expect(replies.count).to eq(4)
|
126
|
+
expect(replies[0]).to eq('Apex tap 8) Cheap, cold 4.7%, $3')
|
127
|
+
end
|
128
|
+
|
129
|
+
it 'runs a random beer through' do
|
130
|
+
send_command 'apex roulette'
|
131
|
+
expect(replies.count).to eq(1)
|
132
|
+
expect(replies.last).to include('Apex tap')
|
133
|
+
end
|
134
|
+
|
135
|
+
it 'runs a random beer through' do
|
136
|
+
send_command 'apex random'
|
137
|
+
expect(replies.count).to eq(1)
|
138
|
+
expect(replies.last).to include('Apex tap')
|
139
|
+
end
|
140
|
+
|
141
|
+
it 'searches with a space' do
|
142
|
+
send_command 'apex cider riot'
|
143
|
+
expect(replies.last).to eq('Apex tap 10) Cider- NeverGiveAnInch -Rosé 6.9%, $5')
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'displays low abv' do
|
147
|
+
send_command 'apexabvhigh'
|
148
|
+
expect(replies.last).to eq('Apex tap 31) Notorious - IIIPA 11.5%, $5')
|
149
|
+
end
|
150
|
+
|
151
|
+
it 'displays high abv' do
|
152
|
+
send_command 'apexabvlow'
|
153
|
+
expect(replies.last).to eq('Apex tap 15) Grapefruit Radler 2.5%, $5')
|
154
|
+
end
|
155
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
SimpleCov.formatters = [
|
4
|
+
SimpleCov::Formatter::HTMLFormatter,
|
5
|
+
Coveralls::SimpleCov::Formatter
|
6
|
+
]
|
7
|
+
SimpleCov.start { add_filter '/spec/' }
|
8
|
+
|
9
|
+
require 'lita-onewheel-beer-apex'
|
10
|
+
require 'lita/rspec'
|
11
|
+
|
12
|
+
# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
|
13
|
+
# was generated with Lita 4, the compatibility mode should be left disabled.
|
14
|
+
Lita.version_3_compatibility_mode = false
|
metadata
ADDED
@@ -0,0 +1,213 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lita-onewheel-beer-apex
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrew Kreps
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: lita
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rest-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.8'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.8'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sanitize
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: lita-onewheel-beer-base
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.3'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.3'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.4'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.4'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rack-test
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.6'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.6'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '3.0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '3.0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.10'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.10'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: coveralls
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.8'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.8'
|
167
|
+
description: Lita interface to Apex Bar's listings.
|
168
|
+
email:
|
169
|
+
- andrew.kreps@gmail.com
|
170
|
+
executables: []
|
171
|
+
extensions: []
|
172
|
+
extra_rdoc_files: []
|
173
|
+
files:
|
174
|
+
- ".gitignore"
|
175
|
+
- ".travis.yml"
|
176
|
+
- Gemfile
|
177
|
+
- README.md
|
178
|
+
- Rakefile
|
179
|
+
- lib/lita-onewheel-beer-apex.rb
|
180
|
+
- lib/lita/handlers/onewheel_beer_apex.rb
|
181
|
+
- lita-onewheel-beer-apex.gemspec
|
182
|
+
- spec/fixtures/apex.html
|
183
|
+
- spec/lita/handlers/onewheel_apex_bar_spec.rb
|
184
|
+
- spec/spec_helper.rb
|
185
|
+
homepage: https://github.com/onewheelskyward/lita-onewheel-beer-apex
|
186
|
+
licenses:
|
187
|
+
- MIT
|
188
|
+
metadata:
|
189
|
+
lita_plugin_type: handler
|
190
|
+
post_install_message:
|
191
|
+
rdoc_options: []
|
192
|
+
require_paths:
|
193
|
+
- lib
|
194
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ">="
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
requirements: []
|
205
|
+
rubyforge_project:
|
206
|
+
rubygems_version: 2.5.1
|
207
|
+
signing_key:
|
208
|
+
specification_version: 4
|
209
|
+
summary: See above.
|
210
|
+
test_files:
|
211
|
+
- spec/fixtures/apex.html
|
212
|
+
- spec/lita/handlers/onewheel_apex_bar_spec.rb
|
213
|
+
- spec/spec_helper.rb
|