mge_wholesale 4.0.0 → 5.0.0

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: 5ff10676a183df44ace9f712798596b17f4d0ac0
4
- data.tar.gz: ad247cbe93c76c1a356593e5423f03552f5f5e5b
3
+ metadata.gz: c0dcd9026bee2a0a214cedde01ebc7982cf7ebaa
4
+ data.tar.gz: 424d810990913e8e43fb7c14e3dfdabfc2a54dfc
5
5
  SHA512:
6
- metadata.gz: e5399f365fff38fc2810755a454f5aeb2ef3996ef8ad2e7bf2467b22673aa089f2277cf296cf97b628194f50085e00b0d2eeb7c606de76ba5ca3bf63bcfa79bd
7
- data.tar.gz: aca0ddd331b5133e08013c32161717de5c6a9da358f43a5a01fdf2f718ef7c557202431618e1875c2cdd6dce5bc6a12adf23f4b62767a16589a2c45af7ec871d
6
+ metadata.gz: 4928f427d6c7da15eafc5c88c1c909b8649809f139b7b4955e3ad2107d0f3ad75c6b337aa535baf29d02b2672cba96dd415e90c2cd950e390e9888179f99021e
7
+ data.tar.gz: f56080956d64813ad59c8011168021b628e3a8dee55f451c1265555271957775888bc3a11cf58661fa9bca3fc5537d0a9e7a9d94e1a0c09ff78cae024c34b5b3
@@ -9,17 +9,18 @@ module MgeWholesale
9
9
  @options = options
10
10
  end
11
11
 
12
- def self.all(options = {}, &block)
12
+ def self.all(options = {})
13
13
  requires!(options, :username, :password)
14
- new(options).all(&block)
14
+ new(options).all
15
15
  end
16
16
 
17
- def self.quantity(options = {}, &block)
17
+ def self.quantity(options = {})
18
18
  requires!(options, :username, :password)
19
- new(options).quantity(&block)
19
+ new(options).quantity
20
20
  end
21
21
 
22
- def all(&block)
22
+ def all
23
+ items = []
23
24
  tempfile = get_file(INVENTORY_FILENAME)
24
25
 
25
26
  CSV.foreach(tempfile, { headers: :first_row }).each do |row|
@@ -29,13 +30,16 @@ module MgeWholesale
29
30
  price: row['cost'],
30
31
  }
31
32
 
32
- yield(item)
33
+ items << item
33
34
  end
34
35
 
35
36
  tempfile.unlink
37
+
38
+ items
36
39
  end
37
40
 
38
- def quantity(&block)
41
+ def quantity
42
+ items = []
39
43
  tempfile = get_file(FULL_INVENTORY_FILENAME)
40
44
 
41
45
  CSV.foreach(tempfile, { headers: :first_row }).each do |row|
@@ -44,10 +48,12 @@ module MgeWholesale
44
48
  quantity: row['qty'].to_i,
45
49
  }
46
50
 
47
- yield(item)
51
+ items << item
48
52
  end
49
53
 
50
54
  tempfile.unlink
55
+
56
+ items
51
57
  end
52
58
 
53
59
  end
@@ -1,3 +1,3 @@
1
1
  module MgeWholesale
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '5.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mge_wholesale
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Ebling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-01 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri