Sha256: b1c70a962ff5267f82ed65d175cf18e4b4324ab0907c748ff78fa416f0b5a8b7
Contents?: true
Size: 886 Bytes
Versions: 45
Compression:
Stored size: 886 Bytes
Contents
module Rugged class Repository def attributes(path, options = {}) Attributes.new(self, path, options) end class Attributes include Enumerable LOAD_PRIORITIES = { [:file, :index] => 0, [:index, :file] => 1, [:index] => 2, } def self.parse_opts(opt) flags = LOAD_PRIORITIES[opt[:priority]] || 0 flags |= 4 if opt[:skip_system] flags end def initialize(repository, path, options = {}) @repository = repository @path = path @load_flags = Attributes.parse_opts(options) end def [](attribute) @repository.fetch_attributes(@path, attribute, @load_flags) end def to_h @hash ||= @repository.fetch_attributes(@path, nil, @load_flags) end def each(&block) to_h.each(&block) end end end end
Version data entries
45 entries across 45 versions & 2 rubygems