omnifocus-github 1.1.0 → 1.2.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.
Files changed (5) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +7 -0
  3. data/lib/omnifocus/github.rb +10 -61
  4. metadata +11 -11
  5. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 1.2.0 / 2011-08-26
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Use new v3 api to get all issues in one request. Very fast!
6
+ * Removed all superfluous methods after switching to cleaner API.
7
+
1
8
  === 1.1.0 / 2011-08-11
2
9
 
3
10
  * 3 minor enhancements:
@@ -1,75 +1,24 @@
1
1
  require 'open-uri'
2
- require 'yaml'
3
2
  require 'json'
4
3
 
5
4
  module OmniFocus::Github
6
- VERSION = '1.1.0'
7
-
8
- PREFIX = "GH"
9
- GH_URL = "https://github.com"
10
- GH_API_URL = "https://api.github.com"
11
-
12
- def fetch url, key, ver = 2
13
- base_url = "#{GH_URL}/api/v#{ver}/yaml"
14
- YAML.load(URI.parse("#{base_url}/#{url}").read)[key]
15
- end
16
-
17
- def fetch3 url
18
- JSON.parse(URI.parse("#{GH_API_URL}/#{url}").read)
19
- end
5
+ VERSION = '1.2.0'
6
+ PREFIX = "GH"
20
7
 
21
8
  def populate_github_tasks
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
29
-
30
- # Personal projects
31
- projects = fetch("repos/show/#{user}", "repositories").select { |project|
32
- project[:open_issues] > 0
33
- }.map { |project|
34
- project[:name]
35
- }
36
-
37
- projects.sort.each do |project|
38
- populate_issues_for user, project
39
- end
40
-
41
- # Organization projects
42
- fetch("user/show/#{user}/organizations", "organizations").each do |org|
43
- login = org["login"]
44
- projects = fetch("repos/show/#{login}", "repositories")
45
- projects = projects.select { |project| project[:open_issues] > 0}
46
- projects = projects.map{|project| project[:name]}
9
+ # curl -i -u "#{user}:#{pass}" "https://api.github.com/issues"
47
10
 
48
- projects.sort.each do |project|
49
- populate_issues_for login, project
50
- end
51
- end
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"]
11
+ user = `git config --global github.user`.chomp
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]
61
15
 
16
+ JSON.parse(body).each do |issue|
62
17
  number = issue["number"]
63
- t_user = begin
64
- issue["assignee"]["login"]
65
- rescue NoMethodError
66
- pp issue
67
- end
18
+ url = issue["html_url"]
19
+ project = url.split(/\//)[-3]
68
20
  ticket_id = "#{PREFIX}-#{project}##{number}"
69
21
  title = "#{ticket_id}: #{issue["title"]}"
70
- url = "#{GH_URL}/#{user_org}/#{project}/issues/#{number}"
71
-
72
- next unless t_user == @user
73
22
 
74
23
  if existing[ticket_id] then
75
24
  bug_db[existing[ticket_id]][ticket_id] = true
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: 19
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 1.1.0
10
+ version: 1.2.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-12 00:00:00 Z
39
+ date: 2011-08-27 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: omnifocus
@@ -77,11 +77,11 @@ dependencies:
77
77
  requirements:
78
78
  - - ~>
79
79
  - !ruby/object:Gem::Version
80
- hash: 11
80
+ hash: 9
81
81
  segments:
82
82
  - 2
83
- - 4
84
- version: "2.4"
83
+ - 5
84
+ version: "2.5"
85
85
  type: :development
86
86
  version_requirements: *id003
87
87
  - !ruby/object:Gem::Dependency
@@ -92,11 +92,11 @@ dependencies:
92
92
  requirements:
93
93
  - - ~>
94
94
  - !ruby/object:Gem::Version
95
- hash: 21
95
+ hash: 27
96
96
  segments:
97
97
  - 2
98
- - 11
99
- version: "2.11"
98
+ - 12
99
+ version: "2.12"
100
100
  type: :development
101
101
  version_requirements: *id004
102
102
  description: Plugin for omnifocus gem to provide github BTS synchronization.
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  requirements: []
148
148
 
149
149
  rubyforge_project: seattlerb
150
- rubygems_version: 1.8.5
150
+ rubygems_version: 1.8.9
151
151
  signing_key:
152
152
  specification_version: 3
153
153
  summary: Plugin for omnifocus gem to provide github BTS synchronization.
metadata.gz.sig CHANGED
Binary file