Sha256: 7f15548028929688f6b699e393ed188e68aeff1e4b9a4369b34b80cc9b07b018
Contents?: true
Size: 849 Bytes
Versions: 17
Compression:
Stored size: 849 Bytes
Contents
class Licensee class FilesystemRepository def initialize(path) @path = path end def last_commit() self end def tree return to_enum(__method__) unless block_given? Dir.entries(@path).each do |name| filename = File.join @path, name next if File.directory? filename yield(:name => name, :type => :blob, :oid => filename) end end def lookup(filename) Blob.new File.read(filename) end Blob = Struct.new(:content) do def size content.size end def similarity(other) self.hashsig ? Rugged::Blob::HashSignature.compare(self.hashsig, other) : 0 end def hashsig(options = 0) @hashsig ||= Rugged::Blob::HashSignature.new(content, options) rescue Rugged::InvalidError nil end end end end
Version data entries
17 entries across 17 versions & 1 rubygems