github_workflow 0.3.8 → 0.3.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7580dc54bf377d2f933a99075f5beceeea72dafa7e762a0f115d778d5cc7f9a1
4
- data.tar.gz: f4904e4822f7d8cdc055055a9042ed7fbed11e7dbc1731fdc3b0a355a64f1b1b
3
+ metadata.gz: c0d0091f831042df6bf6521994c7e84ec07b330acf6bb0441032a10cd74cb8b0
4
+ data.tar.gz: 9a47a0432865d512d66b180b6b53ca7758738d9573aaa56065279c2d5bc9d80e
5
5
  SHA512:
6
- metadata.gz: ec90ff6d6108c21ddb5af9e380dd5b81140dbb1f648daf392594417f4553c534190ea33c9b3e4d0c5b5e5743fb5bf4e28e2367c9826d567f1b237e54c29c5558
7
- data.tar.gz: d646ba0cbc3e72e5616968a23c53a2fc0714a74b1f8bdb143bb8aa9f636826b339ba304892b3faa206d3ace8be0e4c64487795349f77e0f1844587104bf8d728
6
+ metadata.gz: e68ef334f027cc1c297af90396cfef2da209d2011ff138359a9d5774b50ad0a3325240dc94636f33083e5072138a5e2b5c63738ef2a7ef9ef8fee8634601aaf8
7
+ data.tar.gz: ffb8cdd1ac843d06894310e226cf42e11a2bc0fc2976e5489e069e0ceff972aa325f7e7fa82067a6ba7fa14ee77f407029abe4a965912367f674e73e41e25223
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 2.7.4
data/README.md CHANGED
@@ -1,3 +1,19 @@
1
+ # Configuration
2
+
3
+ Each repository should contain its own config (`.github_workflow`), which should look like this:
4
+ ```
5
+ {
6
+ "oauth_token": "TOKEN",
7
+ "user_and_repo": "ORG/REPO",
8
+ "trello_key": "KEY",
9
+ "trello_token": "TOKEN",
10
+ "trello_board_id": "BOARD_ID",
11
+ "trello_platform_board_id": "BOARD_ID"
12
+ }
13
+ ```
14
+ Optionally, all general information except `user_and_repo` could be extracted to global config in your home directory
15
+ with the same name (~/.github_workflow)
16
+
1
17
  # Github Workflow
2
18
 
3
19
  ```
@@ -10,7 +10,7 @@ require "trello"
10
10
  module GithubWorkflow
11
11
  class Cli < Thor
12
12
  PROCEED_TEXT = "Proceed? [y,yes]: ".freeze
13
-
13
+ CONFIG_FILE_NAME = ".github_workflow".freeze
14
14
  GITHUB_CONFIG = <<~TEXT
15
15
  {
16
16
  "oauth_token": "TOKEN",
@@ -262,7 +262,7 @@ module GithubWorkflow
262
262
  end
263
263
 
264
264
  def ensure_github_config_present
265
- if project_config.nil? || (JSON.parse(GITHUB_CONFIG).keys - project_config.keys).any?
265
+ if (JSON.parse(GITHUB_CONFIG).keys - project_config.keys).any?
266
266
  failure("Please add `.github_workflow` file containing:\n#{GITHUB_CONFIG}")
267
267
  end
268
268
  end
@@ -275,7 +275,15 @@ module GithubWorkflow
275
275
  end
276
276
 
277
277
  def project_config
278
- @project_config ||= JSON.parse(File.read(".github_workflow")) rescue nil
278
+ @project_config ||=
279
+ begin
280
+ global_config_path = Pathname.new(Dir.home).join(CONFIG_FILE_NAME)
281
+ result = File.exists?(global_config_path) ? JSON.parse(File.read(global_config_path)) : {}
282
+ local_config_data = JSON.parse(File.read(CONFIG_FILE_NAME))
283
+ result.merge(local_config_data)
284
+ rescue
285
+ {}
286
+ end
279
287
  end
280
288
 
281
289
  def oauth_token
@@ -1,3 +1,3 @@
1
1
  module GithubWorkflow
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Liscio
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-01 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -114,7 +114,7 @@ dependencies:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: '10.0'
117
- description:
117
+ description:
118
118
  email:
119
119
  - bliscio@daisybill.com
120
120
  executables:
@@ -135,7 +135,7 @@ homepage: https://github.com/daisybill/github_workflow
135
135
  licenses:
136
136
  - MIT
137
137
  metadata: {}
138
- post_install_message:
138
+ post_install_message:
139
139
  rdoc_options: []
140
140
  require_paths:
141
141
  - lib
@@ -150,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubygems_version: 3.1.4
154
- signing_key:
153
+ rubygems_version: 3.1.6
154
+ signing_key:
155
155
  specification_version: 4
156
156
  summary: DaisyBill's internal github workflows
157
157
  test_files: []