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 +4 -4
- data/lib/mge_wholesale/inventory.rb +14 -8
- data/lib/mge_wholesale/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: c0dcd9026bee2a0a214cedde01ebc7982cf7ebaa
|
4
|
+
data.tar.gz: 424d810990913e8e43fb7c14e3dfdabfc2a54dfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = {}
|
12
|
+
def self.all(options = {})
|
13
13
|
requires!(options, :username, :password)
|
14
|
-
new(options).all
|
14
|
+
new(options).all
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.quantity(options = {}
|
17
|
+
def self.quantity(options = {})
|
18
18
|
requires!(options, :username, :password)
|
19
|
-
new(options).quantity
|
19
|
+
new(options).quantity
|
20
20
|
end
|
21
21
|
|
22
|
-
def all
|
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
|
-
|
33
|
+
items << item
|
33
34
|
end
|
34
35
|
|
35
36
|
tempfile.unlink
|
37
|
+
|
38
|
+
items
|
36
39
|
end
|
37
40
|
|
38
|
-
def quantity
|
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
|
-
|
51
|
+
items << item
|
48
52
|
end
|
49
53
|
|
50
54
|
tempfile.unlink
|
55
|
+
|
56
|
+
items
|
51
57
|
end
|
52
58
|
|
53
59
|
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
|
+
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-
|
11
|
+
date: 2019-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|