omnifocus-github 1.8.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '07780f3d65b81ab4393b6726d8eae5b3ffe21d871a4eeee854ac16e4d56d655a'
4
- data.tar.gz: 5cb9117304f6048f77f81bd72af5b3e0a92e7099a5a0b97308d5211a7f68d6fc
3
+ metadata.gz: 5d40c0e432d4783144432c7f703e64a0f0140b2fdd015400fd1995d3ac495276
4
+ data.tar.gz: eb73e87311e83ae8d27e7106f998c6e987a585b775f48e34e11ddea58e0402ba
5
5
  SHA512:
6
- metadata.gz: e024d61f799ad910ffdd8166412c94b819d2224a4961ee60a90f80e78960ba5c29e179e014f65ff360357eb5c3d9d4310aebfdf2ff48ce9f661e9ae89cb43822
7
- data.tar.gz: 9885d104308799e749deb62faca18fadd478ce6fbc2e8771b94978c2fa785b645520cf107a536d9fc8730a8cc687201fde5269bfee3f6839feaaf5662679b6ed
6
+ metadata.gz: d821c4bde4f20d0580cbd0c53b908fc853b1c0e78b5bc95c51fcacdf4f8329880a8e2e57bf96c47403ac5462194954595616dc7a222ca41437251df862f4a62b
7
+ data.tar.gz: c3389bc17a46a8ec7735f8242954496bf4cc6f7056e42db2b089941ac62057fe041722fec8842a9f097d0fbd1a5157b2c8f387df8034309bdd3f5f6b2336aefd
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,21 @@
1
+ === 2.0.0 / 2022-09-28
2
+
3
+ * 1 major enhancement:
4
+
5
+ * Removed #gh_client.
6
+
7
+ * 2 minor enhancements:
8
+
9
+ * #process now takes the prefix for the ticket ID (default: GH).
10
+ * Refactored #gh_client + most #populate_github_tasks into #github_clients that returns a hash of prefix => octokit_client.
11
+
12
+ === 1.9.0 / 2020-02-12
13
+
14
+ * 2 minor enhancements:
15
+
16
+ * Exclude projects listed in ~/.omnifocus.yml.
17
+ * Updated to use omnifocus 2.6+.
18
+
1
19
  === 1.8.3 / 2019-12-15
2
20
 
3
21
  * 1 bug fix:
data/README.rdoc CHANGED
@@ -10,11 +10,11 @@ Plugin for omnifocus gem to provide github BTS synchronization.
10
10
  Support for Github Enterprise:
11
11
 
12
12
  In your git config, set the key github.accounts to a space
13
- separated list of github accounts.
13
+ separated list of github accounts.
14
14
 
15
15
  git config --global github.accounts "github myghe"
16
16
 
17
- For each account API and web end points and authentication information
17
+ For each account API and web end points and authentication information
18
18
  should be stored in the git config under a key matching the
19
19
  account. For example:
20
20
 
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ Hoe.spec 'omnifocus-github' do
12
12
 
13
13
  license "MIT"
14
14
 
15
- dependency "omnifocus", "~> 2.5"
15
+ dependency "omnifocus", "~> 2.6"
16
16
  dependency "octokit", "~> 4.14"
17
17
  end
18
18
 
@@ -5,12 +5,24 @@ $-w = old_w
5
5
  Octokit.auto_paginate = true
6
6
 
7
7
  module OmniFocus::Github
8
- VERSION = "1.8.3"
8
+ VERSION = "2.0.0"
9
9
  PREFIX = "GH"
10
10
 
11
11
  def populate_github_tasks
12
12
  processed = false
13
- omnifocus_git_param(:accounts, "github").split(/\s+/).each do |account|
13
+
14
+ github_clients.each do |account, client|
15
+ account_label = account == "github" ? PREFIX : account
16
+
17
+ processed = true
18
+ process account_label, client
19
+ end
20
+
21
+ raise "No accounts authenticated. Bailing." unless processed
22
+ end
23
+
24
+ def github_clients
25
+ omnifocus_git_param(:accounts, "github").split(/\s+/).map { |account|
14
26
  endpoints = {}
15
27
  endpoints[:api] = omnifocus_git_param(:api, nil, account)
16
28
  endpoints[:web] = omnifocus_git_param(:web, nil, account)
@@ -30,57 +42,53 @@ module OmniFocus::Github
30
42
 
31
43
  auth[:name] = auth[:user] if auth[:name].nil?
32
44
 
33
- processed = true
34
- account_label = account == "github" ? nil : account
35
-
36
- process(account_label, gh_client(account, auth, endpoints))
37
- end
45
+ client = nil
38
46
 
39
- raise "No accounts authenticated. Bailing." unless processed
40
- end
47
+ if account != "github"
48
+ if endpoints[:api] && endpoints[:web]
49
+ Octokit.configure do |c|
50
+ c.api_endpoint = endpoints[:api]
51
+ c.web_endpoint = endpoints[:web]
52
+ end
53
+ else
54
+ raise ArgumentError, "api and web endpoint configs required for github enterprise"
55
+ end
56
+ end
41
57
 
42
- def omnifocus_git_param name, default = nil, prefix = "omnifocus-github"
43
- param = `git config #{prefix}.#{name}`.chomp
44
- param.empty? ? default : param
45
- end
58
+ if auth[:user] && auth[:password]
59
+ client = Octokit::Client.new(:login => auth[:user],
60
+ :password => auth[:password])
46
61
 
47
- def gh_client account, auth, endpoints
48
- if account != "github"
49
- if endpoints[:api] && endpoints[:web]
50
- Octokit.configure do |c|
51
- c.api_endpoint = endpoints[:api]
52
- c.web_endpoint = endpoints[:web]
53
- end
62
+ client.user auth[:name]
63
+ elsif auth[:user] && auth[:oauth]
64
+ client = Octokit::Client.new :access_token => auth[:oauth]
65
+ client.user.login
54
66
  else
55
- raise ArgumentError, "api and web endpoint configs required for github enterprise"
67
+ raise ArgumentError, "Missing authentication"
56
68
  end
57
- end
58
69
 
59
- if auth[:user] && auth[:password]
60
- client = Octokit::Client.new(:login => auth[:user],
61
- :password => auth[:password])
70
+ [account, client]
71
+ }.to_h
72
+ end
62
73
 
63
- client.user(auth[:name])
64
- elsif auth[:user] && auth[:oauth]
65
- client = Octokit::Client.new :access_token => auth[:oauth]
66
- client.user.login
67
- else
68
- raise ArgumentError, "Missing authentication"
69
- end
70
- client
74
+ def omnifocus_git_param name, default = nil, prefix = "omnifocus-github"
75
+ param = `git config #{prefix}.#{name}`.chomp
76
+ param.empty? ? default : param
71
77
  end
72
78
 
73
- def process account, client
79
+ def process prefix, client
74
80
  client.list_issues.each do |issue|
75
81
  pr = issue["pull_request"] && !issue["pull_request"]["diff_url"].nil?
76
82
  number = issue.number
77
83
  project = issue.repository.full_name.split("/").last
78
- ticket_id = "#{PREFIX}-#{project}##{number}"
84
+ ticket_id = "#{prefix}-#{project}##{number}"
79
85
  title = "#{ticket_id}: #{pr ? "[PR] " : ""}#{issue["title"]}"
80
86
  # HACK
81
87
  url = "https://github.com/#{issue.repository.full_name}/issues/#{number}"
82
88
  note = "#{url}\n\n#{issue["body"]}"
83
89
 
90
+ next if excluded_projects.include? project
91
+
84
92
  if existing[ticket_id] then
85
93
  bug_db[project][ticket_id] = true
86
94
  next
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnifocus-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
8
8
  - aja
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - |
13
13
  -----BEGIN CERTIFICATE-----
14
- MIIDPjCCAiagAwIBAgIBBDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
+ MIIDPjCCAiagAwIBAgIBBjANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
15
15
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
16
- GRYDY29tMB4XDTE5MTIxMzAwMDIwNFoXDTIwMTIxMjAwMDIwNFowRTETMBEGA1UE
16
+ GRYDY29tMB4XDTIxMTIyMzIzMTkwNFoXDTIyMTIyMzIzMTkwNFowRTETMBEGA1UE
17
17
  AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
18
18
  JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
19
19
  b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
@@ -23,14 +23,14 @@ cert_chain:
23
23
  qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
24
24
  gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
25
25
  HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
26
- AQCkkcHqAa6IKLYGl93rn78J3L+LnqyxaA059n4IGMHWN5bv9KBQnIjOrpLadtYZ
27
- vhWkunWDKdfVapBEq5+T4HzqnsEXC3aCv6JEKJY6Zw7iSzl0M8hozuzRr+w46wvT
28
- fV2yTN6QTVxqbMsJJyjosks4ZdQYov2zdvQpt1HsLi+Qmckmg8SPZsd+T8uiiBCf
29
- b+1ORSM5eEfBQenPXy83LZcoQz8i6zVB4aAfTGGdhxjoMGUEmSZ6xpkOzmnGa9QK
30
- m5x9IDiApM+vCELNwDXXGNFEnQBBK+wAe4Pek8o1V1TTOxL1kGPewVOitX1p3xoN
31
- h7iEjga8iM1LbZUfiISZ+WrB
26
+ AQCKB5jfsuSnKb+t/Wrh3UpdkmX7TrEsjVmERC0pPqzQ5GQJgmEXDD7oMgaKXaAq
27
+ x2m+KSZDrqk7c8uho5OX6YMqg4KdxehfSLqqTZGoeV78qwf/jpPQZKTf+W9gUSJh
28
+ zsWpo4K50MP+QtdSbKXZwjAafpQ8hK0MnnZ/aeCsW9ov5vdXpYbf3dpg6ADXRGE7
29
+ lQY2y1tJ5/chqu6h7dQmnm2ABUqx9O+JcN9hbCYoA5i/EeubUEtFIh2w3SpO6YfB
30
+ JFmxn4h9YO/pVdB962BdBNNDia0kgIjI3ENnkLq0dKpYU3+F3KhEuTksLO0L6X/V
31
+ YsuyUzsMz6GQA4khyaMgKNSD
32
32
  -----END CERTIFICATE-----
33
- date: 2019-12-16 00:00:00.000000000 Z
33
+ date: 2022-09-28 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: omnifocus
@@ -38,14 +38,14 @@ dependencies:
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '2.5'
41
+ version: '2.6'
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '2.5'
48
+ version: '2.6'
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: octokit
51
51
  requirement: !ruby/object:Gem::Requirement
@@ -86,27 +86,43 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.20'
89
+ version: '3.25'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.20'
97
- description: "Plugin for omnifocus gem to provide github BTS synchronization.\n\nSupport
98
- for Github Enterprise:\n\nIn your git config, set the key github.accounts to a space\nseparated
99
- list of github accounts. \n\n git config --global github.accounts \"github myghe\"\n\nFor
100
- each account API and web end points and authentication information \nshould be stored
101
- in the git config under a key matching the\naccount. For example:\n\n git config
102
- --global github.user me\n git config --global github.password mypassword\n git
103
- config --global myghe.api https://ghe.mydomain.com/api/v3\n git config --global
104
- myghe.api https://ghe.mydomain.com/\n\nFor each account can you specify the following
105
- parameters:\n\n* api - specify an API endpoint other than\n https://api.github.com.
106
- This is so you can point this at your Github\n Enterprise endpoint.\n\n* web -
107
- specify an API endpoint other than https://www.github.com. This\n is so you can
108
- point this at your Github Enterprise endpoint\n\n* user, password - A username and
109
- password pair for Basic http authentication."
96
+ version: '3.25'
97
+ description: |-
98
+ Plugin for omnifocus gem to provide github BTS synchronization.
99
+
100
+ Support for Github Enterprise:
101
+
102
+ In your git config, set the key github.accounts to a space
103
+ separated list of github accounts.
104
+
105
+ git config --global github.accounts "github myghe"
106
+
107
+ For each account API and web end points and authentication information
108
+ should be stored in the git config under a key matching the
109
+ account. For example:
110
+
111
+ git config --global github.user me
112
+ git config --global github.password mypassword
113
+ git config --global myghe.api https://ghe.mydomain.com/api/v3
114
+ git config --global myghe.api https://ghe.mydomain.com/
115
+
116
+ For each account can you specify the following parameters:
117
+
118
+ * api - specify an API endpoint other than
119
+ https://api.github.com. This is so you can point this at your Github
120
+ Enterprise endpoint.
121
+
122
+ * web - specify an API endpoint other than https://www.github.com. This
123
+ is so you can point this at your Github Enterprise endpoint
124
+
125
+ * user, password - A username and password pair for Basic http authentication.
110
126
  email:
111
127
  - ryand-ruby@zenspider.com
112
128
  - kushali@rubyforge.org
@@ -128,7 +144,7 @@ licenses:
128
144
  - MIT
129
145
  metadata:
130
146
  homepage_uri: https://github.com/seattlerb/omnifocus-github
131
- post_install_message:
147
+ post_install_message:
132
148
  rdoc_options:
133
149
  - "--main"
134
150
  - README.rdoc
@@ -145,8 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
161
  - !ruby/object:Gem::Version
146
162
  version: '0'
147
163
  requirements: []
148
- rubygems_version: 3.0.3
149
- signing_key:
164
+ rubygems_version: 3.3.12
165
+ signing_key:
150
166
  specification_version: 4
151
167
  summary: Plugin for omnifocus gem to provide github BTS synchronization
152
168
  test_files: []
metadata.gz.sig CHANGED
Binary file