Class: Toolshed::Commands::PushBranch

Inherits:
Base
  • Object
show all
Defined in:
lib/toolshed/commands/push_branch.rb

Class Method Summary collapse

Instance Method Summary collapse

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 = {}) ⇒ PushBranch

Returns a new instance of PushBranch.



5
6
7
# File 'lib/toolshed/commands/push_branch.rb', line 5

def initialize(options = {})
  super(options)
end

Class Method Details

.cli_optionsObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/toolshed/commands/push_branch.rb', line 9

def self.cli_options
  {
    banner: 'Usage: push_branch [options]',
    options: {
      force_command: {
        short_on: '-f',
        default: true
      },
      branch_name: {
        short_on: '-b'
      }
    }
  }
end

Instance Method Details

#execute(args, options = {}) ⇒ Object



24
25
26
27
28
29
# File 'lib/toolshed/commands/push_branch.rb', line 24

def execute(args, options = {})
  Toolshed.logger.info "Running toolshed push_branch with #{options.inspect}"
  branch = Toolshed::Git::Branch.new(options)
  branch.push
  Toolshed.die
end