Class: GitHelper::HighlineCli
- Inherits:
-
Object
- Object
- GitHelper::HighlineCli
- Defined in:
- lib/git_helper/highline_cli.rb
Instance Method Summary collapse
- #accept_autogenerated_title?(autogenerated_title) ⇒ Boolean
- #apply_template?(template_file_name) ⇒ Boolean
- #base_branch ⇒ Object
- #base_branch_default?(default_branch) ⇒ Boolean
- #merge_method(merge_options) ⇒ Object
- #merge_request_id ⇒ Object
- #new_branch_name ⇒ Object
- #pull_request_id ⇒ Object
- #remove_source_branch? ⇒ Boolean
- #squash_merge_request? ⇒ Boolean
- #template_to_apply(template_options, request_type) ⇒ Object
- #title ⇒ Object
Instance Method Details
#accept_autogenerated_title?(autogenerated_title) ⇒ Boolean
25 26 27 28 29 |
# File 'lib/git_helper/highline_cli.rb', line 25 def accept_autogenerated_title?(autogenerated_title) return false unless autogenerated_title answer = ask("Accept the autogenerated merge request title '#{autogenerated_title}'? (y/n)") !!(answer =~ /^y/i) end |
#apply_template?(template_file_name) ⇒ Boolean
51 52 53 54 |
# File 'lib/git_helper/highline_cli.rb', line 51 def apply_template?(template_file_name) answer = ask("Apply the merge request template from #{template_file_name}? (y/n)") !!(answer =~ /^y/i) end |
#base_branch ⇒ Object
13 14 15 |
# File 'lib/git_helper/highline_cli.rb', line 13 def base_branch ask('Base branch?') end |
#base_branch_default?(default_branch) ⇒ Boolean
31 32 33 34 |
# File 'lib/git_helper/highline_cli.rb', line 31 def base_branch_default?(default_branch) answer = ask("Is '#{default_branch}' the correct base branch for your new merge request? (y/n)") !!(answer =~ /^y/i) end |
#merge_method(merge_options) ⇒ Object
46 47 48 49 |
# File 'lib/git_helper/highline_cli.rb', line 46 def merge_method() index = ("Merge method?", ) [index] end |
#merge_request_id ⇒ Object
17 18 19 |
# File 'lib/git_helper/highline_cli.rb', line 17 def merge_request_id ask('Merge Request ID?') end |
#new_branch_name ⇒ Object
5 6 7 |
# File 'lib/git_helper/highline_cli.rb', line 5 def new_branch_name ask('New branch name?') end |
#pull_request_id ⇒ Object
21 22 23 |
# File 'lib/git_helper/highline_cli.rb', line 21 def pull_request_id ask('Pull Request ID?') end |
#remove_source_branch? ⇒ Boolean
41 42 43 44 |
# File 'lib/git_helper/highline_cli.rb', line 41 def remove_source_branch? answer = ask('Remove source branch after merging? (y/n)') !!(answer =~ /^y/i) end |
#squash_merge_request? ⇒ Boolean
36 37 38 39 |
# File 'lib/git_helper/highline_cli.rb', line 36 def squash_merge_request? answer = ask('Squash merge request? (y/n)') !!(answer =~ /^y/i) end |
#template_to_apply(template_options, request_type) ⇒ Object
56 57 58 59 60 |
# File 'lib/git_helper/highline_cli.rb', line 56 def template_to_apply(, request_type) = << 'None' index = ("Which #{request_type} request template should be applied?", ) [index] end |
#title ⇒ Object
9 10 11 |
# File 'lib/git_helper/highline_cli.rb', line 9 def title ask('Title?') end |