zanders 5.0.4 → 5.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zanders/catalog.rb +7 -1
- data/lib/zanders/order.rb +8 -1
- data/lib/zanders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c226b165a425dac8ee88fc6a8f6abc4670e405628c5c4f43f488cde7374daffc
|
4
|
+
data.tar.gz: 319c0d000c94dd32e5949b2c922d955a2b6dfda17fb9d614a42c9d219142d03e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03ffd7dfc8ebaad8a0eac879a66a94e06d6c7b17957caaa536323c9049a6eb9b038e283d95ead2529f0aba7f82c41063e11323218e96c684abf4f8e0df5a6c45
|
7
|
+
data.tar.gz: a6482867c79930bd286c245ac0b786b2f723d95593bf63b2db2883e2552076be1691fbbf9a248f24b569f47c38bf9e8d0b6ca50a69e1bef45b116906f781d946
|
data/lib/zanders/catalog.rb
CHANGED
@@ -39,13 +39,14 @@ module Zanders
|
|
39
39
|
|
40
40
|
def map_hash(node)
|
41
41
|
features = map_features(node)
|
42
|
+
sale_dates = [content_for(node, 'ITEMSALESTART'), content_for(node, 'ITEMSALEEND')]
|
42
43
|
|
43
44
|
{
|
44
45
|
name: content_for(node, 'ITEMDESCRIPTION'),
|
45
46
|
upc: content_for(node, 'ITEMUPC'),
|
46
47
|
item_identifier: content_for(node, 'ITEMNO'),
|
47
48
|
quantity: content_for(node, 'ITEMQTYAVAIL'),
|
48
|
-
price: content_for(node, 'ITEMPRICE'),
|
49
|
+
price: active_sale?(sale_dates) ? content_for(node, 'ITEMSALEPRICE') : content_for(node, 'ITEMPRICE'),
|
49
50
|
short_description: content_for(node, 'ITEMDESCRIPTION'),
|
50
51
|
category: content_for(node, 'ITEMCATEGORYNAME'),
|
51
52
|
mfg_number: content_for(node, 'ITEMMPN'),
|
@@ -70,5 +71,10 @@ module Zanders
|
|
70
71
|
features.symbolize_keys!
|
71
72
|
end
|
72
73
|
|
74
|
+
def active_sale?(sale_dates)
|
75
|
+
return false if !sale_dates.all?(&:present?)
|
76
|
+
|
77
|
+
Date.today.between?(Date.parse(sale_dates.first), Date.parse(sale_dates.second))
|
78
|
+
end
|
73
79
|
end
|
74
80
|
end
|
data/lib/zanders/order.rb
CHANGED
@@ -64,7 +64,14 @@ module Zanders
|
|
64
64
|
])
|
65
65
|
end
|
66
66
|
|
67
|
-
shipping_code =
|
67
|
+
shipping_code = case @options[:account]
|
68
|
+
when :accessory
|
69
|
+
'UM'
|
70
|
+
when :firearm
|
71
|
+
'UG'
|
72
|
+
when :default
|
73
|
+
'BW'
|
74
|
+
end
|
68
75
|
|
69
76
|
shipping_information.push(*[
|
70
77
|
{ key: 'shipDate', value: Time.now.strftime("%Y-%m-%d") },
|
data/lib/zanders/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zanders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Knight
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|