davidsons 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/davidsons/inventory.rb +13 -7
- data/lib/davidsons/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: 19e23304e1aaa80a1a477972bab1113d2cb9c442
|
4
|
+
data.tar.gz: ded35d0426e562130b3d23396256a673e5ea94bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4435834e31c4bf5c0174e62d896c4cb747a93acfca1d18f7085481775c604fffcd43c119d5443651911391f7e2ee1b56560a830577ad1a5e070742bafdc4071
|
7
|
+
data.tar.gz: a011ec589fc7f04ebbe8aa24e4bc528ebd6e797844a37fed2d947f0f0ac83b687bbc8177c5759b6de7af0fbf817e1317c68d32f9ba668f0381fb266c2e1d2a04
|
data/lib/davidsons/inventory.rb
CHANGED
@@ -50,9 +50,9 @@ module Davidsons
|
|
50
50
|
# @option options [Symbol] :pricing_tier *optional*
|
51
51
|
# * Denotes which price to use
|
52
52
|
# * Can be :regular or :minimum
|
53
|
-
def self.all(options = {}
|
53
|
+
def self.all(options = {})
|
54
54
|
requires!(options, :username, :password)
|
55
|
-
new(options).all
|
55
|
+
new(options).all
|
56
56
|
end
|
57
57
|
|
58
58
|
# Iterates over all items in the 'davidsons_quantity.csv' file yielding the item_identifier, upc, quantity and locations.
|
@@ -60,12 +60,13 @@ module Davidsons
|
|
60
60
|
# @param [Hash] options
|
61
61
|
# @option options [Symbol] :username *required*
|
62
62
|
# @option options [Symbol] :password *required*
|
63
|
-
def self.quantity(options = {}
|
63
|
+
def self.quantity(options = {})
|
64
64
|
requires!(options, :username, :password)
|
65
|
-
new(options).quantity
|
65
|
+
new(options).quantity
|
66
66
|
end
|
67
67
|
|
68
68
|
def all
|
69
|
+
items = []
|
69
70
|
tempfile = get_file(WHOLE_CATALOG_FILENAME)
|
70
71
|
|
71
72
|
SmarterCSV.process(tempfile, DEFAULT_WHOLE_CATALOG_SMART_OPTS) do |chunk|
|
@@ -75,12 +76,15 @@ module Davidsons
|
|
75
76
|
item[:price] = lowest_price(item)
|
76
77
|
item[:quantity] = item[:quantity].to_i
|
77
78
|
|
78
|
-
|
79
|
+
items << item
|
79
80
|
end
|
80
81
|
end
|
82
|
+
|
83
|
+
items
|
81
84
|
end
|
82
85
|
|
83
|
-
def quantity
|
86
|
+
def quantity
|
87
|
+
items = []
|
84
88
|
tempfile = get_file(QUANTITY_FILENAME)
|
85
89
|
|
86
90
|
SmarterCSV.process(tempfile, DEFAULT_QUANTITY_SMART_OPTS) do |chunk|
|
@@ -88,9 +92,11 @@ module Davidsons
|
|
88
92
|
item[:quantity] = item[:quantity_nc].to_i + item[:quantity_az].to_i
|
89
93
|
item[:locations] = map_location_quantities(item)
|
90
94
|
|
91
|
-
|
95
|
+
items << item
|
92
96
|
end
|
93
97
|
end
|
98
|
+
|
99
|
+
items
|
94
100
|
end
|
95
101
|
|
96
102
|
private
|
data/lib/davidsons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: davidsons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Knight
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|