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 +4 -4
- data/lib/redminerb/cli/users.rb +6 -5
- data/lib/redminerb/client.rb +4 -4
- data/lib/redminerb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b4dd1d4a6a9dc35e5d13d47727879052f86c451
|
4
|
+
data.tar.gz: b0a9cfe53666b641b03e13d81737c3fa2868db84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e80b43317154902bcc0dec4470800f13b8414ae72f79b2ae3bd2d0c628ebde9be856445bcb5aac3c71ab4626d2414535d51e02034463e7a6bf15a72ff1c8f14c
|
7
|
+
data.tar.gz: a56e9c0a30f1e92d916875e907343770dfa29ea277777b45684e43c6cedbb39cddeb750b9d3ccdfa763b3ecd375bcd08ac0f20cc252039ddb024130a98b99bdd
|
data/lib/redminerb/cli/users.rb
CHANGED
@@ -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" +
|
17
|
-
|
18
|
-
#
|
19
|
-
#
|
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
|
-
|
22
|
+
DESC
|
22
23
|
|
23
24
|
def list(user_id = nil)
|
24
25
|
if user_id
|
data/lib/redminerb/client.rb
CHANGED
@@ -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 = {
|
20
|
+
def get_collection(name, params = {})
|
21
21
|
offset = 0
|
22
|
-
|
22
|
+
params[:limit] ||= 100
|
23
23
|
[].tap do |resources|
|
24
24
|
loop do
|
25
|
-
params[
|
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
|
data/lib/redminerb/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|