Class: FlightPlanCli::Commands::Checkout

Inherits:
Object
  • Object
show all
Includes:
FlightPlanCli::Config
Defined in:
lib/flight_plan_cli/commands/checkout.rb

Instance Method Summary collapse

Constructor Details

#initializeCheckout

Returns a new instance of Checkout.



6
7
8
# File 'lib/flight_plan_cli/commands/checkout.rb', line 6

def initialize
  read_config
end

Instance Method Details

#process(issue) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/flight_plan_cli/commands/checkout.rb', line 10

def process(issue)
  puts "Checking out branch for #{issue}"
  local_branch_for(issue) ||
    remote_branch_for(issue) ||
    new_branch_for(issue)
rescue Rugged::CheckoutError => e
  puts "Unable to checkout: #{e.message}".red
end