Sha256: 73a55f98e6fb80f629793e7518a412a32e73eb584d7e2cd0bed73a1875ac91da
Contents?: true
Size: 824 Bytes
Versions: 10
Compression:
Stored size: 824 Bytes
Contents
module GitObjectBrowser module Models class PackedRefs def initialize(input) @content = input.read(nil) input.seek(0) @entries = [] while (line = input.gets) do next if line =~ /\A\s*#/ next unless line =~ /(\^)?([0-9a-f]{40})\s*(.*)/ sha1 = $2 ref = $3 if $1 entry = @entries.last entry[:tag_sha1] = sha1 if entry else entry = {} entry[:sha1] = sha1 entry[:ref] = ref @entries << entry end end end def to_hash return { :entries => @entries, :content => @content } end def self.path?(relpath) return relpath == "packed-refs" end end end end
Version data entries
10 entries across 10 versions & 1 rubygems