class Sync

Public Instance Methods

cmd() click to toggle source

Returns a command appropriate for executing at the command line.

# File lib/git-utils/sync.rb, line 15
def cmd
  branch = self.known_options.first || default_branch
  c = ["git checkout #{branch}"]
  c << "git pull"
  c << "git checkout #{current_branch}"
  c.join("\n")
end
parser() click to toggle source
# File lib/git-utils/sync.rb, line 5
def parser
  OptionParser.new do |opts|
    opts.banner = "Usage: git sync [branch]"
    opts.on_tail("-h", "--help", "this usage guide") do
      puts opts.to_s; exit 0
    end
  end
end