class Cp8Cli::Commands::Suggest

Public Instance Methods

run() click to toggle source
# File lib/cp8_cli/commands/suggest.rb, line 5
def run
  cache_original_branch

  suggestion_branch.checkout
  suggestion_branch.push
  pull_request.open

  original_branch.checkout
  original_branch.reset
end

Private Instance Methods

cache_original_branch() click to toggle source
# File lib/cp8_cli/commands/suggest.rb, line 18
def cache_original_branch
  original_branch # Keep reference for later
end
original_branch() click to toggle source
# File lib/cp8_cli/commands/suggest.rb, line 22
def original_branch
  @_original_branch ||= Branch.current
end
pull_request() click to toggle source
# File lib/cp8_cli/commands/suggest.rb, line 30
def pull_request
  Github::PullRequest.new(
    from: suggestion_branch,
    to: original_branch,
    expand: nil
  )
end
suggestion_branch() click to toggle source
# File lib/cp8_cli/commands/suggest.rb, line 26
def suggestion_branch
  @_suggestion_branch ||= Branch.suggestion
end