class GitObjectBrowser::Models::PackFile
signature 4bytes PACK version 4bytes objects number 4bytes object entries -> packed_object.rb
github.com/git/git/blob/master/Documentation/technical/pack-format.txt
Public Class Methods
new(input)
click to toggle source
Calls superclass method
GitObjectBrowser::Models::Bindata::new
# File lib/git-object-browser/models/pack_file.rb, line 14 def initialize(input) super(input) end
path?(relpath)
click to toggle source
# File lib/git-object-browser/models/pack_file.rb, line 18 def self.path?(relpath) return relpath =~ %r{\Aobjects/pack/pack-[0-9a-f]{40}\.pack\z} end
Public Instance Methods
parse()
click to toggle source
# File lib/git-object-browser/models/pack_file.rb, line 22 def parse signature = raw(4) raise 'wrong signature' if signature != 'PACK' @version = int @object_number = int self end
to_hash()
click to toggle source
# File lib/git-object-browser/models/pack_file.rb, line 30 def to_hash return { :version => @version, :object_number => @object_number } end