omnifocus-github 1.0.1 → 1.1.0

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.
data.tar.gz.sig ADDED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,25 @@
1
+ === 1.1.0 / 2011-08-11
2
+
3
+ * 3 minor enhancements:
4
+
5
+ * Added (beta) commandline project filtering (do NOT use w/o filtering for plugin also).
6
+ * Added json dep for v3 api
7
+ * Switched to v3 for org/project issue gathering. Now has assignee
8
+
9
+ * 1 bug fix:
10
+
11
+ * Added PREFIX constant for new omnifocus plugin filtering.
12
+
13
+ === 1.0.2 / 2011-07-19
14
+
15
+ * 1 minor enhancement:
16
+
17
+ * Added (beta) commandline project filtering (do NOT use w/o filtering for plugin also).
18
+
19
+ * 1 bug fix:
20
+
21
+ * Added PREFIX constant for new omnifocus plugin filtering.
22
+
1
23
  === 1.0.1 / 2011-07-16
2
24
  * Fixed a bug. Only adds tickets assigned to user, not all tickets in project.
3
25
 
data/Rakefile CHANGED
@@ -8,7 +8,8 @@ Hoe.plugin :seattlerb
8
8
  Hoe.spec 'omnifocus-github' do
9
9
  developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
10
10
 
11
- extra_deps << 'omnifocus'
11
+ dependency "omnifocus", "~> 1.4"
12
+ dependency "json", "~> 1.5.0"
12
13
 
13
14
  self.rubyforge_name = 'seattlerb'
14
15
  end
@@ -1,18 +1,31 @@
1
1
  require 'open-uri'
2
2
  require 'yaml'
3
+ require 'json'
3
4
 
4
5
  module OmniFocus::Github
5
- VERSION = '1.0.1'
6
+ VERSION = '1.1.0'
6
7
 
8
+ PREFIX = "GH"
7
9
  GH_URL = "https://github.com"
10
+ GH_API_URL = "https://api.github.com"
8
11
 
9
- def fetch url, key
10
- base_url = "#{GH_URL}/api/v2/yaml"
12
+ def fetch url, key, ver = 2
13
+ base_url = "#{GH_URL}/api/v#{ver}/yaml"
11
14
  YAML.load(URI.parse("#{base_url}/#{url}").read)[key]
12
15
  end
13
16
 
17
+ def fetch3 url
18
+ JSON.parse(URI.parse("#{GH_API_URL}/#{url}").read)
19
+ end
20
+
14
21
  def populate_github_tasks
15
- user = `git config --global github.user`.chomp
22
+ @filter = ARGV.shift
23
+
24
+ bug_db.delete_if do |k,v|
25
+ not k.index @filter
26
+ end if @filter
27
+
28
+ @user = user = `git config --global github.user`.chomp
16
29
 
17
30
  # Personal projects
18
31
  projects = fetch("repos/show/#{user}", "repositories").select { |project|
@@ -22,49 +35,48 @@ module OmniFocus::Github
22
35
  }
23
36
 
24
37
  projects.sort.each do |project|
25
- warn " scanning #{user}/#{project}"
26
- fetch("issues/list/#{user}/#{project}/open", "issues").each do |issue|
27
- number = issue["number"]
28
- ticket_id = "GH-#{project}##{number}"
29
- title = "#{ticket_id}: #{issue["title"]}"
30
- url = "#{GH_URL}/#{user}/#{project}/issues/#{number}"
31
-
32
- if existing[ticket_id] then
33
- bug_db[existing[ticket_id]][ticket_id] = true
34
- next
35
- end
36
-
37
- bug_db[project][ticket_id] = [title, url]
38
- end
38
+ populate_issues_for user, project
39
39
  end
40
40
 
41
41
  # Organization projects
42
- orgs = fetch("user/show/#{user}/organizations", "organizations")
43
- orgs.each do |o|
44
- login = o["login"]
42
+ fetch("user/show/#{user}/organizations", "organizations").each do |org|
43
+ login = org["login"]
45
44
  projects = fetch("repos/show/#{login}", "repositories")
46
45
  projects = projects.select { |project| project[:open_issues] > 0}
47
46
  projects = projects.map{|project| project[:name]}
48
47
 
49
48
  projects.sort.each do |project|
50
- warn " scanning #{login}/#{project}"
51
- issues = fetch("issues/list/#{login}/#{project}/open", "issues")
52
- issues.each do |issue|
53
- number = issue["number"]
54
- t_user = issue["user"]
55
- ticket_id = "GH-#{project}##{number}"
56
- title = "#{ticket_id}: #{issue["title"]}"
57
- url = "#{GH_URL}/#{login}/#{project}/issues/#issue/#{number}"
58
-
59
- next unless t_user == user
60
- if existing[ticket_id] then
61
- bug_db[existing[ticket_id]][ticket_id] = true
62
- next
63
- end
64
-
65
- bug_db[project][ticket_id] = [title, url]
66
- end
49
+ populate_issues_for login, project
67
50
  end
68
51
  end
69
52
  end
53
+
54
+ def populate_issues_for user_org, project
55
+ return unless project.index @filter if @filter
56
+
57
+ warn " #{user_org}/#{project}"
58
+
59
+ fetch3("repos/#{user_org}/#{project}/issues").each do |issue|
60
+ next unless issue["assignee"]
61
+
62
+ number = issue["number"]
63
+ t_user = begin
64
+ issue["assignee"]["login"]
65
+ rescue NoMethodError
66
+ pp issue
67
+ end
68
+ ticket_id = "#{PREFIX}-#{project}##{number}"
69
+ title = "#{ticket_id}: #{issue["title"]}"
70
+ url = "#{GH_URL}/#{user_org}/#{project}/issues/#{number}"
71
+
72
+ next unless t_user == @user
73
+
74
+ if existing[ticket_id] then
75
+ bug_db[existing[ticket_id]][ticket_id] = true
76
+ next
77
+ end
78
+
79
+ bug_db[project][ticket_id] = [title, url]
80
+ end
81
+ end
70
82
  end
metadata CHANGED
@@ -1,22 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnifocus-github
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 0
9
8
  - 1
10
- version: 1.0.1
9
+ - 0
10
+ version: 1.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
14
14
  autorequire:
15
15
  bindir: bin
16
- cert_chain: []
16
+ cert_chain:
17
+ - |
18
+ -----BEGIN CERTIFICATE-----
19
+ MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
20
+ ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
21
+ GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
22
+ AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
23
+ JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
24
+ b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
25
+ taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
26
+ oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
27
+ GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
28
+ qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
29
+ gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
30
+ HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
31
+ AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
32
+ vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
33
+ w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
34
+ l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
35
+ n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
36
+ FBHgymkyj/AOSqKRIpXPhjC6
37
+ -----END CERTIFICATE-----
17
38
 
18
- date: 2011-07-16 00:00:00 -07:00
19
- default_executable:
39
+ date: 2011-08-12 00:00:00 Z
20
40
  dependencies:
21
41
  - !ruby/object:Gem::Dependency
22
42
  name: omnifocus
@@ -24,45 +44,61 @@ dependencies:
24
44
  requirement: &id001 !ruby/object:Gem::Requirement
25
45
  none: false
26
46
  requirements:
27
- - - ">="
47
+ - - ~>
48
+ - !ruby/object:Gem::Version
49
+ hash: 7
50
+ segments:
51
+ - 1
52
+ - 4
53
+ version: "1.4"
54
+ type: :runtime
55
+ version_requirements: *id001
56
+ - !ruby/object:Gem::Dependency
57
+ name: json
58
+ prerelease: false
59
+ requirement: &id002 !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ~>
28
63
  - !ruby/object:Gem::Version
29
64
  hash: 3
30
65
  segments:
66
+ - 1
67
+ - 5
31
68
  - 0
32
- version: "0"
69
+ version: 1.5.0
33
70
  type: :runtime
34
- version_requirements: *id001
71
+ version_requirements: *id002
35
72
  - !ruby/object:Gem::Dependency
36
73
  name: minitest
37
74
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
75
+ requirement: &id003 !ruby/object:Gem::Requirement
39
76
  none: false
40
77
  requirements:
41
- - - ">="
78
+ - - ~>
42
79
  - !ruby/object:Gem::Version
43
80
  hash: 11
44
81
  segments:
45
82
  - 2
46
- - 0
47
- - 2
48
- version: 2.0.2
83
+ - 4
84
+ version: "2.4"
49
85
  type: :development
50
- version_requirements: *id002
86
+ version_requirements: *id003
51
87
  - !ruby/object:Gem::Dependency
52
88
  name: hoe
53
89
  prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
90
+ requirement: &id004 !ruby/object:Gem::Requirement
55
91
  none: false
56
92
  requirements:
57
93
  - - ~>
58
94
  - !ruby/object:Gem::Version
59
- hash: 23
95
+ hash: 21
60
96
  segments:
61
97
  - 2
62
- - 10
63
- version: "2.10"
98
+ - 11
99
+ version: "2.11"
64
100
  type: :development
65
- version_requirements: *id003
101
+ version_requirements: *id004
66
102
  description: Plugin for omnifocus gem to provide github BTS synchronization.
67
103
  email:
68
104
  - ryand-ruby@zenspider.com
@@ -81,7 +117,6 @@ files:
81
117
  - README.txt
82
118
  - Rakefile
83
119
  - lib/omnifocus/github.rb
84
- has_rdoc: true
85
120
  homepage: https://github.com/seattlerb/omnifocus-github
86
121
  licenses: []
87
122
 
@@ -112,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
147
  requirements: []
113
148
 
114
149
  rubyforge_project: seattlerb
115
- rubygems_version: 1.4.2
150
+ rubygems_version: 1.8.5
116
151
  signing_key:
117
152
  specification_version: 3
118
153
  summary: Plugin for omnifocus gem to provide github BTS synchronization.
metadata.gz.sig ADDED
Binary file