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 +4 -4
- data/lib/sports_south/catalog.rb +14 -10
- data/lib/sports_south/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01e0276217fcd30fd882e40d461e563640eea4ed
|
4
|
+
data.tar.gz: 3fb5a64481e092901a1eff3b8ab5c86e5d1d1292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1815104a181321ba3b15131dc946b37a0e3a8353e78a77dfa6bcfe8043afa513a3b5c2562de560b726e3d16f2fc7b9b56c77b2ee61479a0514e2b00cf712593a
|
7
|
+
data.tar.gz: 4172ee52b470b36d0976871c6f7fa64775b7a7763b6c40a088212e358c27348a27ec5b803881c3bf5991d7cfbb8febafa31d5ac0a5955eda51fb0d63d5fe23f7
|
data/lib/sports_south/catalog.rb
CHANGED
@@ -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
|
63
|
-
xml_doc
|
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
|
88
|
-
xml_doc
|
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
|
97
|
-
brand
|
98
|
-
features
|
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
|
|
data/lib/sports_south/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|