davidsons 3.0.0 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/davidsons.gemspec +1 -1
- data/lib/davidsons/catalog.rb +9 -6
- data/lib/davidsons/inventory.rb +14 -8
- data/lib/davidsons/version.rb +1 -1
- data/lib/davidsons.rb +1 -1
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c156c07e3d5c3e39bdfafae7514e52e263d90e201025f5bd4220c4177ae221b
|
4
|
+
data.tar.gz: 855767e6d575a8108e66d6bf944011339d9a74ea4214b35cec350ae5b04bbdcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ae5c4b358f682d0f20f7c109da84a3bb4831a63bfa35f30e3fc527d497c0028bc236359cf5fe839eaf0acb0133555ef7fb43050f7157c61f10ed2abbe424abf
|
7
|
+
data.tar.gz: 6593c9ee7858553852b7c4f0b967dc38098627ef2790aa598dc1088f6ab5c78059cc55d11869f6d58d6dc4f3f4d325a2caaeecc5e12b39fcaf5f9a06d7bc2bd9
|
data/davidsons.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_runtime_dependency "smarter_csv", "~> 1.1.4"
|
27
27
|
|
28
|
-
spec.add_development_dependency "bundler", "~> 1.
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
29
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
30
30
|
spec.add_development_dependency "rspec", "~> 3.0"
|
31
31
|
spec.add_development_dependency "activesupport", "~> 5"
|
data/lib/davidsons/catalog.rb
CHANGED
@@ -28,18 +28,19 @@ module Davidsons
|
|
28
28
|
@options[:pricing_tier] ||= :regular
|
29
29
|
end
|
30
30
|
|
31
|
-
def self.all(options = {}
|
31
|
+
def self.all(options = {})
|
32
32
|
requires!(options, :username, :password)
|
33
|
-
new(options).all
|
33
|
+
new(options).all
|
34
34
|
end
|
35
35
|
|
36
|
-
def all
|
36
|
+
def all
|
37
37
|
tempfile = get_file(WHOLE_CATALOG_FILENAME)
|
38
|
+
items = []
|
38
39
|
|
39
40
|
SmarterCSV.process(tempfile, DEFAULT_SMART_OPTS) do |chunk|
|
40
41
|
chunk.each do |item|
|
41
|
-
item[:msrp]
|
42
|
-
item[:upc]
|
42
|
+
item[:msrp]&.tr!('$', '')
|
43
|
+
item[:upc]&.tr!('#', '')
|
43
44
|
|
44
45
|
item[:price] = lowest_price(item)
|
45
46
|
item[:mfg_number] = item[:item_identifier]
|
@@ -49,11 +50,13 @@ module Davidsons
|
|
49
50
|
item.delete(:sale_ends)
|
50
51
|
item.delete(:sale_price)
|
51
52
|
|
52
|
-
|
53
|
+
items << item
|
53
54
|
end
|
54
55
|
end
|
55
56
|
|
56
57
|
tempfile.unlink
|
58
|
+
|
59
|
+
items
|
57
60
|
end
|
58
61
|
|
59
62
|
protected
|
data/lib/davidsons/inventory.rb
CHANGED
@@ -50,9 +50,9 @@ module Davidsons
|
|
50
50
|
# @option options [Symbol] :pricing_tier *optional*
|
51
51
|
# * Denotes which price to use
|
52
52
|
# * Can be :regular or :minimum
|
53
|
-
def self.all(options = {}
|
53
|
+
def self.all(options = {})
|
54
54
|
requires!(options, :username, :password)
|
55
|
-
new(options).all
|
55
|
+
new(options).all
|
56
56
|
end
|
57
57
|
|
58
58
|
# Iterates over all items in the 'davidsons_quantity.csv' file yielding the item_identifier, upc, quantity and locations.
|
@@ -60,27 +60,31 @@ module Davidsons
|
|
60
60
|
# @param [Hash] options
|
61
61
|
# @option options [Symbol] :username *required*
|
62
62
|
# @option options [Symbol] :password *required*
|
63
|
-
def self.quantity(options = {}
|
63
|
+
def self.quantity(options = {})
|
64
64
|
requires!(options, :username, :password)
|
65
|
-
new(options).quantity
|
65
|
+
new(options).quantity
|
66
66
|
end
|
67
67
|
|
68
68
|
def all
|
69
|
+
items = []
|
69
70
|
tempfile = get_file(WHOLE_CATALOG_FILENAME)
|
70
71
|
|
71
72
|
SmarterCSV.process(tempfile, DEFAULT_WHOLE_CATALOG_SMART_OPTS) do |chunk|
|
72
73
|
chunk.each do |item|
|
73
|
-
item[:upc]
|
74
|
+
item[:upc]&.tr!('#', '')
|
74
75
|
|
75
76
|
item[:price] = lowest_price(item)
|
76
77
|
item[:quantity] = item[:quantity].to_i
|
77
78
|
|
78
|
-
|
79
|
+
items << item
|
79
80
|
end
|
80
81
|
end
|
82
|
+
|
83
|
+
items
|
81
84
|
end
|
82
85
|
|
83
|
-
def quantity
|
86
|
+
def quantity
|
87
|
+
items = []
|
84
88
|
tempfile = get_file(QUANTITY_FILENAME)
|
85
89
|
|
86
90
|
SmarterCSV.process(tempfile, DEFAULT_QUANTITY_SMART_OPTS) do |chunk|
|
@@ -88,9 +92,11 @@ module Davidsons
|
|
88
92
|
item[:quantity] = item[:quantity_nc].to_i + item[:quantity_az].to_i
|
89
93
|
item[:locations] = map_location_quantities(item)
|
90
94
|
|
91
|
-
|
95
|
+
items << item
|
92
96
|
end
|
93
97
|
end
|
98
|
+
|
99
|
+
items
|
94
100
|
end
|
95
101
|
|
96
102
|
private
|
data/lib/davidsons/version.rb
CHANGED
data/lib/davidsons.rb
CHANGED
@@ -36,7 +36,7 @@ module Davidsons
|
|
36
36
|
def initialize
|
37
37
|
@debug_mode ||= false
|
38
38
|
@ftp_host ||= "ftp.davidsonsinventory.com"
|
39
|
-
@proxy_url ||= "http://
|
39
|
+
@proxy_url ||= "http://127.0.0.1:8888"
|
40
40
|
@xmlns ||= "https://dealernetwork.davidsonsinc.com/"
|
41
41
|
end
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: davidsons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Knight
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.15'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.15'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,7 +125,7 @@ homepage: ''
|
|
125
125
|
licenses:
|
126
126
|
- MIT
|
127
127
|
metadata: {}
|
128
|
-
post_install_message:
|
128
|
+
post_install_message:
|
129
129
|
rdoc_options: []
|
130
130
|
require_paths:
|
131
131
|
- lib
|
@@ -140,9 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
|
144
|
-
|
145
|
-
signing_key:
|
143
|
+
rubygems_version: 3.0.8
|
144
|
+
signing_key:
|
146
145
|
specification_version: 4
|
147
146
|
summary: Ruby library for Davidson's
|
148
147
|
test_files: []
|