Sha256: 272f29d36f717912d70c2c3cbbf61e8ebd5da49d74669548d4d68b548196d260
Contents?: true
Size: 451 Bytes
Versions: 18
Compression:
Stored size: 451 Bytes
Contents
require 'grit' include Grit module Heirloom class GitDirectory def initialize(args) @path = args[:path] end def commit(sha = nil) return false unless repo if sha commit = repo.commits(sha) commit ? commit.first : false else repo.commits.first end end private def repo Repo.new @path rescue Grit::InvalidGitRepositoryError false end end end
Version data entries
18 entries across 18 versions & 1 rubygems