Sha256: 09a753ad9787d350c7d276e76855836676fb595a855f00bce27889d526162fa3
Contents?: true
Size: 576 Bytes
Versions: 39
Compression:
Stored size: 576 Bytes
Contents
module Awsborn class GitBranch attr_reader :branch def initialize (branch) require 'git' @branch = branch end def file (path) path, file = File.split(path) repo = Git.open(root) tree = repo.branches[branch].gcommit.gtree path.each { |dir| tree = tree.subtrees[dir] } tree.blobs[file].contents end protected def root dir = File.expand_path('.') while dir != '/' return dir if File.directory?(File.join(dir, '.git')) dir = File.dirname(dir) end end end end
Version data entries
39 entries across 39 versions & 1 rubygems