module Texico::Git

Public Instance Methods

init(target, initial_commit = false) click to toggle source
# File lib/texico/git.rb, line 6
def init(target, initial_commit = false)
  if initial_commit
    system "git init '#{target}' && git -C '#{target}' add . " \
           "&& git -C '#{target}' commit -m 'Initial commit'"
  else
    system "git init '#{target}'"
  end
end
list_tags(target) click to toggle source
# File lib/texico/git.rb, line 21
def list_tags(target)
  Open3.popen2 "git -C '#{target}' tag -l" do |_, stdout, _|
    stdout.each_line.map { |line| line.chomp }
  end
end
tag(target, label, message) click to toggle source
# File lib/texico/git.rb, line 16
def tag(target, label, message)
  system "git -C '#{target}' tag -a #{label} -m '#{message}'"
end