gun_broker 1.3.0 → 1.3.1

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: d6a5514db1a0faf10391363483a843c4566e5d8a
4
- data.tar.gz: a249bf76f5d92a7ad4fba9a1d87d798eec830512
3
+ metadata.gz: ee62a2f7ba855ae1ab273fb835e4f409618ec80f
4
+ data.tar.gz: 9a82f711c82e128281e4a1a8008770958f5b6ffa
5
5
  SHA512:
6
- metadata.gz: fa2b60ad095be332d187c3038fd344de3d3b269d8bea02bda64b83fa2cb925556ed850ed9f05b9e99ec3f8fbabdbe95ba3173572a297939710bbaf0f743597a4
7
- data.tar.gz: c5ec2af3222e2b7239f52caff4da01c69c6e44777ee6a86d14910f5b391a4b2d4a5c47984542a37f1e6a474f2653316cb3159b6a4ad84920409f9d7e39989fb9
6
+ metadata.gz: ff7a88de4b27ed07c443324fef32ed2e3e5e728d4b7878decd0a7040971e597ee5ffa78df7a5574a8b8bd1de3ba9bc680a92266378f3cee54e8b73f991080dec
7
+ data.tar.gz: 2866e8691ff60d72212d823a9d510b99a7531e790ac0ca7ab8260535a70dbc52c979899527270f75e2717473da7f0a86752435bb3512b3efcc1f79e0b3cc10a7
@@ -15,6 +15,9 @@ module GunBroker
15
15
  # Used to return the maximum number of results from paginated responses.
16
16
  PAGE_SIZE = 300
17
17
 
18
+ # Defaults to 12 (View Last 30 Days), so we need to specify 1 (View All Completed) to get everything.
19
+ TIME_FRAME = 1
20
+
18
21
  USER_AGENT = "gun_broker rubygems.org/gems/gun_broker v(#{GunBroker::VERSION})"
19
22
 
20
23
  # @param path [String] The requested API endpoint.
@@ -11,7 +11,8 @@ module GunBroker
11
11
  def fetch_items
12
12
  @attributes[:params].merge!({
13
13
  'PageIndex' => @attributes[:page_index],
14
- 'PageSize' => @attributes[:page_size]
14
+ 'PageSize' => @attributes[:page_size],
15
+ 'TimeFrame' => GunBroker::API::TIME_FRAME,
15
16
  })
16
17
  response = GunBroker::API.get(@attributes[:endpoint], @attributes[:params], @attributes[:token_header])
17
18
 
@@ -142,9 +142,13 @@ module GunBroker
142
142
 
143
143
  private
144
144
 
145
- def fetch_items(endpoint, params = {})
145
+ def fetch_items(endpoint, params = {})\
146
+ params.merge!({
147
+ 'PageSize' => GunBroker::API::PAGE_SIZE,
148
+ 'TimeFrame' => GunBroker::API::TIME_FRAME,
149
+ })
150
+
146
151
  endpoint = ['/', endpoint.to_s].join
147
- params.merge!({ 'PageSize' => GunBroker::API::PAGE_SIZE })
148
152
  response = GunBroker::API.get(endpoint, params, token_header(@user.token))
149
153
  number_of_pages = (response['count'] / GunBroker::API::PAGE_SIZE.to_f).ceil
150
154
 
@@ -1,3 +1,3 @@
1
1
  module GunBroker
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
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.3.0
4
+ version: 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: 2018-03-23 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler