github_workflow 0.2.2 → 0.2.7

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: 307771fd0758e0b0292a89dc57daa128566fc32dbdd20efad4bb5a9b7a852b61
4
- data.tar.gz: c8d10657e90c9a8deb360bf0e3c5140d95480899390241475d6a325783164085
3
+ metadata.gz: dd34e7ccc61455fbd20b4a44a595b4c67bceb681e5a0000b225f0742dedcf782
4
+ data.tar.gz: a19510e84f70f050fe68aa366fb1f77f9c25fdb2d6f7d47f434956870f2b07b6
5
5
  SHA512:
6
- metadata.gz: 2eb9b2a7c39fa17f8a8385040898f344250e6713e283fb04cd644df82375bde3f2bab8ee0c713c9be54c62aaa5fe7787886558c60727a445a96b23ed07ec7704
7
- data.tar.gz: 7cc78a223f6c19aff626724cb35cec95237525a4fc98e7e9086a7c02ce380639dcb71a4dcb59d3cfcd2110736338245b48b91738924c9fa1663cbf78d7199a38
6
+ metadata.gz: 43a75473f684b1f26a292d16162d3af8378f6c62f3a88e16769baba38ded0cdfcb2c5b8f7448f0d7040d56fda55073622c5671097b42d643bd6f55e36b814c9c
7
+ data.tar.gz: 4499e70d105b351700d8b1c43bd1941a38a85db21f678b9cbfae8f11d340b956efee3c92e5f928c9241c07edbd6b5940df0071130b7c267f1a7273d686568a96
@@ -1 +1 @@
1
- 2.5.3
1
+ 2.6.6
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "thor", "~> 0.19"
20
+ spec.add_dependency "thor", "~> 1.0.1"
21
21
  spec.add_dependency "faraday", "~> 0.11"
22
22
  spec.add_dependency "terminal-table", "~> 1.5"
23
23
  spec.add_dependency "ruby-trello", "~> 2.1"
@@ -182,7 +182,7 @@ module GithubWorkflow
182
182
  title: trello_card.name,
183
183
  body: issue_body_from_trello_card,
184
184
  assignees: [current_github_username],
185
- labels: issue_labels_from_trello_card
185
+ labels: trello_card.labels.map(&:name)
186
186
  }
187
187
 
188
188
  response = JSON.parse(github_client.post("repos/#{user_and_repo}/issues?access_token=#{oauth_token}", issue_params.to_json).body)
@@ -191,38 +191,35 @@ module GithubWorkflow
191
191
  end
192
192
 
193
193
  def issue_body_from_trello_card
194
- deploy_note = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "Deploy Note" }.value["text"]
195
-
196
- body = <<~BODY
197
- #{trello_card.desc}
198
-
199
- **Deploy Note:** #{deploy_note}
200
- BODY
194
+ [trello_card.desc, trello_deploy_note, trello_product_review_type, trello_pm].compact.join("\n\n")
201
195
  end
202
196
 
203
- def current_github_username
204
- JSON.parse(github_client.get("user?access_token=#{oauth_token}").body)["login"]
197
+ def trello_pm
198
+ custom_field = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "PM" }
199
+
200
+ if custom_field.present?
201
+ "**Responsible:** #{custom_field.option_value['text']}"
202
+ end
205
203
  end
206
204
 
207
- def issue_labels_from_trello_card
208
- labels = trello_card.labels.map(&:name)
205
+ def trello_deploy_note
206
+ custom_field = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "Deploy Note" }
209
207
 
210
- product_review_type = trello_card.custom_field_items.detect do |cfi|
211
- cfi.custom_field.name == "Product Review"
208
+ if custom_field.present?
209
+ "**Deploy Note:** #{custom_field.value['text']}"
212
210
  end
211
+ end
213
212
 
214
- if product_review_type && ["Review App", "Screenshot"].include?(product_review_type.option_value["text"])
215
- labels << "Product Review Required"
216
- end
213
+ def trello_product_review_type
214
+ custom_field = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "Product Review" }
217
215
 
218
- priority = trello_card.custom_field_items.detect do |cfi|
219
- cfi.custom_field.name == "Priority"
216
+ if custom_field.present?
217
+ "**Product Review:** #{custom_field.option_value['text']}"
220
218
  end
219
+ end
221
220
 
222
- if priority && priority.option_value["text"].present?
223
- priority_titleized = priority.option_value["text"]
224
- labels << "Priority: #{priority_titleized}"
225
- end
221
+ def current_github_username
222
+ JSON.parse(github_client.get("user?access_token=#{oauth_token}").body)["login"]
226
223
  end
227
224
 
228
225
  def set_trello_card
@@ -234,6 +231,7 @@ module GithubWorkflow
234
231
  def trello_card
235
232
  @trello_card
236
233
  end
234
+
237
235
  def ensure_github_config_present
238
236
  unless project_config && project_config["oauth_token"] && project_config["user_and_repo"]
239
237
  failure('Please add `.github` file containing `{ "oauth_token": "TOKEN", "user_and_repo": "user/repo" }`')
@@ -1,3 +1,3 @@
1
1
  module GithubWorkflow
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.7"
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.2.2
4
+ version: 0.2.7
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: 2019-10-15 00:00:00.000000000 Z
11
+ date: 2020-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.19'
19
+ version: 1.0.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.19'
26
+ version: 1.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '10.0'
111
- description:
111
+ description:
112
112
  email:
113
113
  - bliscio@daisybill.com
114
114
  executables:
@@ -129,7 +129,7 @@ homepage: https://github.com/daisybill/github_workflow
129
129
  licenses:
130
130
  - MIT
131
131
  metadata: {}
132
- post_install_message:
132
+ post_install_message:
133
133
  rdoc_options: []
134
134
  require_paths:
135
135
  - lib
@@ -144,9 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubyforge_project:
148
- rubygems_version: 2.7.6
149
- signing_key:
147
+ rubygems_version: 3.0.3
148
+ signing_key:
150
149
  specification_version: 4
151
150
  summary: DaisyBill's internal github workflows
152
151
  test_files: []