gun_broker 1.1.2 → 1.1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gun_broker/api.rb +4 -1
- data/lib/gun_broker/user/items_delegate.rb +3 -1
- data/lib/gun_broker/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef5c51c9081d64a792ac5f6dc071c1c88d3ee28a
|
4
|
+
data.tar.gz: 786b854259925ba6a6e693e7bee046d7cf03376f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 448d71ea7efba60b16b415e5b127be6bff511bf19cf6c6180cb05f6082708c3c5a6febcc0191dd7c134facfd64f67932912f41d2a805daa103ef7597626c3133
|
7
|
+
data.tar.gz: 0424e6adac3448fa85139142ceb793d23e00eca85d8669cac166da344932cac7a4c119bd298dbb79059bbe78f2a167454a9fb09c4e3212d64429b571d40f1381
|
data/lib/gun_broker/api.rb
CHANGED
@@ -15,6 +15,8 @@ module GunBroker
|
|
15
15
|
# Used to return the maximum number of results from paginated responses.
|
16
16
|
PAGE_SIZE = 300
|
17
17
|
|
18
|
+
USER_AGENT = "gun_broker rubygems.org/gems/gun_broker v(#{GunBroker::VERSION})"
|
19
|
+
|
18
20
|
# @param path [String] The requested API endpoint.
|
19
21
|
# @param params [Hash] (optional) URL params for GET requests; form params for POST request.
|
20
22
|
# @param headers [Hash] (optional) Additional headers sent with the request.
|
@@ -120,7 +122,8 @@ module GunBroker
|
|
120
122
|
|
121
123
|
def get_response(request)
|
122
124
|
request['Content-Type'] = 'application/json'
|
123
|
-
request['X-DevKey']
|
125
|
+
request['X-DevKey'] = GunBroker.dev_key
|
126
|
+
request["User-Agent"] = USER_AGENT
|
124
127
|
|
125
128
|
@headers.each { |header, value| request[header] = value }
|
126
129
|
|
@@ -60,7 +60,9 @@ module GunBroker
|
|
60
60
|
# @return [Item] Returns the Item or `nil` if no Item found.
|
61
61
|
def find(item_id)
|
62
62
|
# HACK: This has to filter through `#all`, since the GunBroker API currently has no way to scope the `/Items/{itemID}` endpoint by user.
|
63
|
-
|
63
|
+
@all ||= all
|
64
|
+
|
65
|
+
if @all.select { |item| item.id.to_s == item_id.to_s }.first
|
64
66
|
GunBroker::Item.find(item_id)
|
65
67
|
else
|
66
68
|
nil
|
data/lib/gun_broker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gun_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -220,4 +220,3 @@ test_files:
|
|
220
220
|
- spec/support/fixtures.rb
|
221
221
|
- spec/support/headers.rb
|
222
222
|
- spec/support/request.rb
|
223
|
-
has_rdoc:
|