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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c77264087ee3ed43864b65e137790c62374137a6
4
- data.tar.gz: 1739f557fffdccb8b189d1629a0db4a37e3c32fc
3
+ metadata.gz: 87174330d7f3528df4782c09c905215a01591efc
4
+ data.tar.gz: 53a0b9b32aa24a0fe4be3383e73034e5ffecc1cb
5
5
  SHA512:
6
- metadata.gz: 71261caaaf642e267516b06d50685c2ca3f26afa58d39d50c11067fb6ff6cea62e2d6c9f8ad303547d9b92ae5e4046034537a6191c92679bb9be1c82712ca8e5
7
- data.tar.gz: b847974e67673e44d1c557359982706fd73b320cbe7d0d3332b91c0de154778d363b94c6232ddcc5593aecfa81d95f6913723a5256e467beb1a6eb8cb82c2b92
6
+ metadata.gz: a2fdc4c8e379468e46b5524d8dcb54c5387ab3f81cb07d2cc72c219a6ab442eb862487907f2d7c8fe16a52ed01df06ffda61369b72f8812f1dc688ea55df3a0a
7
+ data.tar.gz: 41aea1207877740f14a033335e97dc3704bf739f9fbb33099fd0791546a203d6fb330512019d0d4137e9a34e9abb517edd92b26b3c5181cfa88f588f7d5b1c3e
@@ -12,6 +12,7 @@ require 'lipseys/inventory'
12
12
  require 'lipseys/invoice'
13
13
  require 'lipseys/order'
14
14
  require 'lipseys/user'
15
+ require 'lipseys/image'
15
16
 
16
17
  require 'lipseys/chunker'
17
18
  require 'lipseys/parser'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Lipseys
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
3
3
  end
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
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-28 00:00:00.000000000 Z
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.6.12
134
+ rubygems_version: 2.5.1
134
135
  signing_key:
135
136
  specification_version: 4
136
137
  summary: Ruby library for Lipsey's API.