lipseys 1.0.0.pre → 1.0.1.pre
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/.gitignore +1 -0
- data/lib/lipseys/catalog.rb +33 -38
- data/lib/lipseys/inventory.rb +33 -38
- data/lib/lipseys/version.rb +1 -1
- data/lipseys.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb3e78d7551595463cca5f1a35c2cda87ee7d4d
|
4
|
+
data.tar.gz: d3fff0f0dada8b081e301d8d44f4e436d64bb1fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b96e5d63b6721bc089989a0ebc9b5ab6750e69152a56352a9cd39644cef1b02ed07317775bb713a74ecb65dd5765194db36d6a17093629d99ac90ffe5caa5c52
|
7
|
+
data.tar.gz: 24c0a9194c7944de504e92ba26011da6eb61231c3f0c93ed8b9e0b81d4766bfdf571beff632e203526617d6a9c3b66793471878b76b73d24df9f0cb3309016bd
|
data/.gitignore
CHANGED
data/lib/lipseys/catalog.rb
CHANGED
@@ -61,24 +61,38 @@ module Lipseys
|
|
61
61
|
|
62
62
|
API_URL = 'https://www.lipseys.com/API/catalog.ashx'
|
63
63
|
|
64
|
-
|
65
64
|
def initialize(options = {})
|
66
65
|
requires!(options, :email, :password)
|
67
66
|
@email = options[:email]
|
68
67
|
@password = options[:password]
|
69
68
|
end
|
70
69
|
|
71
|
-
|
72
70
|
def self.all(options = {})
|
73
71
|
new(options).all
|
74
72
|
end
|
75
73
|
|
74
|
+
def self.all_as_chunks(size, options = {}, &block)
|
75
|
+
new(options).all_as_chunks(size, &block)
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.accessories(options = {})
|
79
|
+
new(options).accessories
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.firearms(options = {})
|
83
|
+
new(options).firearms
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.nfa(options = {})
|
87
|
+
new(options).nfa
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.optics(options = {})
|
91
|
+
new(options).optics
|
92
|
+
end
|
93
|
+
|
76
94
|
def all
|
77
|
-
|
78
|
-
email: @email,
|
79
|
-
pass: @password
|
80
|
-
}
|
81
|
-
tempfile = stream_to_tempfile(API_URL, params)
|
95
|
+
tempfile = stream_to_tempfile(API_URL, default_params)
|
82
96
|
|
83
97
|
items = Array.new
|
84
98
|
|
@@ -89,22 +103,13 @@ module Lipseys
|
|
89
103
|
items
|
90
104
|
end
|
91
105
|
|
92
|
-
def self.all_as_chunks(size, options = {}, &block)
|
93
|
-
new(options).all_as_chunks(size, &block)
|
94
|
-
end
|
95
|
-
|
96
106
|
def all_as_chunks(size, &block)
|
97
|
-
|
98
|
-
|
99
|
-
pass: @password
|
100
|
-
}
|
101
|
-
chunker = Lipseys::Chunker.new(size)
|
102
|
-
tempfile = stream_to_tempfile(API_URL, params)
|
107
|
+
chunker = Lipseys::Chunker.new(size)
|
108
|
+
tempfile = stream_to_tempfile(API_URL, default_params)
|
103
109
|
|
104
110
|
Lipseys::Parser.parse(tempfile, 'Item') do |node|
|
105
111
|
if chunker.is_full?
|
106
112
|
yield(chunker.chunk)
|
107
|
-
|
108
113
|
chunker.reset
|
109
114
|
else
|
110
115
|
chunker.add(map_hash(node))
|
@@ -121,45 +126,35 @@ module Lipseys
|
|
121
126
|
tempfile.unlink
|
122
127
|
end
|
123
128
|
|
124
|
-
def
|
125
|
-
|
129
|
+
def accessories
|
130
|
+
get_items('ACCESSORY')
|
126
131
|
end
|
127
132
|
|
128
133
|
def firearms
|
129
134
|
get_items('FIREARM')
|
130
135
|
end
|
131
136
|
|
132
|
-
def self.nfa(options = {})
|
133
|
-
new(options).nfa
|
134
|
-
end
|
135
|
-
|
136
137
|
def nfa
|
137
138
|
get_items('NFA')
|
138
139
|
end
|
139
140
|
|
140
|
-
def self.optics(options = {})
|
141
|
-
new(options).optics
|
142
|
-
end
|
143
|
-
|
144
141
|
def optics
|
145
142
|
get_items('OPTIC')
|
146
143
|
end
|
147
144
|
|
148
|
-
|
149
|
-
new(options).accessories
|
150
|
-
end
|
145
|
+
private
|
151
146
|
|
152
|
-
def
|
153
|
-
|
147
|
+
def default_params
|
148
|
+
{
|
149
|
+
email: @email,
|
150
|
+
pass: @password
|
151
|
+
}
|
154
152
|
end
|
155
153
|
|
156
|
-
private
|
157
|
-
|
158
154
|
def get_items(item_type = nil)
|
159
|
-
|
160
|
-
params[:itemtype] = item_type unless item_type.nil?
|
155
|
+
default_params[:itemtype] = item_type unless item_type.nil?
|
161
156
|
|
162
|
-
xml_doc = get_response_xml(API_URL,
|
157
|
+
xml_doc = get_response_xml(API_URL, default_params)
|
163
158
|
|
164
159
|
items = Array.new
|
165
160
|
|
data/lib/lipseys/inventory.rb
CHANGED
@@ -15,24 +15,38 @@ module Lipseys
|
|
15
15
|
|
16
16
|
API_URL = 'https://www.lipseys.com/API/pricequantitycatalog.ashx'
|
17
17
|
|
18
|
-
|
19
18
|
def initialize(options = {})
|
20
19
|
requires!(options, :email, :password)
|
21
20
|
@email = options[:email]
|
22
21
|
@password = options[:password]
|
23
22
|
end
|
24
23
|
|
25
|
-
|
26
24
|
def self.all(options = {})
|
27
25
|
new(options).all
|
28
26
|
end
|
29
27
|
|
28
|
+
def self.all_as_chunks(size, options = {}, &block)
|
29
|
+
new(options).all_as_chunks(size, &block)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.accessories(options = {})
|
33
|
+
new(options).accessories
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.firearms(options = {})
|
37
|
+
new(options).firearms
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.nfa(options = {})
|
41
|
+
new(options).nfa
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.optics(options = {})
|
45
|
+
new(options).optics
|
46
|
+
end
|
47
|
+
|
30
48
|
def all
|
31
|
-
|
32
|
-
email: @email,
|
33
|
-
pass: @password
|
34
|
-
}
|
35
|
-
tempfile = stream_to_tempfile(API_URL, params)
|
49
|
+
tempfile = stream_to_tempfile(API_URL, default_params)
|
36
50
|
|
37
51
|
items = Array.new
|
38
52
|
|
@@ -43,22 +57,13 @@ module Lipseys
|
|
43
57
|
items
|
44
58
|
end
|
45
59
|
|
46
|
-
def self.all_as_chunks(size, options = {}, &block)
|
47
|
-
new(options).all_as_chunks(size, &block)
|
48
|
-
end
|
49
|
-
|
50
60
|
def all_as_chunks(size, &block)
|
51
|
-
|
52
|
-
|
53
|
-
pass: @password
|
54
|
-
}
|
55
|
-
chunker = Lipseys::Chunker.new(size)
|
56
|
-
tempfile = stream_to_tempfile(API_URL, params)
|
61
|
+
chunker = Lipseys::Chunker.new(size)
|
62
|
+
tempfile = stream_to_tempfile(API_URL, default_params)
|
57
63
|
|
58
64
|
Lipseys::Parser.parse(tempfile, 'Item') do |node|
|
59
65
|
if chunker.is_full?
|
60
66
|
yield(chunker.chunk)
|
61
|
-
|
62
67
|
chunker.reset
|
63
68
|
else
|
64
69
|
chunker.add(map_hash(node))
|
@@ -75,45 +80,35 @@ module Lipseys
|
|
75
80
|
tempfile.unlink
|
76
81
|
end
|
77
82
|
|
78
|
-
def
|
79
|
-
|
83
|
+
def accessories
|
84
|
+
get_items('ACCESSORY')
|
80
85
|
end
|
81
86
|
|
82
87
|
def firearms
|
83
88
|
get_items('FIREARM')
|
84
89
|
end
|
85
90
|
|
86
|
-
def self.nfa(options = {})
|
87
|
-
new(options).nfa
|
88
|
-
end
|
89
|
-
|
90
91
|
def nfa
|
91
92
|
get_items('NFA')
|
92
93
|
end
|
93
94
|
|
94
|
-
def self.optics(options = {})
|
95
|
-
new(options).optics
|
96
|
-
end
|
97
|
-
|
98
95
|
def optics
|
99
96
|
get_items('OPTIC')
|
100
97
|
end
|
101
98
|
|
102
|
-
|
103
|
-
new(options).accessories
|
104
|
-
end
|
99
|
+
private
|
105
100
|
|
106
|
-
def
|
107
|
-
|
101
|
+
def default_params
|
102
|
+
{
|
103
|
+
email: @email,
|
104
|
+
pass: @password
|
105
|
+
}
|
108
106
|
end
|
109
107
|
|
110
|
-
private
|
111
|
-
|
112
108
|
def get_items(item_type = nil)
|
113
|
-
|
114
|
-
params[:itemtype] = item_type unless item_type.nil?
|
109
|
+
default_params[:itemtype] = item_type unless item_type.nil?
|
115
110
|
|
116
|
-
xml_doc = get_response_xml(API_URL,
|
111
|
+
xml_doc = get_response_xml(API_URL, default_params)
|
117
112
|
|
118
113
|
items = Array.new
|
119
114
|
|
data/lib/lipseys/version.rb
CHANGED
data/lipseys.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency "nokogiri", "~> 1.6"
|
25
25
|
spec.add_dependency "savon", "~> 2.11.1"
|
26
26
|
|
27
|
-
spec.add_development_dependency "bundler", "~> 1.
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
28
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
29
29
|
spec.add_development_dependency "rspec", "~> 3.0"
|
30
30
|
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: 1.0.
|
4
|
+
version: 1.0.1.pre
|
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-04-
|
11
|
+
date: 2017-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.12'
|
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.12'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: 1.3.1
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
133
|
+
rubygems_version: 2.6.7
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Ruby library for Lipsey's API.
|