lita-onewheel-beer-base 1.2.4 → 2.0.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: 34d9a1cd785cecc33fa386632fb0213198c956a5
4
- data.tar.gz: 1088330e8700aa8d191f7625de3f1d25930a5f4f
3
+ metadata.gz: 37425648bc99eff65833da82b0430d4f95ccf26c
4
+ data.tar.gz: b9a816aec27b360da98174ce8caa998ab9978629
5
5
  SHA512:
6
- metadata.gz: ecd540bf6134f6490d14246972e3b2020b0e4040af234c4e9604cf12c6c9dcbd45a84a954630d441b97eeebbe051752ec9915fddfc1f46bcbe87ce8d6d0a5799
7
- data.tar.gz: b9b44aa2f5c214f2e00233e407c0057cc4e4ae54fcb727866b7ee9a1a049fa28f2d11c1456135a48df767562a74e15cace425745b1b0e9a01c0d0eb50ffd12c0
6
+ metadata.gz: 030c3ffc69f9c8b463220883a8c763c754e9bcc98820e3f1203f4332bbd2a00b658ab7e7be818002c871e42ec517288d5c97d1e2e57005322f43cb59e3270d7a
7
+ data.tar.gz: 472a3a1d5fd6f3b50dcdc297a45290439708bc28696319f104eeb9de9d0b0a2019aa64cddac0ff4ba7ce9f38dbe38e4e5373c6b5863c9ffd41021cc94b0a32c0
@@ -5,11 +5,12 @@ require 'sanitize'
5
5
  module Lita
6
6
  module Handlers
7
7
  class OnewheelBeerBase < Handler
8
+ attr_accessor :bar_name
8
9
 
9
10
  def taps_list(response)
10
11
  # wakka wakka
11
12
  beers = self.get_source
12
- reply = "taps: "
13
+ reply = '#{@bar_name} taps: '
13
14
  beers.each do |tap, datum|
14
15
  reply += "#{tap}) "
15
16
  reply += get_tap_type_text(datum[:type])
@@ -27,7 +28,7 @@ module Lita
27
28
  end
28
29
 
29
30
  def taps_deets(response)
30
- Lita.logger.debug "taps_deets started"
31
+ Lita.logger.debug 'taps_deets started'
31
32
  beers = get_source
32
33
  beers.each do |tap, datum|
33
34
  query = response.matches[0][0].strip
@@ -78,16 +79,16 @@ module Lita
78
79
  if (price_matches = query.match(/([><=]+)\s*\$(\d+\.*\d*)/))
79
80
  direction = price_matches.to_s.match(/[<>=]+/).to_s
80
81
  price_requested = price_matches.to_s.match(/\d+.*\d*/).to_s
81
- if direction == '>' and datum[:prices][1][:cost].to_f > price_requested.to_f
82
+ if direction == '>' and datum[:price].to_f > price_requested.to_f
82
83
  send_response(tap, datum, response)
83
84
  end
84
- if direction == '<' and datum[:prices][1][:cost].to_f < price_requested.to_f
85
+ if direction == '<' and datum[:price].to_f < price_requested.to_f
85
86
  send_response(tap, datum, response)
86
87
  end
87
- if direction == '>=' and datum[:prices][1][:cost].to_f >= price_requested.to_f
88
+ if direction == '>=' and datum[:price].to_f >= price_requested.to_f
88
89
  send_response(tap, datum, response)
89
90
  end
90
- if direction == '<=' and datum[:prices][1][:cost].to_f <= price_requested.to_f
91
+ if direction == '<=' and datum[:price].to_f <= price_requested.to_f
91
92
  send_response(tap, datum, response)
92
93
  end
93
94
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-beer-base'
3
- spec.version = '1.2.4'
3
+ spec.version = '2.0.0'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita base class for beer searches.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-beer-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps