jira-ruby-dmg 0.1.29 → 0.1.30

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: 9c29b5682a4eaa8a808fbcd6e43953c4c70e1800
4
- data.tar.gz: 01f1f28151569088ce33b85e797ceb6dd0dcf6c1
3
+ metadata.gz: b1938a22773225ef13f1c4efa3b385f52c6556b1
4
+ data.tar.gz: 8f163742137211f793fc428232525c008b3313f8
5
5
  SHA512:
6
- metadata.gz: 27a2b2348667ea44fe92feeb5f79b7a85ce86d909cfb04fc196e85d1e3189c98d8267eaf1214dcb8ada2d08d8a0d6674b2f29b0092ce7e10d7baccc9c4427cd6
7
- data.tar.gz: 8d3ab269f6f5a0cb872372ca0fb2fbf65486367645b5ca698a369e33563382d857bdf93e5d2a174b0852905a04b288baae8e84dd5fb2f806c8bea39e0f257f33
6
+ metadata.gz: c27d1b1777e961b7267270bc5a53537c6abfa4d6f3ba8f992888e47e4a44dc6c814bf9b574f7a287f056007d316dc7943a8103a6edd201f931ebe785c3cf5671
7
+ data.tar.gz: d4134ad59a5a31c69a2a9fa1231eb11b4872efd16028a7e3e42b0d190bf61e24c5c7a63e438ebc473aee42635bf0853e6bc68571d26acd93f5f8d84fb831e504
@@ -17,16 +17,23 @@ module JIRA
17
17
 
18
18
  # Returns all the issues for this project
19
19
  def issues(options={})
20
- search_url = client.options[:rest_base_path] + '/search'
21
- query_params = {:jql => "project=\"#{key}\""}
22
- query_params.update Base.query_params_for_search(options)
23
- response = client.get(url_with_query_params(search_url, query_params))
24
- json = self.class.parse_json(response.body)
25
- json['issues'].map do |issue|
26
- client.Issue.build(issue)
20
+ options[:maxResults] = 9999999 unless options[:maxResults]
21
+ options[:startAt] = 0 unless options[:startAt]
22
+ result_issues = []
23
+ result_count = 0
24
+
25
+ while options[:maxResults] > 0 and result_count % 1000 == 0
26
+ new_issues = get_issues(options)
27
+ result_issues += new_issues
28
+ result_count = new_issues.length
29
+ options[:maxResults] -= result_count
30
+ options[:startAt] += result_count
27
31
  end
32
+
33
+ result_issues
28
34
  end
29
35
 
36
+
30
37
  # Returns all sprints for this project
31
38
  def sprints
32
39
  search_url = client.options[:site] +
@@ -40,6 +47,18 @@ module JIRA
40
47
  end
41
48
  end
42
49
 
50
+ private
51
+ def get_issues(options={})
52
+ search_url = client.options[:rest_base_path] + '/search'
53
+ query_params = {:jql => "project=\"#{key}\""}
54
+ query_params.update Base.query_params_for_search(options)
55
+ response = client.get(url_with_query_params(search_url, query_params))
56
+ json = self.class.parse_json(response.body)
57
+ json['issues'].map do |issue|
58
+ client.Issue.build(issue)
59
+ end
60
+ end
61
+
43
62
  end
44
63
  end
45
64
  end
data/lib/jira/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module JIRA
2
- VERSION = "0.1.29"
2
+ VERSION = "0.1.30"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jira-ruby-dmg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.29
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - ThisIs! DMG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-02 00:00:00.000000000 Z
11
+ date: 2014-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties