omnifocus-github 1.9.0 → 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: 33de15bbd7d3a7f67dbb3bdaee2a0c7e6e450760226661751521b9f7027db900
4
- data.tar.gz: cbb1e9c80d0d536fbff4b182a85a81d413b1e84653add6d75eb002fafe2ab466
3
+ metadata.gz: 5d40c0e432d4783144432c7f703e64a0f0140b2fdd015400fd1995d3ac495276
4
+ data.tar.gz: eb73e87311e83ae8d27e7106f998c6e987a585b775f48e34e11ddea58e0402ba
5
5
  SHA512:
6
- metadata.gz: b96afcbf082d5096f0c016778964174a086ac9c5eed04d913e6100cf948f09e1e91a7b937c0d6b37d7c3d4220145b5fda09921089556f07d172c518066479223
7
- data.tar.gz: 7c476a4bb8af78f029b87feb8e1b9d67b696e4921b6fecdc97bfaee6cb0969d2c83f1c4b153c2a07d1bdec86840c80526a68a6d9a2b82c54b7f4ef2d82d94510
6
+ metadata.gz: d821c4bde4f20d0580cbd0c53b908fc853b1c0e78b5bc95c51fcacdf4f8329880a8e2e57bf96c47403ac5462194954595616dc7a222ca41437251df862f4a62b
7
+ data.tar.gz: c3389bc17a46a8ec7735f8242954496bf4cc6f7056e42db2b089941ac62057fe041722fec8842a9f097d0fbd1a5157b2c8f387df8034309bdd3f5f6b2336aefd
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,14 @@
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
+
1
12
  === 1.9.0 / 2020-02-12
2
13
 
3
14
  * 2 minor enhancements:
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
 
@@ -5,12 +5,24 @@ $-w = old_w
5
5
  Octokit.auto_paginate = true
6
6
 
7
7
  module OmniFocus::Github
8
- VERSION = "1.9.0"
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,52 +42,46 @@ 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}"
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.9.0
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: 2020-02-13 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
@@ -86,27 +86,43 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.22'
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.22'
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