bill_hicks 1.3.6 → 1.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bill_hicks/catalog.rb +8 -1
- data/lib/bill_hicks/inventory.rb +10 -7
- data/lib/bill_hicks/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: a091c0d938afc4530512ed36c48075e64cbccc70
|
4
|
+
data.tar.gz: 2555b2a398bce03ccf50abb9d31caa0c42284437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a128ddc72c467f22ba103de7b9effc08273fbaa4380528471bdd69a0e2392c43af25554333779908920719ce252342b09020efa765d6b2a24c92171ee435202f
|
7
|
+
data.tar.gz: 88437c3a67446b7f63555e54515260511d971ebd2361f9cea6f9dee4757ce277e7487ff5c99d6e8e762f15a99822139f2a85e2498bcef3a209372d39f14d26a2
|
data/lib/bill_hicks/catalog.rb
CHANGED
@@ -72,7 +72,14 @@ module BillHicks
|
|
72
72
|
ftp.chdir(BillHicks.config.top_level_dir)
|
73
73
|
ftp.getbinaryfile(CATALOG_FILENAME, tempfile.path)
|
74
74
|
|
75
|
-
|
75
|
+
smart_options = {
|
76
|
+
chunk_size: size,
|
77
|
+
key_mapping: { universal_product_code: :upc },
|
78
|
+
force_utf8: true,
|
79
|
+
convert_values_to_numeric: false
|
80
|
+
}
|
81
|
+
|
82
|
+
SmarterCSV.process(File.open(tempfile, "r:iso-8859-1"), smart_options) do |chunk|
|
76
83
|
yield(chunk)
|
77
84
|
end
|
78
85
|
|
data/lib/bill_hicks/inventory.rb
CHANGED
@@ -52,20 +52,23 @@ module BillHicks
|
|
52
52
|
# @size integer The number of items in each chunk
|
53
53
|
def process_as_chunks(size, &block)
|
54
54
|
connect(@options) do |ftp|
|
55
|
-
|
55
|
+
tempfile = Tempfile.new
|
56
56
|
|
57
57
|
ftp.chdir(BillHicks.config.top_level_dir)
|
58
|
-
ftp.getbinaryfile(INVENTORY_FILENAME,
|
58
|
+
ftp.getbinaryfile(INVENTORY_FILENAME, tempfile.path)
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
smart_options = {
|
61
|
+
chunk_size: size,
|
62
|
+
key_mapping: { qty_avail: :quantity },
|
63
|
+
force_utf8: true,
|
64
|
+
convert_values_to_numeric: false
|
65
|
+
}
|
64
66
|
|
67
|
+
SmarterCSV.process(tempfile, smart_options) do |chunk|
|
65
68
|
yield(chunk)
|
66
69
|
end
|
67
70
|
|
68
|
-
|
71
|
+
tempfile.unlink
|
69
72
|
end
|
70
73
|
end
|
71
74
|
|
data/lib/bill_hicks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bill_hicks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: smarter_csv
|