lcbo 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,11 @@
1
+ Version 0.9.2
2
+
3
+ * Fixed potential bug in some versions of Ruby where Object#send semantics cause a failure when calling private or protected methods.
4
+
1
5
  Version 0.9.1
2
6
 
3
- * Removed dependency on Addressable.
4
- * Refactored tests to use MiniTest::Spec instead of RSpec, removing another dependency.
7
+ * Removed dependency on Addressable.
8
+ * Refactored tests to use MiniTest::Spec instead of RSpec, removing another dependency.
5
9
 
6
10
  Version 0.9.0
7
11
 
@@ -16,17 +16,11 @@ module LCBO
16
16
  'Nov' => '11',
17
17
  'Dec' => '12' }
18
18
 
19
- attr_reader :input
20
-
21
- def initialize(input_string)
22
- @input = input_string
23
- end
24
-
25
- def self.[](input_string)
26
- new(input_string).as_sql_date
19
+ def self.[](input)
20
+ sql_date(input)
27
21
  end
28
22
 
29
- def as_sql_date
23
+ def self.sql_date(input)
30
24
  return nil unless input
31
25
  parts = input.gsub(',', '').split
32
26
  month = MONTH_NAMES_TO_NUMBERS[parts[0]]
@@ -27,9 +27,7 @@ module LCBO
27
27
  end
28
28
  h[:store_no] = begin
29
29
  node.
30
- css('td[width="38%"] a.item-details-col2').
31
- attribute('href').
32
- value.
30
+ to_s.
33
31
  match(/\?STORE=([0-9]{1,3})\&/).
34
32
  captures[0].
35
33
  to_s.
@@ -46,8 +44,6 @@ module LCBO
46
44
  end
47
45
  end
48
46
 
49
- private
50
-
51
47
  def inventory_table
52
48
  doc.css('table[cellpadding="3"]')
53
49
  end
@@ -75,8 +75,6 @@ module LCBO
75
75
  end
76
76
  alias_method :as_array, :product_nos
77
77
 
78
- protected
79
-
80
78
  def product_anchors
81
79
  doc.css('td[style="padding: 5 5 5 0;"] a.item-details-col2')
82
80
  end
@@ -200,8 +200,6 @@ module LCBO
200
200
  end
201
201
  end
202
202
 
203
- private
204
-
205
203
  def volume_helper
206
204
  @volume_helper ||= CrawlKit::VolumeHelper.new(package)
207
205
  end
@@ -103,8 +103,6 @@ module LCBO
103
103
  emits(field) { details[field] }
104
104
  end
105
105
 
106
- protected
107
-
108
106
  def detail_rows
109
107
  @detail_rows ||= begin
110
108
  doc.css('input[type="checkbox"]').map { |e| e.parent.parent.inner_html }
@@ -1,3 +1,3 @@
1
1
  module LCBO
2
- VERSION = '0.9.1'
2
+ VERSION = '0.9.2'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 1
9
- version: 0.9.1
8
+ - 2
9
+ version: 0.9.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Carsten Nielsen