lipseys 2.0.4 → 2.0.5
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/image.rb +32 -0
- data/lib/lipseys/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87174330d7f3528df4782c09c905215a01591efc
|
4
|
+
data.tar.gz: 53a0b9b32aa24a0fe4be3383e73034e5ffecc1cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2fdc4c8e379468e46b5524d8dcb54c5387ab3f81cb07d2cc72c219a6ab442eb862487907f2d7c8fe16a52ed01df06ffda61369b72f8812f1dc688ea55df3a0a
|
7
|
+
data.tar.gz: 41aea1207877740f14a033335e97dc3704bf739f9fbb33099fd0791546a203d6fb330512019d0d4137e9a34e9abb517edd92b26b3c5181cfa88f588f7d5b1c3e
|
data/lib/lipseys.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Lipseys
|
2
|
+
class Image < Base
|
3
|
+
|
4
|
+
API_URL = 'https://www.lipseys.com/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
|
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: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- lib/lipseys/base.rb
|
103
103
|
- lib/lipseys/catalog.rb
|
104
104
|
- lib/lipseys/chunker.rb
|
105
|
+
- lib/lipseys/image.rb
|
105
106
|
- lib/lipseys/inventory.rb
|
106
107
|
- lib/lipseys/invoice.rb
|
107
108
|
- lib/lipseys/order.rb
|
@@ -130,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
131
|
version: '0'
|
131
132
|
requirements: []
|
132
133
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.5.1
|
134
135
|
signing_key:
|
135
136
|
specification_version: 4
|
136
137
|
summary: Ruby library for Lipsey's API.
|