renuo-cli 4.7.0 → 4.7.1

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: 267952952d37a267fa02cfb82918927cde5127ed27cde56826a87cf87446faf2
4
- data.tar.gz: 9dbc20c994af13f8458cf9668dbccda3f91490d4cff6cab2069eaf4363d90137
3
+ metadata.gz: dfd554a0dc6c1e7a71d712c41a9e01f7d8a22f23e756fabf620b02b3fef3d912
4
+ data.tar.gz: 788aab9b1d5eae0fd0cdbc8cec536e69761128749d553d426488218946a16d25
5
5
  SHA512:
6
- metadata.gz: ade65a29e9197e8672ff964c067bedb0d43b973725e420f7d66abe1ab93b00b7dda716ecde26c570d3b81f4d10129dafae0c05c2918159219d413b9d66c4d075
7
- data.tar.gz: 2ad6c9fc136289afa61d737059ff7856cb80bdca7112cfa6ac8eafd8b5baffdddc69f2ddfc1e3a2dec6b332bbded850eb8c9a7886510571a97419dcd31b4f9d2
6
+ metadata.gz: 7dc15ca3ddc34b94b1e7a0d2b8b628d94a7f01a04089f60a25d025e87dd148bb48801065e1f07d60754b1cb3e9e85b929d2726b9f9edb3a937cfd976f9175666
7
+ data.tar.gz: eedd47ddb8f4c8e607fe6d94adfd51de86d12decc94cb97ba24287f2cf838317aaa37ba234f7ebad7d6a454e9d420c0062cc93df4b502d30cddd7a427b5d5181
@@ -2,18 +2,25 @@
2
2
 
3
3
  class GithubPullRequestCreator
4
4
  def run(opts)
5
- validate_options(opts)
6
5
  create_pr(opts)
7
6
  end
8
7
 
9
8
  private
10
9
 
11
- def validate_options(opts)
12
- abort ">> specify a title" unless opts.title
10
+ def create_pr(opts)
11
+ command = [
12
+ "gh pr create",
13
+ "--assignee @me",
14
+ pr_title(opts),
15
+ "--body \"#{pr_body(opts)}\"",
16
+ ("--draft" if opts.draft)
17
+ ].compact.join(" ")
18
+
19
+ puts `#{command}`
13
20
  end
14
21
 
15
- def create_pr(opts)
16
- puts `gh pr create --assignee @me --title "#{opts.title}" --body "#{pr_body(opts)}" #{opts.draft ? "--draft" : ""}`
22
+ def pr_title(opts)
23
+ opts.title ? "--title \"#{opts.title}\"" : "--fill"
17
24
  end
18
25
 
19
26
  def pr_body(opts)
@@ -25,6 +32,6 @@ class GithubPullRequestCreator
25
32
 
26
33
  def redmine_ticket_number(opts)
27
34
  current_branch = `git branch --show-current`.strip
28
- current_branch.match(/(\d+)/)&.captures&.first || opts.redmine_ticket
35
+ opts.redmine_ticket || current_branch.match(/(\d+)/)&.captures&.first
29
36
  end
30
37
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Renuo
4
4
  module Cli
5
- VERSION = "4.7.0"
5
+ VERSION = "4.7.1"
6
6
  NAME = "renuo-cli"
7
7
  end
8
8
  end
data/lib/renuo/cli.rb CHANGED
@@ -319,7 +319,7 @@ module Renuo
319
319
  c.summary = "Creates a PR for the current branch"
320
320
  c.description = "Creates a PR, assigns it to you and automatically inserts the Redmine ticket number into " \
321
321
  "the PR body"
322
- c.option "--title <title>", String, "The title of the pull request"
322
+ c.option "--title <title>", String, "The title of the pull request (optional)"
323
323
  c.option "--redmine-ticket <number>", Integer, "The redmine ticket number (optional)"
324
324
  c.option "--draft", "Mark the PR as draft"
325
325
  c.example "Create a PR with the title 'Implement XYZ'",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renuo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.0
4
+ version: 4.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renuo AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-04 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource