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, options) ⇒ Checkout

Returns a new instance of Checkout.



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

def initialize(issue_no, options)
  @issue_no = issue_no
  @base_branch = options["base"]
  @branch_prefix = options["prefix"]
  @fetched = false
end

Instance Method Details

#processObject



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

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