zanders 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6037b899555cc707c776a26e623ca358e7221a1c
4
- data.tar.gz: cf33b12e8590c06cf3241e67d79168469c468c16
3
+ metadata.gz: 3139ecab3c7429ca4afaeb28c00e5f608555e3c6
4
+ data.tar.gz: c96d4aad0538f75b79e4b2d261e58a254aa1a2aa
5
5
  SHA512:
6
- metadata.gz: 984578ff35188d78c2d362a2c5ed4d95ed642329e9c52742afc567f962c7c24ac14535045ec80f8a92d2386f67729c41e3b8b79161ddce9446eba2dd39c32e78
7
- data.tar.gz: 1b0a3adcfe5670a683f58ddb29144b2daec73f6f4720b2cbc1894d805459edc6634162ad0155ce6647dfe7e88aed3b039281dd129bd978c5963cb6302429eb49
6
+ metadata.gz: 074f61383672575141914e646d74e7f2dd6156702cd04115588f1674c8a8bab7bdab353ad55048348ba26612b9952f840bd3dc37df132aae3cfb4ccc4ee47b2e
7
+ data.tar.gz: 5e2bf00580a3e265b832c12b608829a0af014f1b0bbc2466807f327ea5d6c1f72079db03a2d2b908fd37257aa960282e4563396f2d701dfa1668ca332d1bffe5
@@ -3,13 +3,23 @@ module Zanders
3
3
 
4
4
  INVENTORY_FILENAME = "liveinv.csv"
5
5
 
6
+ DEFAULT_SMART_OPTS = {
7
+ convert_values_to_numeric: false,
8
+ key_mapping: {
9
+ available: :quantity,
10
+ itemnumber: :item_identifier,
11
+ price1: :price
12
+ },
13
+ remove_unmapped_keys: true
14
+ }
15
+
6
16
  def initialize(options = {})
7
17
  requires!(options, :username, :password)
8
18
 
9
19
  @options = options
10
20
  end
11
21
 
12
- def self.all(chunk_size = 15, options = {}, &block)
22
+ def self.all(chunk_size = 100, options = {}, &block)
13
23
  requires!(options, :username, :password)
14
24
  new(options).all(chunk_size, &block)
15
25
  end
@@ -22,19 +32,9 @@ module Zanders
22
32
  ftp.chdir(Zanders.config.ftp_directory)
23
33
  ftp.getbinaryfile(INVENTORY_FILENAME, csv_tempfile.path)
24
34
 
25
- SmarterCSV.process(csv_tempfile, {
26
- chunk_size: chunk_size,
27
- convert_values_to_numeric: false,
28
- key_mapping: {
29
- available: :quantity,
30
- itemnumber: :item_identifier,
31
- price1: :price
32
- }
33
- }) do |chunk|
34
- chunk.each do |item|
35
- item.except!(:qty1, :qty2, :qty3, :price2, :price3)
36
- end
35
+ opts = DEFAULT_SMART_OPTS.merge(chunk_size: chunk_size)
37
36
 
37
+ SmarterCSV.process(csv_tempfile, opts) do |chunk|
38
38
  yield(chunk)
39
39
  end
40
40
 
data/lib/zanders/order.rb CHANGED
@@ -221,8 +221,8 @@ module Zanders
221
221
  order: { "xsi:type" => "ns2:Map" }
222
222
  },
223
223
  username: @username,
224
- password: @password
225
- #testing: true
224
+ password: @password,
225
+ testing: true
226
226
  }
227
227
 
228
228
  hash
@@ -1,3 +1,3 @@
1
1
  module Zanders
2
- VERSION = "2.0.4".freeze
2
+ VERSION = "2.0.5".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zanders
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Knight
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-13 00:00:00.000000000 Z
11
+ date: 2018-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.6.12
147
+ rubygems_version: 2.5.1
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Ruby library for Zanders