bill_hicks 1.2.3 → 1.2.4
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 +4 -4
- 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: d576d59a7255cc36e5c5f191c3008f019447a0a7
|
4
|
+
data.tar.gz: de1ea3509600b34de25bee0d26e3767af9b2d880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27072dfd0a92e2e7ba2653261b3d6a25ec17f1778c594c4e5a45b82cedb8c0e4e9973f702c6687d582b825ddb328a4dfc9534fd294b46c26bfaa9892c37e4986
|
7
|
+
data.tar.gz: b7279e8a9c67fad9d748d20f63e2bea2614470707ae1c27c26d58ad535266a43225a32989b496689c021414bc887e88ae61afad154bfbcb607a915a3dd3b1c25
|
data/lib/bill_hicks/catalog.rb
CHANGED
@@ -67,12 +67,12 @@ module BillHicks
|
|
67
67
|
# @size integer The number of items in each chunk
|
68
68
|
def process_as_chunks(size, &block)
|
69
69
|
connect(@options) do |ftp|
|
70
|
-
|
70
|
+
tempfile = Tempfile.new
|
71
71
|
|
72
72
|
ftp.chdir(BillHicks.config.top_level_dir)
|
73
|
-
ftp.getbinaryfile(CATALOG_FILENAME,
|
73
|
+
ftp.getbinaryfile(CATALOG_FILENAME, tempfile.path)
|
74
74
|
|
75
|
-
SmarterCSV.process(
|
75
|
+
SmarterCSV.process(File.open(tempfile, "r:iso-8859-1"), { chunk_size: size, force_utf8: true, convert_values_to_numeric: false }) do |chunk|
|
76
76
|
chunk.each do |item|
|
77
77
|
item[:brand_name] = BillHicks::BrandConverter.convert(item[:product_name])
|
78
78
|
end
|
@@ -80,7 +80,7 @@ module BillHicks
|
|
80
80
|
yield(chunk)
|
81
81
|
end
|
82
82
|
|
83
|
-
|
83
|
+
tempfile.unlink
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
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.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: smarter_csv
|