lipseys 6.0.2 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lipseys.rb +1 -0
- data/lib/lipseys/client.rb +5 -0
- data/lib/lipseys/shipping.rb +28 -0
- data/lib/lipseys/version.rb +1 -1
- metadata +3 -3
- data/lib/lipseys/image.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23e3e5f49bc9a4705ea4a5fdad5b545a0e336894
|
4
|
+
data.tar.gz: ba280d490d3ab838d1a7ed5d4e8e9f69b474b41f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb7729385153b638f36f93220c8a7614dc7eecdada5f745b169fedbdf38237c9f55da72fd4e70c74b65367c71dbdb82b685ec9e371a2c83f9acea36564b358a2
|
7
|
+
data.tar.gz: 8df8499b491131252ce69ca36ad93705b85ebb934e532745bf03a660b362dd09d52e535f0f0776134cc2aecd14a47754267aafbfd6627bdc8efdb695fae43f92
|
data/lib/lipseys.rb
CHANGED
data/lib/lipseys/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'lipseys/api'
|
2
2
|
require 'lipseys/items'
|
3
3
|
require 'lipseys/order'
|
4
|
+
require 'lipseys/shipping'
|
4
5
|
|
5
6
|
module Lipseys
|
6
7
|
class Client < Base
|
@@ -24,6 +25,10 @@ module Lipseys
|
|
24
25
|
@order ||= Lipseys::Order.new(self)
|
25
26
|
end
|
26
27
|
|
28
|
+
def shipping
|
29
|
+
@shipping ||= Lipseys::Shipping.new(self)
|
30
|
+
end
|
31
|
+
|
27
32
|
private
|
28
33
|
|
29
34
|
def authenticate!
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'lipseys/api'
|
2
|
+
|
3
|
+
module Lipseys
|
4
|
+
class Shipping < Base
|
5
|
+
|
6
|
+
include Lipseys::API
|
7
|
+
|
8
|
+
ENDPOINTS = {
|
9
|
+
fetch: "shipping/oneday".freeze,
|
10
|
+
}
|
11
|
+
|
12
|
+
def initialize(client)
|
13
|
+
@client = client
|
14
|
+
end
|
15
|
+
|
16
|
+
def fetch(since_date = nil)
|
17
|
+
endpoint = ENDPOINTS[:fetch]
|
18
|
+
since_date = (since_date || Time.now.prev_day).strftime('%m/%d/%Y')
|
19
|
+
headers = [
|
20
|
+
*auth_header(@client.access_token),
|
21
|
+
*content_type_header('application/json'),
|
22
|
+
].to_h
|
23
|
+
|
24
|
+
post_request(endpoint, "\"#{since_date}\"", headers)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
data/lib/lipseys/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lipseys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey Dill
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -104,11 +104,11 @@ files:
|
|
104
104
|
- lib/lipseys/catalog.rb
|
105
105
|
- lib/lipseys/client.rb
|
106
106
|
- lib/lipseys/error.rb
|
107
|
-
- lib/lipseys/image.rb
|
108
107
|
- lib/lipseys/inventory.rb
|
109
108
|
- lib/lipseys/items.rb
|
110
109
|
- lib/lipseys/order.rb
|
111
110
|
- lib/lipseys/response.rb
|
111
|
+
- lib/lipseys/shipping.rb
|
112
112
|
- lib/lipseys/user.rb
|
113
113
|
- lib/lipseys/version.rb
|
114
114
|
- lipseys.gemspec
|
data/lib/lipseys/image.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
module Lipseys
|
2
|
-
class Image < Base
|
3
|
-
|
4
|
-
API_URL = 'http://184.188.80.195/API/catalog.ashx'
|
5
|
-
|
6
|
-
def initialize(options = {})
|
7
|
-
requires!(options, :username, :password)
|
8
|
-
|
9
|
-
@options = options
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.urls(options = {})
|
13
|
-
new(options).urls
|
14
|
-
end
|
15
|
-
|
16
|
-
def urls(options = {})
|
17
|
-
tempfile = stream_to_tempfile(API_URL, @options)
|
18
|
-
images = Array.new
|
19
|
-
|
20
|
-
Lipseys::Parser.parse(tempfile, 'Item') do |item|
|
21
|
-
image = Hash.new
|
22
|
-
image[:item_identifier] = content_for(item, 'ItemNo')
|
23
|
-
image[:url] = "http://www.lipseys.net/images/#{content_for(item, 'Image')}"
|
24
|
-
|
25
|
-
images.push(image)
|
26
|
-
end
|
27
|
-
|
28
|
-
images
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|