sports_south 2.0.11 → 2.0.12
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 +37 -6
- 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: 76d7f8239e1969c1af0587fba3b4904fdba5a295
|
4
|
+
data.tar.gz: f28d2e33c094237e727349cc0ced16d13088f5ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc5801c07e57a770201ffb5f4c5f82e6ce9fca6ebe18e98807aa43cbe492ea14c6398f95366900363b8a190458933656a69a47f7c144ab347fb3ce29378e0a8
|
7
|
+
data.tar.gz: 4adc2d27a3fa6e1063896b9af48f57697a4b4d6a7c132a39ea694893f63a1e5e3d32180d5154d39318a16baa8d24480ab7941abe185ecb19ddd0d433e14766a4
|
data/lib/sports_south/catalog.rb
CHANGED
@@ -95,7 +95,13 @@ module SportsSouth
|
|
95
95
|
def map_hash(node, full_product = false)
|
96
96
|
category = @categories.find { |category| category[:category_id] == content_for(node, 'CATID') }
|
97
97
|
brand = @brands.find { |brand| brand[:brand_id] == content_for(node, 'ITBRDNO') }
|
98
|
-
|
98
|
+
features = self.map_features(category.except(:category_id, :department_id, :department_description, :description), node)
|
99
|
+
|
100
|
+
if features[:caliber].present?
|
101
|
+
caliber = features[:caliber]
|
102
|
+
elsif features[:gauge].present?
|
103
|
+
caliber = features[:gauge]
|
104
|
+
end
|
99
105
|
|
100
106
|
if full_product
|
101
107
|
long_description = self.get_description(content_for(node, 'ITEMNO'))
|
@@ -118,12 +124,37 @@ module SportsSouth
|
|
118
124
|
caliber: caliber,
|
119
125
|
map_price: content_for(node, 'MFPRC'),
|
120
126
|
brand: brand.present? ? brand[:name] : nil,
|
121
|
-
features:
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
127
|
+
features: features
|
128
|
+
}
|
129
|
+
end
|
130
|
+
|
131
|
+
def map_features(attributes, node)
|
132
|
+
features = {
|
133
|
+
attributes[:attribute_1] => content_for(node, 'ITATR1'),
|
134
|
+
attributes[:attribute_2] => content_for(node, 'ITATR2'),
|
135
|
+
attributes[:attribute_3] => content_for(node, 'ITATR3'),
|
136
|
+
attributes[:attribute_4] => content_for(node, 'ITATR4'),
|
137
|
+
attributes[:attribute_5] => content_for(node, 'ITATR5'),
|
138
|
+
attributes[:attribute_6] => content_for(node, 'ITATR6'),
|
139
|
+
attributes[:attribute_7] => content_for(node, 'ITATR7'),
|
140
|
+
attributes[:attribute_8] => content_for(node, 'ITATR8'),
|
141
|
+
attributes[:attribute_9] => content_for(node, 'ITATR9'),
|
142
|
+
attributes[:attribute_10] => content_for(node, 'ITATR10'),
|
143
|
+
attributes[:attribute_11] => content_for(node, 'ITATR11'),
|
144
|
+
attributes[:attribute_12] => content_for(node, 'ITATR12'),
|
145
|
+
attributes[:attribute_13] => content_for(node, 'ITATR13'),
|
146
|
+
attributes[:attribute_14] => content_for(node, 'ITATR14'),
|
147
|
+
attributes[:attribute_15] => content_for(node, 'ITATR15'),
|
148
|
+
attributes[:attribute_16] => content_for(node, 'ITATR16'),
|
149
|
+
attributes[:attribute_17] => content_for(node, 'ITATR17'),
|
150
|
+
attributes[:attribute_18] => content_for(node, 'ITATR18'),
|
151
|
+
attributes[:attribute_19] => content_for(node, 'ITATR19'),
|
152
|
+
attributes[:attribute_20] => content_for(node, 'ITATR20')
|
126
153
|
}
|
154
|
+
|
155
|
+
features.delete_if { |k, v| v.to_s.blank? }
|
156
|
+
features.transform_keys! { |k| k.gsub(/\s+/, '_').downcase }
|
157
|
+
features.symbolize_keys!
|
127
158
|
end
|
128
159
|
|
129
160
|
end
|
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|