sports_south 2.0.22 → 2.0.23

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: 24224e8811abc6e53b5c768ff5060d23fc909244
4
- data.tar.gz: 915e75bae112af3001ff4c2e208a015f3d21b500
3
+ metadata.gz: 01e0276217fcd30fd882e40d461e563640eea4ed
4
+ data.tar.gz: 3fb5a64481e092901a1eff3b8ab5c86e5d1d1292
5
5
  SHA512:
6
- metadata.gz: bc9970620237510f7494b24c0a5a5be0d136c9839d0bafc81690a31504094890dd5b3400135a93345c376ce70ae23cafc6ff469f93a0bb022d6401b052a5400e
7
- data.tar.gz: a85313d2b025ef5e4e8eeeb337ea0f486f24dd487528f7136551a6adf4cbcb733e2ffe993ad37d7ac9839700c9dbc004a216bd478e26573dfa868c0228550598
6
+ metadata.gz: 1815104a181321ba3b15131dc946b37a0e3a8353e78a77dfa6bcfe8043afa513a3b5c2562de560b726e3d16f2fc7b9b56c77b2ee61479a0514e2b00cf712593a
7
+ data.tar.gz: 4172ee52b470b36d0976871c6f7fa64775b7a7763b6c40a088212e358c27348a27ec5b803881c3bf5991d7cfbb8febafa31d5ac0a5955eda51fb0d63d5fe23f7
@@ -22,6 +22,11 @@ module SportsSouth
22
22
  '8' => :suppressor,
23
23
  }
24
24
 
25
+ UNITS_OF_MEASURE = {
26
+ 'BX' => :box,
27
+ 'CS' => :case
28
+ }
29
+
25
30
  def initialize(options = {})
26
31
  requires!(options, :username, :password)
27
32
 
@@ -59,8 +64,8 @@ module SportsSouth
59
64
  LastItem: @options[:last_item].to_s
60
65
  }))
61
66
 
62
- response = http.request(request)
63
- xml_doc = Nokogiri::XML(sanitize_response(response))
67
+ response = http.request(request)
68
+ xml_doc = Nokogiri::XML(sanitize_response(response))
64
69
 
65
70
  xml_doc.css('Table').map do |item|
66
71
  if chunker.is_full?
@@ -84,8 +89,8 @@ module SportsSouth
84
89
  ItemNumber: item_number
85
90
  }))
86
91
 
87
- response = http.request(request)
88
- xml_doc = Nokogiri::XML(sanitize_response(response))
92
+ response = http.request(request)
93
+ xml_doc = Nokogiri::XML(sanitize_response(response))
89
94
 
90
95
  content_for(xml_doc, 'CATALOGTEXT')
91
96
  end
@@ -93,9 +98,9 @@ module SportsSouth
93
98
  protected
94
99
 
95
100
  def map_hash(node, full_product = false)
96
- category = @categories.find { |category| category[:category_id] == content_for(node, 'CATID') }
97
- brand = @brands.find { |brand| brand[:brand_id] == content_for(node, 'ITBRDNO') }
98
- features = self.map_features(category.except(:category_id, :department_id, :department_description, :description), node)
101
+ category = @categories.find { |category| category[:category_id] == content_for(node, 'CATID') }
102
+ brand = @brands.find { |brand| brand[:brand_id] == content_for(node, 'ITBRDNO') }
103
+ features = self.map_features(category.except(:category_id, :department_id, :department_description, :description), node)
99
104
 
100
105
  model = content_for(node, 'IMODEL')
101
106
  series = content_for(node, 'SERIES')
@@ -113,8 +118,6 @@ module SportsSouth
113
118
 
114
119
  if full_product
115
120
  long_description = self.get_description(content_for(node, 'ITEMNO'))
116
- else
117
- nil
118
121
  end
119
122
 
120
123
  if features.respond_to?(:[]=)
@@ -138,7 +141,8 @@ module SportsSouth
138
141
  action: action,
139
142
  map_price: content_for(node, 'MFPRC'),
140
143
  brand: brand.present? ? brand[:name] : nil,
141
- features: features
144
+ features: features,
145
+ unit_of_measure: UNITS_OF_MEASURE.fetch(content_for(node, 'UOM'), nil)
142
146
  }
143
147
  end
144
148
 
@@ -1,3 +1,3 @@
1
1
  module SportsSouth
2
- VERSION = '2.0.22'.freeze
2
+ VERSION = '2.0.23'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sports_south
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.22
4
+ version: 2.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-05 00:00:00.000000000 Z
11
+ date: 2018-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri