github_workflow 0.2.1 → 0.2.2

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: 55ebb9696749b3ac5c22709018fb93c37b4d1b5139c74982a16a7bf73ec4064e
4
- data.tar.gz: e6611ec7194f8b84a40131e22b38e3e90e780239f4e213ed116b4dbe21d78d92
3
+ metadata.gz: 307771fd0758e0b0292a89dc57daa128566fc32dbdd20efad4bb5a9b7a852b61
4
+ data.tar.gz: c8d10657e90c9a8deb360bf0e3c5140d95480899390241475d6a325783164085
5
5
  SHA512:
6
- metadata.gz: d11c9780519efa02def540d5b57e35a7b7709ff3bff552b9c023c64b75fa80eaf00e7ed12cc3658bfba6147ce4f440714d02b93e46303f402cba3f0d9fe86b95
7
- data.tar.gz: d285e65f232ec8a3b82176442e5c7e2fd4f7a0ff2d674ee3f7120b4cd23d658d19c0dc9c0f10f437d103b2b043a5c07295ea21704f3012fcbcb2e8f5e6b8d746
6
+ metadata.gz: 2eb9b2a7c39fa17f8a8385040898f344250e6713e283fb04cd644df82375bde3f2bab8ee0c713c9be54c62aaa5fe7787886558c60727a445a96b23ed07ec7704
7
+ data.tar.gz: 7cc78a223f6c19aff626724cb35cec95237525a4fc98e7e9086a7c02ce380639dcb71a4dcb59d3cfcd2110736338245b48b91738924c9fa1663cbf78d7199a38
@@ -150,8 +150,31 @@ module GithubWorkflow
150
150
  stash_pop
151
151
  end
152
152
 
153
-
154
153
  no_tasks do
154
+ def get_issue(id)
155
+ JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{id}?access_token=#{oauth_token}").body)
156
+ end
157
+
158
+ def get_pr(id)
159
+ JSON.parse(github_client.get("repos/#{user_and_repo}/pulls/#{id}?access_token=#{oauth_token}").body)
160
+ end
161
+
162
+ def get_prs_list
163
+ JSON.parse(github_client.get("repos/#{user_and_repo}/pulls?access_token=#{oauth_token}&per_page=100").body)
164
+ end
165
+
166
+ def create_branch
167
+ `git checkout -b #{branch_name_for_issue_number}`
168
+ end
169
+
170
+ def ensure_origin_exists
171
+ Open3.capture2("git rev-parse --abbrev-ref --symbolic-full-name @{u}").tap do |_, status|
172
+ unless status.success?
173
+ failure("Upstream branch does not exist. Please set before creating pull request. E.g., `git push -u origin branch_name`")
174
+ end
175
+ end
176
+ end
177
+
155
178
  def create_issue_from_trello_card
156
179
  say_info("Creating issue")
157
180
 
@@ -208,32 +231,9 @@ module GithubWorkflow
208
231
  @trello_card = trello_board.cards.detect { |card| card.short_id == options["card_number"].to_i }
209
232
  end
210
233
 
211
- attr_reader :trello_card
212
-
213
- def get_issue(id)
214
- JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{id}?access_token=#{oauth_token}").body)
215
- end
216
-
217
- def get_pr(id)
218
- JSON.parse(github_client.get("repos/#{user_and_repo}/pulls/#{id}?access_token=#{oauth_token}").body)
219
- end
220
-
221
- def get_prs_list
222
- JSON.parse(github_client.get("repos/#{user_and_repo}/pulls?access_token=#{oauth_token}&per_page=100").body)
223
- end
224
-
225
- def create_branch
226
- `git checkout -b #{branch_name_for_issue_number}`
227
- end
228
-
229
- def ensure_origin_exists
230
- Open3.capture2("git rev-parse --abbrev-ref --symbolic-full-name @{u}").tap do |_, status|
231
- unless status.success?
232
- failure("Upstream branch does not exist. Please set before creating pull request. E.g., `git push -u origin branch_name`")
233
- end
234
- end
234
+ def trello_card
235
+ @trello_card
235
236
  end
236
-
237
237
  def ensure_github_config_present
238
238
  unless project_config && project_config["oauth_token"] && project_config["user_and_repo"]
239
239
  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.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Liscio