Class: FlightPlanCli::Commands::Checkout

Inherits:
Object
  • Object
show all
Includes:
FlightPlanCli::Clients::FlightPlan, FlightPlanCli::Clients::Git
Defined in:
lib/flight_plan_cli/commands/checkout.rb

Instance Method Summary collapse

Methods included from FlightPlanCli::Clients::FlightPlan

#flight_plan

Methods included from FlightPlanCli::Clients::Git

#git

Constructor Details

#initialize(issue_no) ⇒ Checkout

Returns a new instance of Checkout.



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

def initialize(issue_no)
  @issue_no = issue_no
  @fetched = false
end

Instance Method Details

#processObject



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

def process
  local_branch_for_issue || remote_branch_for_issue || new_branch_for_issue
rescue Git::GitExecuteError => e
  puts 'Unable to checkout'.red
  puts e.message.yellow
end