class QMK::Git

Public Class Methods

new(repo_path) click to toggle source
# File lib/git.rb, line 3
def initialize(repo_path)
  @repo_path = repo_path
end

Public Instance Methods

checkout_latest_tag() click to toggle source
# File lib/git.rb, line 24
def checkout_latest_tag
  `git checkout #{latest_tag}`
end
clean() click to toggle source
# File lib/git.rb, line 32
def clean
  `git checkout .`
  `git clean -df`
end
clone(repo) click to toggle source
# File lib/git.rb, line 15
def clone(repo)
  ensure_path_exists
  `git clone #{repo} #{@repo_path}`
end
ensure_path_exists() click to toggle source
# File lib/git.rb, line 11
def ensure_path_exists
  `mkdir -p #{@repo_path}`
end
fetch_origin() click to toggle source
# File lib/git.rb, line 20
def fetch_origin
  `git fetch origin master`
end
in_repo(&block) click to toggle source
# File lib/git.rb, line 37
def in_repo(&block)
  Dir.chdir @repo_path, &block
end
latest_tag() click to toggle source
# File lib/git.rb, line 28
def latest_tag
  `git describe --tags $(git rev-list --tags --max-count=1)`
end
path() click to toggle source
# File lib/git.rb, line 7
def path
  @repo_path
end