davidsons 1.0.3 → 1.0.4
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/catalog.rb +3 -1
- data/lib/davidsons/inventory.rb +3 -5
- data/lib/davidsons/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: 914036ba6b5750a904124c069afd486e1ff4d38ff0a29328d93f012f8d3f0068
|
4
|
+
data.tar.gz: 5c57655ba02a193e651319d14cb4f0da7e3898dfff958c900218a3a400aea3f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe533e923bc65689cd552207e4a1dcbd8e7217001d7bacddfbe5b619ca84639ef5b257d66aead601d1c04ae83b6084c14c91d0f5a15e40161c81c914c52e3aa
|
7
|
+
data.tar.gz: a67c8daafc227e823331cc91f2cb32c76226b63f8c5481b6101c98c56abc184fa5fe43764460c65baafa35fcf08fb880d60ef9b689a4dd4cbbe931bc8a326c22
|
data/lib/davidsons/catalog.rb
CHANGED
@@ -18,6 +18,8 @@ module Davidsons
|
|
18
18
|
def all(&block)
|
19
19
|
tempfile = get_file(CATALOG_FILENAME)
|
20
20
|
|
21
|
+
# TODO: account for Sale Price and MSP (minimum price)
|
22
|
+
|
21
23
|
SmarterCSV.process(tempfile.open, {
|
22
24
|
chunk_size: CHUNK_SIZE,
|
23
25
|
convert_values_to_numeric: false,
|
@@ -27,7 +29,7 @@ module Davidsons
|
|
27
29
|
item_description: :name,
|
28
30
|
upc_code: :upc,
|
29
31
|
manufacturer: :brand,
|
30
|
-
|
32
|
+
retail_price: :msrp,
|
31
33
|
dealer_price: :price,
|
32
34
|
gun_type: :category,
|
33
35
|
}
|
data/lib/davidsons/inventory.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Davidsons
|
2
2
|
class Inventory < Base
|
3
3
|
|
4
|
-
INVENTORY_FILENAME
|
5
|
-
CHUNK_SIZE
|
4
|
+
INVENTORY_FILENAME = "davidsons_quantity.csv"
|
5
|
+
CHUNK_SIZE = 100
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
8
|
requires!(options, :username, :password)
|
@@ -32,9 +32,7 @@ module Davidsons
|
|
32
32
|
chunk_size: CHUNK_SIZE,
|
33
33
|
convert_values_to_numeric: false,
|
34
34
|
force_utf8: true,
|
35
|
-
key_mapping: {
|
36
|
-
item_number: :item_identifier
|
37
|
-
}
|
35
|
+
key_mapping: { item_number: :item_identifier }
|
38
36
|
}) do |chunk|
|
39
37
|
chunk.each do |item|
|
40
38
|
item.except!(:upc_code)
|
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: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Knight
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|