huginn_bigcommerce_product_agent 1.6.0 → 1.7.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce068992ff7f5e99b7f7656d246d104b60bc1a12c836c84d3c0156e0fadc9c67
|
4
|
+
data.tar.gz: eadfb8e593e0e44a806f6cbcffbbe8f0b6d364f73215ffd2565c91be80c6b885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b8cbc08bc80f5cf0e811fa61874545ce54cb2ee4af113cc3f43fc102959690b32d8e7ce8ec027e29d836c60db78d4d7c50aca414ca24149f66dae1756879032
|
7
|
+
data.tar.gz: a1ee6941129e2df489daa52077f5bd9daa57943ebc6328880a8cbf7b8747a3c59ebdd16634f9ed8398f48e2490ffee278c0360d472b8989c45c6fa629d27da52
|
@@ -29,7 +29,8 @@ module Agents
|
|
29
29
|
'meta_fields_map' => {},
|
30
30
|
'meta_fields_namespace' => '',
|
31
31
|
'mode' => modes[0],
|
32
|
-
'not_purchasable_format_list' => []
|
32
|
+
'not_purchasable_format_list' => [],
|
33
|
+
'should_disambiguate' => false
|
33
34
|
}
|
34
35
|
end
|
35
36
|
|
@@ -67,6 +68,11 @@ module Agents
|
|
67
68
|
if options['not_purchasable_format_list'].present? && !options['not_purchasable_format_list'].is_a?(Array)
|
68
69
|
errors.add(:base, 'not_purchasable_format_list must be an Array')
|
69
70
|
end
|
71
|
+
|
72
|
+
if options.has_key?('should_disambiguate') && boolify(options['should_disambiguate']).nil?
|
73
|
+
errors.add(:base, 'when provided, `should_disambiguate` must be either true or false')
|
74
|
+
end
|
75
|
+
|
70
76
|
end
|
71
77
|
|
72
78
|
def working?
|
@@ -143,6 +149,16 @@ module Agents
|
|
143
149
|
product['name'] = "#{product['name']} (Digital)"
|
144
150
|
end
|
145
151
|
|
152
|
+
# Ignatius Press -- some products have the same name and must be disambiguated.
|
153
|
+
# ...by adding a list of the product types (hardback, paperback, etc.) to their names
|
154
|
+
if boolify(options['should_disambiguate'])
|
155
|
+
product['name'] += " |~ " + product['model'].map { |m|
|
156
|
+
m['additionalProperty'].find { |p|
|
157
|
+
p['propertyID'] == 'option'
|
158
|
+
}['value']
|
159
|
+
}.join(", ")
|
160
|
+
end
|
161
|
+
|
146
162
|
wrapper_sku = wrapper_skus[type]
|
147
163
|
bc_product = bc_products[wrapper_sku]
|
148
164
|
variant_option_name = get_mapper(:OptionMapper).variant_option_name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huginn_bigcommerce_product_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Spizziri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|