omnifocus-github 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- t\��D
2
- ��@��jպ���k��
1
+ '*� �� Y�f5~F��%8����[fͳ�rLL$#F���gh�tA�r��@^Ȑ�+fߍ��!#������*�
2
+ �` ��iM��`B��+�ޮv���`�Q,���_��Y���ƋrQ�y��3�b����n�_2F����x��rF��v����R�;Qp������'K8þls �I�e�~��c��tӋQe�-
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.3.0 / 2011-11-18
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added multi-page fetching for long user issue lists
6
+
1
7
  === 1.2.0 / 2011-08-26
2
8
 
3
9
  * 2 minor enhancements:
@@ -2,17 +2,35 @@ require 'open-uri'
2
2
  require 'json'
3
3
 
4
4
  module OmniFocus::Github
5
- VERSION = '1.2.0'
5
+ VERSION = '1.3.0'
6
6
  PREFIX = "GH"
7
7
 
8
8
  def populate_github_tasks
9
- # curl -i -u "#{user}:#{pass}" "https://api.github.com/issues"
9
+ # curl -i -u "#{user}:#{pass}" "https://api.github.com/issues?page=1"
10
10
 
11
11
  user = `git config --global github.user`.chomp
12
12
  pass = `git config --global github.password`.chomp
13
- uri = URI.parse "https://api.github.com/issues"
14
- body = uri.read :http_basic_authentication => [user, pass]
15
13
 
14
+ body = fetch user, pass, 1
15
+
16
+ process body
17
+
18
+ (2..get_last(body)).each do |page|
19
+ process fetch user, pass, page
20
+ end
21
+ end
22
+
23
+ def fetch user, pass, page
24
+ uri = URI.parse "https://api.github.com/issues?page=#{page}"
25
+ uri.read :http_basic_authentication => [user, pass]
26
+ end
27
+
28
+ def get_last body
29
+ link, last = body.meta["link"], nil
30
+ link and link[/page=(\d+).. rel=.last/, 1].to_i or 0
31
+ end
32
+
33
+ def process body
16
34
  JSON.parse(body).each do |issue|
17
35
  number = issue["number"]
18
36
  url = issue["html_url"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnifocus-github
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 1.2.0
10
+ version: 1.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,7 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2011-08-27 00:00:00 Z
39
+ date: 2011-11-19 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: omnifocus
@@ -70,24 +70,39 @@ dependencies:
70
70
  type: :runtime
71
71
  version_requirements: *id002
72
72
  - !ruby/object:Gem::Dependency
73
- name: minitest
73
+ name: rdoc
74
74
  prerelease: false
75
75
  requirement: &id003 !ruby/object:Gem::Requirement
76
76
  none: false
77
77
  requirements:
78
78
  - - ~>
79
79
  - !ruby/object:Gem::Version
80
- hash: 9
80
+ hash: 21
81
81
  segments:
82
- - 2
83
- - 5
84
- version: "2.5"
82
+ - 3
83
+ - 9
84
+ version: "3.9"
85
85
  type: :development
86
86
  version_requirements: *id003
87
87
  - !ruby/object:Gem::Dependency
88
- name: hoe
88
+ name: minitest
89
89
  prerelease: false
90
90
  requirement: &id004 !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ~>
94
+ - !ruby/object:Gem::Version
95
+ hash: 19
96
+ segments:
97
+ - 2
98
+ - 8
99
+ version: "2.8"
100
+ type: :development
101
+ version_requirements: *id004
102
+ - !ruby/object:Gem::Dependency
103
+ name: hoe
104
+ prerelease: false
105
+ requirement: &id005 !ruby/object:Gem::Requirement
91
106
  none: false
92
107
  requirements:
93
108
  - - ~>
@@ -98,7 +113,7 @@ dependencies:
98
113
  - 12
99
114
  version: "2.12"
100
115
  type: :development
101
- version_requirements: *id004
116
+ version_requirements: *id005
102
117
  description: Plugin for omnifocus gem to provide github BTS synchronization.
103
118
  email:
104
119
  - ryand-ruby@zenspider.com
@@ -147,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
162
  requirements: []
148
163
 
149
164
  rubyforge_project: seattlerb
150
- rubygems_version: 1.8.9
165
+ rubygems_version: 1.8.10
151
166
  signing_key:
152
167
  specification_version: 3
153
168
  summary: Plugin for omnifocus gem to provide github BTS synchronization.
metadata.gz.sig CHANGED
Binary file