redminerb 0.8.1 → 0.8.2

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: d73c75d31889c043847cbfa88509d83971a19dd3
4
- data.tar.gz: 757a41cad5019c335107d80a83058db166bd973c
3
+ metadata.gz: 8b4dd1d4a6a9dc35e5d13d47727879052f86c451
4
+ data.tar.gz: b0a9cfe53666b641b03e13d81737c3fa2868db84
5
5
  SHA512:
6
- metadata.gz: 0546f70d8f26ec3ba49c0c12199b938808ba37349b39c1a0f921b8308a7c2446f3427e0828298a3fa8350f872121e71eaac90cc20c598419509d4ea55d9fd23d
7
- data.tar.gz: 60eed842cc876d662fb9b4ee73c88ea91b2d0602e3cae0acf44da678cc733c11e89781712ebbf79d2f9e9df490b7d43140f88cec23ae94e28467a39b2c65296d
6
+ metadata.gz: e80b43317154902bcc0dec4470800f13b8414ae72f79b2ae3bd2d0c628ebde9be856445bcb5aac3c71ab4626d2414535d51e02034463e7a6bf15a72ff1c8f14c
7
+ data.tar.gz: a56e9c0a30f1e92d916875e907343770dfa29ea277777b45684e43c6cedbb39cddeb750b9d3ccdfa763b3ecd375bcd08ac0f20cc252039ddb024130a98b99bdd
@@ -13,12 +13,13 @@ module Redminerb
13
13
  option :offset, aliases: :o
14
14
  option :limit, aliases: :l
15
15
  option :all, type: :boolean,
16
- desc: "List all the users at the database. Internally it makes\n" + <<-DESC
17
- # as many HTTP requests to the REST API as needed (the
18
- # --limit option us manage that number setting the maximum
19
- # number of users it will get each time). To search consider
16
+ desc: "List all the users at the database. Internally it makes\n" +
17
+ <<-DESC
18
+ # as many HTTP requests to the REST API as needed. The
19
+ # --limit option says to redminerb the maximum number of
20
+ # users it should get with each request. To search consider
20
21
  # using the --query option instead (if possible).
21
- DESC
22
+ DESC
22
23
 
23
24
  def list(user_id = nil)
24
25
  if user_id
@@ -17,15 +17,15 @@ module Redminerb
17
17
  # Uses pagination (limit&offset) params to retreive all the resources of
18
18
  # the collection "name" using "params" in each request. Returns an array
19
19
  # with all the resources.
20
- def get_collection(name, params = { 'limit': 100 })
20
+ def get_collection(name, params = {})
21
21
  offset = 0
22
- limit = params['limit'].to_i
22
+ params[:limit] ||= 100
23
23
  [].tap do |resources|
24
24
  loop do
25
- params['offset'] = offset
25
+ params[:offset] = offset
26
26
  response = get_json("/#{name}.json", params)
27
27
  resources << response[name.to_s]
28
- offset += limit
28
+ offset += params[:limit].to_i
29
29
  break unless offset < response['total_count']
30
30
  end
31
31
  end.flatten
@@ -1,4 +1,4 @@
1
1
  # Copyright (c) The Cocktail Experience S.L. (2015)
2
2
  module Redminerb
3
- VERSION = '0.8.1'
3
+ VERSION = '0.8.2'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redminerb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Garcia Samblas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-22 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor