gun_broker 1.4.5 → 1.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/gun_broker.gemspec +10 -11
- data/lib/gun_broker/order.rb +1 -1
- data/lib/gun_broker/user/items_as_pages_delegate.rb +11 -11
- data/lib/gun_broker/user/items_delegate.rb +8 -13
- data/lib/gun_broker/version.rb +1 -1
- metadata +24 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bcd25c4ee5eddc7ab83a3c5ccea39ef329c1280f382c091ae6b4dc4f1a78ed53
|
4
|
+
data.tar.gz: 1513955e7058ac436ac02ab7dce2ff213ef830c608c6d4a8b0634c631b050e61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5edf3ec4aacdbae6521101696d41bfd70f22b64584e7985878c3de03c9c5db3777ee16460c379f112100a00b33884fae14fc833cf64685e5c4d4c3c7264ca5b0
|
7
|
+
data.tar.gz: 53fab557b8721d2db43450239d00240417fa7fd91470e1e732a43b2d0efd6fb43ab2747706adfb3f328bd953d935e24fc25bb2325d436139726218e54fe8eed6
|
data/gun_broker.gemspec
CHANGED
@@ -6,10 +6,9 @@ require 'gun_broker/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "gun_broker"
|
8
8
|
spec.version = GunBroker::VERSION
|
9
|
-
spec.authors = ["Dale Campbell"]
|
10
|
-
spec.email = ["oshuma@gmail.com"]
|
11
|
-
spec.summary =
|
12
|
-
spec.description = %q{}
|
9
|
+
spec.authors = ["Dale Campbell", "Jeffrey Dill"]
|
10
|
+
spec.email = ["oshuma@gmail.com", "jeffdill2@gmail.com"]
|
11
|
+
spec.summary = "GunBroker.com API Ruby library"
|
13
12
|
spec.homepage = "https://github.com/ammoready/gun_broker"
|
14
13
|
spec.license = "MIT"
|
15
14
|
|
@@ -18,11 +17,11 @@ Gem::Specification.new do |spec|
|
|
18
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
18
|
spec.require_paths = ["lib"]
|
20
19
|
|
21
|
-
spec.add_development_dependency "bundler", "~>
|
22
|
-
spec.add_development_dependency "pry", "~> 0.10
|
23
|
-
spec.add_development_dependency "rake", "~>
|
24
|
-
spec.add_development_dependency "rspec", "~> 3.
|
25
|
-
spec.add_development_dependency "simplecov", "~> 0.
|
26
|
-
spec.add_development_dependency "webmock", "~>
|
27
|
-
spec.add_development_dependency "yard", "~> 0.9
|
20
|
+
spec.add_development_dependency "bundler", "~> 2.3"
|
21
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
22
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
23
|
+
spec.add_development_dependency "rspec", "~> 3.11"
|
24
|
+
spec.add_development_dependency "simplecov", "~> 0.21"
|
25
|
+
spec.add_development_dependency "webmock", "~> 3.14"
|
26
|
+
spec.add_development_dependency "yard", "~> 0.9"
|
28
27
|
end
|
data/lib/gun_broker/order.rb
CHANGED
@@ -37,36 +37,36 @@ module GunBroker
|
|
37
37
|
# Returns pages for items the User has bid on, but not won.
|
38
38
|
# @note {API#get! GET} /ItemsNotWon
|
39
39
|
# @return [Array<ItemsAsPage>]
|
40
|
-
def not_won
|
41
|
-
@not_won ||= build_pages_for(:ItemsNotWon, params_for(:timeframe))
|
40
|
+
def not_won(options = {})
|
41
|
+
@not_won ||= build_pages_for(:ItemsNotWon, params_for(:timeframe, options))
|
42
42
|
end
|
43
43
|
|
44
44
|
# Returns pages for items that are currently selling.
|
45
45
|
# @note {API#get! GET} /Items
|
46
46
|
# @return [Array<ItemsAsPage>]
|
47
47
|
def selling
|
48
|
-
@selling ||= build_pages_for(:
|
48
|
+
@selling ||= build_pages_for(:ItemsSelling)
|
49
49
|
end
|
50
50
|
|
51
51
|
# Returns pages for items the User has sold.
|
52
52
|
# @note {API#get! GET} /ItemsSold
|
53
53
|
# @return [Array<ItemsAsPage>]
|
54
|
-
def sold
|
55
|
-
@sold ||= build_pages_for(:ItemsSold, params_for(:timeframe))
|
54
|
+
def sold(options = {})
|
55
|
+
@sold ||= build_pages_for(:ItemsSold, params_for(:timeframe, options))
|
56
56
|
end
|
57
57
|
|
58
58
|
# Returns pages for items that were listed, but not sold.
|
59
59
|
# @note {API#get! GET} /ItemsUnsold
|
60
60
|
# @return [Array<ItemsAsPage>]
|
61
|
-
def unsold
|
62
|
-
@unsold ||= build_pages_for(:ItemsUnsold, params_for(:timeframe))
|
61
|
+
def unsold(options = {})
|
62
|
+
@unsold ||= build_pages_for(:ItemsUnsold, params_for(:timeframe, options))
|
63
63
|
end
|
64
64
|
|
65
65
|
# Returns pages for items the User has won.
|
66
66
|
# @note {API#get! GET} /ItemsWon
|
67
67
|
# @return [Array<ItemsAsPage>]
|
68
|
-
def won
|
69
|
-
@won ||= build_pages_for(:ItemsWon, params_for(:timeframe))
|
68
|
+
def won(options = {})
|
69
|
+
@won ||= build_pages_for(:ItemsWon, params_for(:timeframe, options))
|
70
70
|
end
|
71
71
|
|
72
72
|
private
|
@@ -94,12 +94,12 @@ module GunBroker
|
|
94
94
|
items_as_pages
|
95
95
|
end
|
96
96
|
|
97
|
-
def params_for(key)
|
97
|
+
def params_for(key, options = {})
|
98
98
|
case key
|
99
99
|
when :sellername
|
100
100
|
{ 'SellerName' => @user.username }
|
101
101
|
when :timeframe
|
102
|
-
{ 'TimeFrame' => GunBroker::API::MAX_ITEMS_TIME_FRAME }
|
102
|
+
{ 'TimeFrame' => (options[:timeframe] || GunBroker::API::MAX_ITEMS_TIME_FRAME) }
|
103
103
|
else
|
104
104
|
raise GunBroker::Error.new 'Unrecognized `params_for` key.'
|
105
105
|
end
|
@@ -71,8 +71,8 @@ module GunBroker
|
|
71
71
|
# Items the User has bid on, but not won.
|
72
72
|
# @note {API#get! GET} /ItemsNotWon
|
73
73
|
# @return [Array<Item>]
|
74
|
-
def not_won
|
75
|
-
@not_won ||= fetch_items(:ItemsNotWon, params_for(:timeframe))
|
74
|
+
def not_won(options = {})
|
75
|
+
@not_won ||= fetch_items(:ItemsNotWon, params_for(:timeframe, options))
|
76
76
|
end
|
77
77
|
|
78
78
|
# Returns Items that are currently selling.
|
@@ -82,12 +82,7 @@ module GunBroker
|
|
82
82
|
# @raise [GunBroker::Error::RequestError] If there's an issue with the request (usually a `5xx` response).
|
83
83
|
# @return [Array<Item>]
|
84
84
|
def selling(options = {})
|
85
|
-
|
86
|
-
*params_for(:sellername),
|
87
|
-
*params_for(:itemid, options)
|
88
|
-
].to_h
|
89
|
-
|
90
|
-
@selling ||= fetch_items(:Items, params)
|
85
|
+
@selling ||= fetch_items(:ItemsSelling, params_for(:itemid, options))
|
91
86
|
end
|
92
87
|
|
93
88
|
# Items the User has sold.
|
@@ -96,7 +91,7 @@ module GunBroker
|
|
96
91
|
# @return [Array<Item>]
|
97
92
|
def sold(options = {})
|
98
93
|
params = [
|
99
|
-
*params_for(:timeframe),
|
94
|
+
*params_for(:timeframe, options),
|
100
95
|
*params_for(:itemid, options)
|
101
96
|
].to_h
|
102
97
|
|
@@ -109,7 +104,7 @@ module GunBroker
|
|
109
104
|
# @return [Array<Item>]
|
110
105
|
def unsold(options = {})
|
111
106
|
params = [
|
112
|
-
*params_for(:timeframe),
|
107
|
+
*params_for(:timeframe, options),
|
113
108
|
*params_for(:itemid, options)
|
114
109
|
].to_h
|
115
110
|
|
@@ -139,8 +134,8 @@ module GunBroker
|
|
139
134
|
# Items the User has won.
|
140
135
|
# @note {API#get! GET} /ItemsWon
|
141
136
|
# @return [Array<Item>]
|
142
|
-
def won
|
143
|
-
@won ||= fetch_items(:ItemsWon, params_for(:timeframe))
|
137
|
+
def won(options = {})
|
138
|
+
@won ||= fetch_items(:ItemsWon, params_for(:timeframe, options))
|
144
139
|
end
|
145
140
|
|
146
141
|
private
|
@@ -180,7 +175,7 @@ module GunBroker
|
|
180
175
|
when :sellername
|
181
176
|
{ 'SellerName' => @user.username }
|
182
177
|
when :timeframe
|
183
|
-
{ 'TimeFrame' => GunBroker::API::MAX_ITEMS_TIME_FRAME }
|
178
|
+
{ 'TimeFrame' => (options[:timeframe] || GunBroker::API::MAX_ITEMS_TIME_FRAME) }
|
184
179
|
when :itemid
|
185
180
|
{ 'ItemID' => (options[:item_id] || options["ItemID"]) }
|
186
181
|
else
|
data/lib/gun_broker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gun_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
|
-
|
8
|
+
- Jeffrey Dill
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2022-08-29 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
@@ -16,101 +17,102 @@ dependencies:
|
|
16
17
|
requirements:
|
17
18
|
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
+
version: '2.3'
|
20
21
|
type: :development
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
25
|
- - "~>"
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
+
version: '2.3'
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: pry
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
32
|
- - "~>"
|
32
33
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.10
|
34
|
+
version: '0.10'
|
34
35
|
type: :development
|
35
36
|
prerelease: false
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
39
|
- - "~>"
|
39
40
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.10
|
41
|
+
version: '0.10'
|
41
42
|
- !ruby/object:Gem::Dependency
|
42
43
|
name: rake
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
44
45
|
requirements:
|
45
46
|
- - "~>"
|
46
47
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
+
version: '13.0'
|
48
49
|
type: :development
|
49
50
|
prerelease: false
|
50
51
|
version_requirements: !ruby/object:Gem::Requirement
|
51
52
|
requirements:
|
52
53
|
- - "~>"
|
53
54
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
55
|
+
version: '13.0'
|
55
56
|
- !ruby/object:Gem::Dependency
|
56
57
|
name: rspec
|
57
58
|
requirement: !ruby/object:Gem::Requirement
|
58
59
|
requirements:
|
59
60
|
- - "~>"
|
60
61
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
62
|
+
version: '3.11'
|
62
63
|
type: :development
|
63
64
|
prerelease: false
|
64
65
|
version_requirements: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
67
|
- - "~>"
|
67
68
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
69
|
+
version: '3.11'
|
69
70
|
- !ruby/object:Gem::Dependency
|
70
71
|
name: simplecov
|
71
72
|
requirement: !ruby/object:Gem::Requirement
|
72
73
|
requirements:
|
73
74
|
- - "~>"
|
74
75
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0.
|
76
|
+
version: '0.21'
|
76
77
|
type: :development
|
77
78
|
prerelease: false
|
78
79
|
version_requirements: !ruby/object:Gem::Requirement
|
79
80
|
requirements:
|
80
81
|
- - "~>"
|
81
82
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
83
|
+
version: '0.21'
|
83
84
|
- !ruby/object:Gem::Dependency
|
84
85
|
name: webmock
|
85
86
|
requirement: !ruby/object:Gem::Requirement
|
86
87
|
requirements:
|
87
88
|
- - "~>"
|
88
89
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
90
|
+
version: '3.14'
|
90
91
|
type: :development
|
91
92
|
prerelease: false
|
92
93
|
version_requirements: !ruby/object:Gem::Requirement
|
93
94
|
requirements:
|
94
95
|
- - "~>"
|
95
96
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
97
|
+
version: '3.14'
|
97
98
|
- !ruby/object:Gem::Dependency
|
98
99
|
name: yard
|
99
100
|
requirement: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
102
|
- - "~>"
|
102
103
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.9
|
104
|
+
version: '0.9'
|
104
105
|
type: :development
|
105
106
|
prerelease: false
|
106
107
|
version_requirements: !ruby/object:Gem::Requirement
|
107
108
|
requirements:
|
108
109
|
- - "~>"
|
109
110
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.9
|
111
|
-
description:
|
111
|
+
version: '0.9'
|
112
|
+
description:
|
112
113
|
email:
|
113
114
|
- oshuma@gmail.com
|
115
|
+
- jeffdill2@gmail.com
|
114
116
|
executables:
|
115
117
|
- console
|
116
118
|
- setup
|
@@ -179,7 +181,7 @@ homepage: https://github.com/ammoready/gun_broker
|
|
179
181
|
licenses:
|
180
182
|
- MIT
|
181
183
|
metadata: {}
|
182
|
-
post_install_message:
|
184
|
+
post_install_message:
|
183
185
|
rdoc_options: []
|
184
186
|
require_paths:
|
185
187
|
- lib
|
@@ -194,11 +196,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
196
|
- !ruby/object:Gem::Version
|
195
197
|
version: '0'
|
196
198
|
requirements: []
|
197
|
-
|
198
|
-
|
199
|
-
signing_key:
|
199
|
+
rubygems_version: 3.0.9
|
200
|
+
signing_key:
|
200
201
|
specification_version: 4
|
201
|
-
summary: GunBroker.com API Ruby library
|
202
|
+
summary: GunBroker.com API Ruby library
|
202
203
|
test_files:
|
203
204
|
- spec/fixtures/authenticate.json
|
204
205
|
- spec/fixtures/categories.json
|