Class: Toolshed::Commands::CreatePullRequest
- Defined in:
- lib/toolshed/commands/create_pull_request.rb
Overview
Allow a user to create pull request based on information in .toolshedrc and prompts
Instance Attribute Summary collapse
-
#git_tool ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#pull_request_body ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#pull_request_title ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#pull_request_url ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#ticket_id ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#ticket_tracker ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#ticket_tracker_class ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#ticket_tracker_project_id ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#ticket_tracking_title ⇒ Object
rubocop:disable ClassLength, LineLength.
-
#ticket_tracking_url ⇒ Object
rubocop:disable ClassLength, LineLength.
Class Method Summary collapse
-
.cli_options ⇒ Object
rubocop:disable Metrics/MethodLength.
Instance Method Summary collapse
- #branch ⇒ Object
- #execute(_args, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ CreatePullRequest
constructor
A new instance of CreatePullRequest.
Methods inherited from Base
parse, #read_user_input, #read_user_input_body, #read_user_input_password, #read_user_input_title, #use_project_id, #use_ticket_tracker_by_type, #use_ticket_tracker_project_id, #use_ticket_tracker_project_name
Constructor Details
#initialize(options = {}) ⇒ CreatePullRequest
Returns a new instance of CreatePullRequest.
15 16 17 18 19 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 15 def initialize( = {}) super() self.ticket_tracker_class = nil self.pull_request_url = '' end |
Instance Attribute Details
#git_tool ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def git_tool @git_tool end |
#pull_request_body ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def pull_request_body @pull_request_body end |
#pull_request_title ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def pull_request_title @pull_request_title end |
#pull_request_url ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def pull_request_url @pull_request_url end |
#ticket_id ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def ticket_id @ticket_id end |
#ticket_tracker ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def ticket_tracker @ticket_tracker end |
#ticket_tracker_class ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def ticket_tracker_class @ticket_tracker_class end |
#ticket_tracker_project_id ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def ticket_tracker_project_id @ticket_tracker_project_id end |
#ticket_tracking_title ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def ticket_tracking_title @ticket_tracking_title end |
#ticket_tracking_url ⇒ Object
rubocop:disable ClassLength, LineLength
9 10 11 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 9 def ticket_tracking_url @ticket_tracking_url end |
Class Method Details
.cli_options ⇒ Object
rubocop:disable Metrics/MethodLength
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 21 def self. # rubocop:disable Metrics/MethodLength { banner: 'Usage: push_branch [options]', options: { tool: { short_on: '-a' }, ticket_system: { short_on: '-m' }, use_defaults: { short_on: '-d' }, title: { short_on: '-t' }, body: { short_on: '-b' }, skip_ticket: { short_on: '-s', default: true } } } end |
Instance Method Details
#branch ⇒ Object
48 49 50 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 48 def branch @branch ||= Toolshed::Git::Branch.new end |
#execute(_args, options = {}) ⇒ Object
52 53 54 55 56 |
# File 'lib/toolshed/commands/create_pull_request.rb', line 52 def execute(_args, = {}) = execute_ticket_tracking() execute_pull_request() unless .nil? end |