renuo-cli 4.12.5 → 4.12.6

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: cb089838847d3e871d4c69c297526be53f6bfec676c569d8174850bf4267af05
4
- data.tar.gz: 5d3b23815c62f42da356377a7d55fc8711038be4ef5155747d742da58b23775a
3
+ metadata.gz: cc1e483675fe27a637d7dbab7839a890fc3c6d320a64b0305d275db0b1b2b21b
4
+ data.tar.gz: cf23d18a9f11e7b3323076725f30e1afa2d8a46a92008e62d9eb3aaf7667ea42
5
5
  SHA512:
6
- metadata.gz: 2ea986c463a96c03700be7ec907ed195ff3f5fbce7c902980babb259127e27853aa742e4c3edef1f7d7c0afc0fbf1e5a9d3405994897721c76d3373f55403f14
7
- data.tar.gz: a277e02ea19717543af354096130ff1c01797f7a6de40aa6960e0d92ccefde1d26f79368d4a40d668f185533f4fd3ad398b9f3bc13517ce93d6c79e959e4f00d
6
+ metadata.gz: 4ed942e771d06088afc396d1c2926e34b1a01edc67577c404b046ddd3aa93d404445784d1efaae209cfc99b428898042423362d5b93cce78af12720a3d68bed0
7
+ data.tar.gz: afd9b796ab99c51e4a726e420398210126a5be91b10be744698565edcb83083520fe904a37b2ec8873924403ea0152bd421ed5b43586c627ecee152c5425859f
@@ -9,26 +9,35 @@ class Renuo::Cli::Commands::CreatePr
9
9
  c.option "--title <title>", String, "The title of the pull request (optional)"
10
10
  c.option "--redmine-ticket <number>", Integer, "The redmine ticket number (optional)"
11
11
  c.option "--draft", "Mark the PR as draft"
12
+ c.option "--[no-]web-create", "Open web browser to create a pull request (default: true)"
12
13
  c.example "Create a PR with the title 'Implement XYZ'",
13
14
  "renuo create-pr --title 'Implement XYZ'"
14
- c.action { |_, options| new.run(options) }
15
+ c.action do |_, options|
16
+ options.default web_create: true
17
+ new.run(options)
18
+ end
15
19
  end
16
20
 
17
21
  def run(opts)
22
+ create_pr(opts)
23
+ open_pr_in_browser unless opts.web_create
24
+ end
25
+
26
+ private
27
+
28
+ def create_pr(opts)
18
29
  command = [
19
30
  "gh pr create",
20
31
  "--assignee @me",
21
32
  pr_title(opts),
22
33
  "--body \"#{pr_body(opts)}\"",
23
- "--web",
34
+ ("--web" if opts.web_create),
24
35
  ("--draft" if opts.draft)
25
36
  ].compact.join(" ")
26
37
 
27
38
  puts `#{command}`
28
39
  end
29
40
 
30
- private
31
-
32
41
  def pr_title(opts)
33
42
  opts.title ? "--title \"#{opts.title}\"" : "--fill"
34
43
  end
@@ -44,4 +53,8 @@ class Renuo::Cli::Commands::CreatePr
44
53
  current_branch = `git branch --show-current`.strip
45
54
  opts.redmine_ticket || current_branch.match(/(\d+)/)&.captures&.first
46
55
  end
56
+
57
+ def open_pr_in_browser
58
+ puts `gh pr view --web`
59
+ end
47
60
  end
@@ -3,7 +3,7 @@
3
3
  # :nocov:
4
4
  module Renuo
5
5
  class Cli
6
- VERSION = "4.12.5"
6
+ VERSION = "4.12.6"
7
7
  NAME = "renuo-cli"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renuo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.5
4
+ version: 4.12.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renuo AG