git_helper 3.2.2 → 3.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +134 -0
  4. data/Guardfile +3 -1
  5. data/README.md +10 -5
  6. data/Rakefile +2 -0
  7. data/bin/git-helper +24 -12
  8. data/lib/git_helper.rb +6 -2
  9. data/lib/git_helper/change_remote.rb +15 -6
  10. data/lib/git_helper/checkout_default.rb +2 -0
  11. data/lib/git_helper/clean_branches.rb +2 -0
  12. data/lib/git_helper/code_request.rb +33 -19
  13. data/lib/git_helper/empty_commit.rb +2 -0
  14. data/lib/git_helper/forget_local_commits.rb +2 -0
  15. data/lib/git_helper/git_config_reader.rb +12 -6
  16. data/lib/git_helper/gitlab_client.rb +2 -0
  17. data/lib/git_helper/local_code.rb +18 -8
  18. data/lib/git_helper/merge_request.rb +90 -70
  19. data/lib/git_helper/new_branch.rb +4 -2
  20. data/lib/git_helper/octokit_client.rb +2 -0
  21. data/lib/git_helper/pull_request.rb +97 -66
  22. data/lib/git_helper/setup.rb +116 -0
  23. data/lib/git_helper/version.rb +3 -1
  24. data/spec/git_helper/change_remote_spec.rb +24 -24
  25. data/spec/git_helper/checkout_default_spec.rb +2 -0
  26. data/spec/git_helper/clean_branches_spec.rb +2 -0
  27. data/spec/git_helper/code_request_spec.rb +31 -28
  28. data/spec/git_helper/empty_commit_spec.rb +2 -0
  29. data/spec/git_helper/forget_local_commits_spec.rb +2 -0
  30. data/spec/git_helper/git_config_reader_spec.rb +32 -4
  31. data/spec/git_helper/gitlab_client_spec.rb +2 -0
  32. data/spec/git_helper/local_code_spec.rb +2 -0
  33. data/spec/git_helper/merge_request_spec.rb +24 -23
  34. data/spec/git_helper/new_branch_spec.rb +10 -8
  35. data/spec/git_helper/octokit_client_spec.rb +2 -0
  36. data/spec/git_helper/pull_request_spec.rb +20 -18
  37. data/spec/git_helper/setup_spec.rb +183 -0
  38. data/spec/spec_helper.rb +4 -1
  39. metadata +38 -9
  40. data/lib/git_helper/highline_cli.rb +0 -33
  41. data/spec/git_helper/highline_cli_spec.rb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0278ec1bcdeffdfc4ff94dcb4853f0d0d9a37c99799d90ab04cb0b59af49d7aa'
4
- data.tar.gz: ac395aad1492142aba911277e492eb49dd97345e40f81910eed0692618f973a7
3
+ metadata.gz: 8dc9aca4ddec9f8038f5083b2790b10ac48b8293de15c37fb8a153b76ca0ce23
4
+ data.tar.gz: e2be8c7950de2fe93e7b44b0b3c50118dd8bd34494237f435c69cdbc775ef7e9
5
5
  SHA512:
6
- metadata.gz: 73cedc8f831a0fea6543fe78fa877eeeba394a43c2f5bd038b65d30a71f6830964c40c23dc3aeb0c4056130d1ffe9ceb14c021eb181f2bd3007eaa9c2533e891
7
- data.tar.gz: 14d32de16eaf5cd1579464afbaf6c1068514f1cbbaf7c94eeddc3d1fd44b224a94cb93f29f60ec4918d292a7fdde1c326068c0e093848a51dc36f4305599c458
6
+ metadata.gz: '029e8998214a94ff639bed8faa0a90bf94eca320a7989effab17b845918df911718512f40dd74e563faf347162723fb9e39b9a02ba0b20477183f4eb4b1d1d71'
7
+ data.tar.gz: ef184720792c6dc8f361674eabdf7e9972e905f2c835b06ecbbe4b952bdd9eab94c42e644663b6be38222688982c8ff2b0fc958a6899b9eb0a2c3ce2afb77547
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,134 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ git_helper (3.3.4)
5
+ gitlab (~> 4.16)
6
+ gli (~> 2.13)
7
+ highline_wrapper (~> 0.1.0)
8
+ octokit (~> 4.18)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.7.0)
14
+ public_suffix (>= 2.0.2, < 5.0)
15
+ ast (2.4.2)
16
+ coderay (1.1.3)
17
+ concurrent-ruby (1.1.8)
18
+ diff-lcs (1.4.4)
19
+ faker (2.16.0)
20
+ i18n (>= 1.6, < 2)
21
+ faraday (1.3.0)
22
+ faraday-net_http (~> 1.0)
23
+ multipart-post (>= 1.2, < 3)
24
+ ruby2_keywords
25
+ faraday-net_http (1.0.1)
26
+ ffi (1.14.2)
27
+ formatador (0.2.5)
28
+ gitlab (4.17.0)
29
+ httparty (~> 0.18)
30
+ terminal-table (~> 1.5, >= 1.5.1)
31
+ gli (2.20.0)
32
+ guard (2.16.2)
33
+ formatador (>= 0.2.4)
34
+ listen (>= 2.7, < 4.0)
35
+ lumberjack (>= 1.0.12, < 2.0)
36
+ nenv (~> 0.1)
37
+ notiffany (~> 0.0)
38
+ pry (>= 0.9.12)
39
+ shellany (~> 0.0)
40
+ thor (>= 0.18.1)
41
+ guard-compat (1.2.1)
42
+ guard-rspec (4.7.3)
43
+ guard (~> 2.1)
44
+ guard-compat (~> 1.1)
45
+ rspec (>= 2.99.0, < 4.0)
46
+ highline (2.0.3)
47
+ highline_wrapper (0.1.0)
48
+ highline (~> 2.0)
49
+ httparty (0.18.1)
50
+ mime-types (~> 3.0)
51
+ multi_xml (>= 0.5.2)
52
+ i18n (1.8.9)
53
+ concurrent-ruby (~> 1.0)
54
+ listen (3.4.1)
55
+ rb-fsevent (~> 0.10, >= 0.10.3)
56
+ rb-inotify (~> 0.9, >= 0.9.10)
57
+ lumberjack (1.2.8)
58
+ method_source (1.0.0)
59
+ mime-types (3.3.1)
60
+ mime-types-data (~> 3.2015)
61
+ mime-types-data (3.2021.0225)
62
+ multi_xml (0.6.0)
63
+ multipart-post (2.1.1)
64
+ nenv (0.3.0)
65
+ notiffany (0.1.3)
66
+ nenv (~> 0.1)
67
+ shellany (~> 0.0)
68
+ octokit (4.20.0)
69
+ faraday (>= 0.9)
70
+ sawyer (~> 0.8.0, >= 0.5.3)
71
+ parallel (1.20.1)
72
+ parser (3.0.0.0)
73
+ ast (~> 2.4.1)
74
+ pry (0.14.0)
75
+ coderay (~> 1.1)
76
+ method_source (~> 1.0)
77
+ public_suffix (4.0.6)
78
+ rainbow (3.0.0)
79
+ rake (13.0.3)
80
+ rb-fsevent (0.10.4)
81
+ rb-inotify (0.10.1)
82
+ ffi (~> 1.0)
83
+ regexp_parser (2.1.1)
84
+ rexml (3.2.4)
85
+ rspec (3.10.0)
86
+ rspec-core (~> 3.10.0)
87
+ rspec-expectations (~> 3.10.0)
88
+ rspec-mocks (~> 3.10.0)
89
+ rspec-core (3.10.1)
90
+ rspec-support (~> 3.10.0)
91
+ rspec-expectations (3.10.1)
92
+ diff-lcs (>= 1.2.0, < 2.0)
93
+ rspec-support (~> 3.10.0)
94
+ rspec-mocks (3.10.2)
95
+ diff-lcs (>= 1.2.0, < 2.0)
96
+ rspec-support (~> 3.10.0)
97
+ rspec-support (3.10.2)
98
+ rubocop (1.11.0)
99
+ parallel (~> 1.10)
100
+ parser (>= 3.0.0.0)
101
+ rainbow (>= 2.2.2, < 4.0)
102
+ regexp_parser (>= 1.8, < 3.0)
103
+ rexml
104
+ rubocop-ast (>= 1.2.0, < 2.0)
105
+ ruby-progressbar (~> 1.7)
106
+ unicode-display_width (>= 1.4.0, < 3.0)
107
+ rubocop-ast (1.4.1)
108
+ parser (>= 2.7.1.5)
109
+ ruby-progressbar (1.11.0)
110
+ ruby2_keywords (0.0.4)
111
+ sawyer (0.8.2)
112
+ addressable (>= 2.3.5)
113
+ faraday (> 0.8, < 2.0)
114
+ shellany (0.0.1)
115
+ terminal-table (1.8.0)
116
+ unicode-display_width (~> 1.1, >= 1.1.1)
117
+ thor (1.1.0)
118
+ unicode-display_width (1.7.0)
119
+
120
+ PLATFORMS
121
+ x86_64-darwin-20
122
+
123
+ DEPENDENCIES
124
+ bundler (~> 2.2)
125
+ faker (~> 2.15)
126
+ git_helper!
127
+ guard-rspec (~> 4.3)
128
+ pry (~> 0.13)
129
+ rake (~> 13.0)
130
+ rspec (~> 3.9)
131
+ rubocop (~> 1.10)
132
+
133
+ BUNDLED WITH
134
+ 2.2.4
data/Guardfile CHANGED
@@ -1,4 +1,6 @@
1
- guard :rspec, cmd: 'bundle exec rspec', all_on_start: true do
1
+ # frozen_string_literal: true
2
+
3
+ guard :rspec, cmd: 'bundle exec rspec', all_on_start: true do
2
4
  watch(%r{^spec/.+_spec\.rb$})
3
5
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
6
  watch('spec/spec_helper.rb') { 'spec' }
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # git_helper [![Maintainability](https://api.codeclimate.com/v1/badges/bf27d608257c202930c4/maintainability)](https://codeclimate.com/github/emmahsax/git_helper/maintainability) [![Main](https://github.com/emmahsax/git_helper/actions/workflows/main.yml/badge.svg)](https://github.com/emmahsax/git_helper/actions/workflows/main.yml)
1
+ # git_helper [![Main](https://github.com/emmahsax/git_helper/actions/workflows/main.yml/badge.svg)](https://github.com/emmahsax/git_helper/actions/workflows/main.yml)
2
2
 
3
3
  ## Gem Usage
4
4
 
@@ -27,6 +27,11 @@ To see what version of git_helper you're running, run:
27
27
  git-helper --version
28
28
  ```
29
29
 
30
+ To help you create the `~/.git_helper/config.yml` file and set up the plugins (see below), run this command and allow the command to walk you through the prompts:
31
+ ```bash
32
+ git-helper setup
33
+ ```
34
+
30
35
  ## Plugin Usage
31
36
 
32
37
  As an additional option, you can set each of the following commands to be a git plugin, meaning you can call them in a way that feels even more git-native:
@@ -46,7 +51,7 @@ unzip path/to/downloaded/plugins.zip -d ~/.git_helper
46
51
 
47
52
  Now, the plugins will live in `~/.git_helper/plugins/*`. Add the following line to your `~/.bash_profile`:
48
53
 
49
- ```
54
+ ```bash
50
55
  export PATH=/path/to/computer/home/.git_helper/plugins:$PATH
51
56
  ```
52
57
 
@@ -110,7 +115,7 @@ git-helper clean-branches
110
115
 
111
116
  ### `code-request`
112
117
 
113
- This command can be used to handily make new GitHub/GitLab pull/merge requests from the command line. The command uses either the [`Octokit::Client`](https://octokit.github.io/octokit.rb/Octokit/Client.html) or [`Gitlab` client](https://github.com/NARKOZ/gitlab) to do this, so make sure you have a `~/.git_helper/config.yml` file set up in the home directory of your computer. For instructions on how to do that, see [Gem Usage](#gem-usage).
118
+ This command can be used to handily make new GitHub/GitLab pull/merge requests from the command-line. The command uses either the [`Octokit::Client`](https://octokit.github.io/octokit.rb/Octokit/Client.html) or [`Gitlab` client](https://github.com/NARKOZ/gitlab) to do this, so make sure you have a `~/.git_helper/config.yml` file set up in the home directory of your computer. For instructions on how to do that, see [Gem Usage](#gem-usage).
114
119
 
115
120
  After setup is complete, you can call the command like this:
116
121
 
@@ -144,7 +149,7 @@ git-helper forget-local-commits
144
149
 
145
150
  ### `merge-code-request`
146
151
 
147
- This command can be used to merge pull/merge requests from the command line. The command uses either the [`Octokit::Client`](https://octokit.github.io/octokit.rb/Octokit/Client.html) or [`Gitlab` client](https://github.com/NARKOZ/gitlab) to do this, so make sure you have a `~/.git_helper/config.yml` file set up in the home directory of your computer. For instructions on how to do that, see [Gem Usage](#gem-usage).
152
+ This command can be used to merge pull/merge requests from the command-line. The command uses either the [`Octokit::Client`](https://octokit.github.io/octokit.rb/Octokit/Client.html) or [`Gitlab` client](https://github.com/NARKOZ/gitlab) to do this, so make sure you have a `~/.git_helper/config.yml` file set up in the home directory of your computer. For instructions on how to do that, see [Gem Usage](#gem-usage).
148
153
 
149
154
  After setup is complete, you can call the proper command like this:
150
155
 
@@ -161,7 +166,7 @@ For GitLab, the command will use whatever squash/source branch deletion/etc sett
161
166
 
162
167
  ### `new-branch`
163
168
 
164
- This command is useful for making new branches in a repository on the command line. To run the command, run:
169
+ This command is useful for making new branches in a repository on the command-line. To run the command, run:
165
170
 
166
171
  ```bash
167
172
  git-helper new-branch
data/Rakefile CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
data/bin/git-helper CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  require 'rubygems'
3
5
  require 'gli'
4
6
  require_relative '../lib/git_helper'
@@ -11,46 +13,54 @@ version GitHelper::VERSION
11
13
  autocomplete_commands false
12
14
  wrap_help_text :verbatim
13
15
 
14
- program_long_desc """
16
+ program_long_desc "
15
17
  DOCUMENTATION
16
18
  For documentation and help in setting up your Git configuration files,
17
19
  see Git Helper's GitHub repo: https://github.com/emmahsax/git_helper
18
- """
20
+ "
21
+
22
+ desc 'Sets up Git Helper configs at ~/.git_helper/*'
23
+ command 'setup' do |c|
24
+ c.action do
25
+ GitHelper::Setup.new.execute
26
+ end
27
+ end
19
28
 
20
29
  arg :old_owner
21
30
  arg :new_owner
22
31
  desc "Update a repository's remote URLs from an old GitHub owner to a new owner."
23
32
  command 'change-remote' do |c|
24
- c.action do |global_options, options, args|
33
+ c.action do |_global_options, _options, args|
25
34
  raise ArgumentError, 'You must specify an old owner and a new owner' unless args.count == 2
35
+
26
36
  GitHelper::ChangeRemote.new(args[0], args[1]).execute
27
37
  end
28
38
  end
29
39
 
30
40
  desc 'Checks out the default branch of a repo based on the local remote branches.'
31
41
  command 'checkout-default' do |c|
32
- c.action do |global_options, options, args|
42
+ c.action do |_global_options, _options, _args|
33
43
  GitHelper::CheckoutDefault.new.execute
34
44
  end
35
45
  end
36
46
 
37
47
  desc "Clean a repository's git branches."
38
48
  command 'clean-branches' do |c|
39
- c.action do |global_options, options, args|
49
+ c.action do |_global_options, _options, _args|
40
50
  GitHelper::CleanBranches.new.execute
41
51
  end
42
52
  end
43
53
 
44
54
  desc 'Creates an empty commit with a basic commit message.'
45
55
  command 'empty-commit' do |c|
46
- c.action do |global_options, options, args|
56
+ c.action do |_global_options, _options, _args|
47
57
  GitHelper::EmptyCommit.new.execute
48
58
  end
49
59
  end
50
60
 
51
61
  desc 'Reset your local git commits to origin/HEAD.'
52
62
  command 'forget-local-commits' do |c|
53
- c.action do |global_options, options, args|
63
+ c.action do |_global_options, _options, _args|
54
64
  GitHelper::ForgetLocalCommits.new.execute
55
65
  end
56
66
  end
@@ -58,21 +68,23 @@ end
58
68
  arg :new_branch_name, optional: true
59
69
  desc 'Create a new branch for features, bug fixes, or experimentation.'
60
70
  command 'new-branch' do |c|
61
- c.action do |global_options, options, args|
71
+ c.action do |_global_options, _options, args|
62
72
  GitHelper::NewBranch.new.execute(args[0])
63
73
  end
64
74
  end
65
75
 
66
- desc 'Merge a GitHub/GitLab pull/merge request. The command will figure out whether your code project belongs to GitHub or GitLab.'
76
+ desc 'Merge a GitHub/GitLab pull/merge request. The command will figure out whether your ' \
77
+ 'code project belongs to GitHub or GitLab.'
67
78
  command 'merge-code-request' do |c|
68
- c.action do |global_options, options, args|
79
+ c.action do |_global_options, _options, _args|
69
80
  GitHelper::CodeRequest.new.merge
70
81
  end
71
82
  end
72
83
 
73
- desc 'Create a GitHub/GitLab pull/merge request from the current branch. The command will figure out whether your code project belongs to GitHub or GitLab.'
84
+ desc 'Create a GitHub/GitLab pull/merge request from the current branch. The command will figure ' \
85
+ 'out whether your code project belongs to GitHub or GitLab.'
74
86
  command 'code-request' do |c|
75
- c.action do |global_options, options, args|
87
+ c.action do |_global_options, _options, _args|
76
88
  GitHelper::CodeRequest.new.create
77
89
  end
78
90
  end
data/lib/git_helper.rb CHANGED
@@ -1,9 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'gitlab'
3
- require 'highline'
5
+ require 'highline_wrapper'
4
6
  require 'octokit'
5
7
 
6
- Dir[File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), 'git_helper')) + '/**/*.rb'].each do |file|
8
+ files = "#{File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), 'git_helper'))}/**/*.rb"
9
+
10
+ Dir[files].each do |file|
7
11
  require_relative file
8
12
  end
9
13
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GitHelper
2
4
  class ChangeRemote
3
5
  attr_accessor :old_owner, :new_owner
@@ -11,7 +13,7 @@ module GitHelper
11
13
  original_dir = Dir.pwd
12
14
  nested_dirs = Dir.entries(original_dir).select do |entry|
13
15
  entry_dir = File.join(original_dir, entry)
14
- File.directory?(entry_dir) && !(entry == '.' || entry == '..')
16
+ File.directory?(entry_dir) && !['.', '..'].include?(entry)
15
17
  end
16
18
 
17
19
  nested_dirs.each do |nested_dir|
@@ -22,8 +24,11 @@ module GitHelper
22
24
  private def process_dir(current_dir, original_dir)
23
25
  Dir.chdir(current_dir)
24
26
 
25
- if File.exist?('.git')
26
- process_git_repository if cli.ask_yes_no("Found git directory: #{current_dir}. Do you wish to proceed in updating #{current_dir}'s remote URLs? (y/n)")
27
+ if File.exist?('.git') && highline.ask_yes_no(
28
+ "Found git directory: #{current_dir}. Do you wish to proceed in updating #{current_dir}'s remote URLs? (y/n)",
29
+ { required: true }
30
+ )
31
+ process_git_repository
27
32
  end
28
33
 
29
34
  Dir.chdir(original_dir)
@@ -37,9 +42,11 @@ module GitHelper
37
42
  puts " Found remote is not pointing to #{old_owner}."
38
43
  end
39
44
  end
40
- puts "\n"
45
+ puts
41
46
  end
42
47
 
48
+ # rubocop:disable Metrics/AbcSize
49
+ # rubocop:disable Metrics/MethodLength
43
50
  private def process_remote(remote)
44
51
  remote_name = local_code.remote_name(remote)
45
52
 
@@ -56,13 +63,15 @@ module GitHelper
56
63
  puts " Changing the remote URL #{remote_name} to be '#{remote_url}'."
57
64
  local_code.change_remote(remote_name, remote_url)
58
65
  end
66
+ # rubocop:enable Metrics/MethodLength
67
+ # rubocop:enable Metrics/AbcSize
59
68
 
60
69
  private def local_code
61
70
  @local_code ||= GitHelper::LocalCode.new
62
71
  end
63
72
 
64
- private def cli
65
- @cli ||= GitHelper::HighlineCli.new
73
+ private def highline
74
+ @highline ||= HighlineWrapper.new
66
75
  end
67
76
  end
68
77
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GitHelper
2
4
  class CheckoutDefault
3
5
  def execute
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GitHelper
2
4
  class CleanBranches
3
5
  def execute
@@ -1,10 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GitHelper
2
4
  class CodeRequest
3
5
  def create
4
- process_project.create({
5
- base_branch: base_branch,
6
- new_title: new_code_request_title
7
- })
6
+ process_project.create(
7
+ {
8
+ base_branch: base_branch,
9
+ new_title: new_code_request_title
10
+ }
11
+ )
8
12
  end
9
13
 
10
14
  def merge
@@ -23,8 +27,14 @@ module GitHelper
23
27
  end
24
28
  end
25
29
 
30
+ # rubocop:disable Metrics/MethodLength
26
31
  private def ask_for_clarification
27
- resp = cli.ask('Found git remotes for both GitHub and GitLab. Would you like to proceed with GitLab or GitHub? (github/gitlab)').downcase
32
+ resp = highline.ask(
33
+ 'Found git remotes for both GitHub and GitLab. Would you like to proceed ' \
34
+ 'with GitLab or GitHub? (github/gitlab)',
35
+ { required: true }
36
+ ).downcase
37
+
28
38
  if resp.include?('hub')
29
39
  github_pull_request
30
40
  elsif resp.include?('lab')
@@ -34,6 +44,7 @@ module GitHelper
34
44
  exit
35
45
  end
36
46
  end
47
+ # rubocop:enable Metrics/MethodLength
37
48
 
38
49
  private def github_pull_request
39
50
  @github_pull_request ||= GitHelper::GitHubPullRequest.new(options)
@@ -48,7 +59,7 @@ module GitHelper
48
59
  local_project: local_project,
49
60
  local_branch: local_branch,
50
61
  local_code: local_code,
51
- cli: cli
62
+ highline: highline
52
63
  }
53
64
  end
54
65
 
@@ -61,11 +72,12 @@ module GitHelper
61
72
  end
62
73
 
63
74
  private def base_branch
64
- @base_branch ||= if cli.ask_yes_no("Is '#{default_branch}' the correct base branch for your new code request? (y/n)")
65
- default_branch
66
- else
67
- cli.ask('Base branch?')
68
- end
75
+ @base_branch ||=
76
+ if highline.ask_yes_no("Is '#{default_branch}' the correct base branch for your new code request? (y/n)")
77
+ default_branch
78
+ else
79
+ highline.ask('Base branch?', { required: true })
80
+ end
69
81
  end
70
82
 
71
83
  private def local_branch
@@ -77,16 +89,18 @@ module GitHelper
77
89
  end
78
90
 
79
91
  private def new_code_request_title
80
- @new_code_request_title ||= if autogenerated_title &&
81
- cli.ask_yes_no("Accept the autogenerated code request title '#{autogenerated_title}'? (y/n)")
82
- autogenerated_title
83
- else
84
- cli.ask('Title?')
85
- end
92
+ @new_code_request_title ||=
93
+ if autogenerated_title && highline.ask_yes_no(
94
+ "Accept the autogenerated code request title '#{autogenerated_title}'? (y/n)"
95
+ )
96
+ autogenerated_title
97
+ else
98
+ highline.ask('Title?', { required: true })
99
+ end
86
100
  end
87
101
 
88
- private def cli
89
- @cli ||= GitHelper::HighlineCli.new
102
+ private def highline
103
+ @highline ||= HighlineWrapper.new
90
104
  end
91
105
 
92
106
  private def local_code