Method: Gitgo::Index#initialize
- Defined in:
- lib/gitgo/index.rb
#initialize(path) ⇒ Index
Returns a new instance of Index.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/gitgo/index.rb', line 97 def initialize(path) @path = path @head_file = File.(HEAD, path) @map_file = File.(MAP, path) @list_file = File.(LIST, path) @cache = Hash.new do |key_hash, key| key_hash[key] = Hash.new do |value_hash, value| value_hash[value] = begin index = self.path(FILTER, key, value) File.file?(index) ? IdxFile.read(index) : [] end end end end |