class Worktree::CLI

Public Class Methods

exit_on_failure?() click to toggle source
# File lib/worktree/cli.rb, line 8
def self.exit_on_failure?
  true
end

Public Instance Methods

cherry_pick(commit) click to toggle source
# File lib/worktree/cli.rb, line 48
def cherry_pick(commit)
  Worktree::Command::CherryPick.new(commit,
                                    to: options[:to],
                                    project_dir: options[:project_dir]).do!
end
configure() click to toggle source
# File lib/worktree/cli.rb, line 55
def configure
  Worktree::Command::Configure.new.do!
end
init(uri) click to toggle source
# File lib/worktree/cli.rb, line 61
def init(uri)
  Worktree::Command::Init.new(uri,
                              repo_path: options[:repo_path]).do!
end
new(branch) click to toggle source
# File lib/worktree/cli.rb, line 15
def new(branch)
  Worktree::Command::Add.new(branch,
                             from: options[:from],
                             project_dir: options[:project_dir]).do!
end
open(branch) click to toggle source
# File lib/worktree/cli.rb, line 23
def open(branch)
  Worktree::Command::Open.new(branch,
                              project_dir: options[:project_dir]).do!
end
remove(*branches) click to toggle source
# File lib/worktree/cli.rb, line 30
def remove(*branches)
  branches.each do |b|
    Worktree::Command::Remove.new(b,
                                  project_dir: options[:project_dir]).do!
  end
end
remove_stale() click to toggle source
# File lib/worktree/cli.rb, line 39
def remove_stale
  Worktree::Command::RemoveStale.new(project_dir: options[:project_dir]).do!
rescue TTY::Reader::InputInterrupt
  Worktree.logger.info { "You've interrupted removing of stale branches!" }
end