Class: Abt::Providers::Git::Commands::Branch

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/abt/providers/git/commands/branch.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#ari, #cli, #flags

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseCommand

flags, #initialize

Constructor Details

This class inherits a constructor from Abt::BaseCommand

Class Method Details

.descriptionObject



12
13
14
# File 'lib/abt/providers/git/commands/branch.rb', line 12

def self.description
  "Switch branch. Uses a compatible scheme to generate the branch-name: E.g. `abt branch git asana`"
end

.usageObject



8
9
10
# File 'lib/abt/providers/git/commands/branch.rb', line 8

def self.usage
  "abt branch git <scheme>[:<path>]"
end

Instance Method Details

#performObject



16
17
18
19
# File 'lib/abt/providers/git/commands/branch.rb', line 16

def perform
  switch || create_and_switch
  warn("Switched to #{branch_name}")
end