class TTNT::MetaData

Constants

STORAGE_SECTION

Public Class Methods

new(repo, sha = nil) click to toggle source

@param repo [Rugged::Repository] @param sha [String] sha of commit which metadata is read from.

nil means to read from current working tree. See {Storage} for more.
# File lib/ttnt/metadata.rb, line 10
def initialize(repo, sha = nil)
  @storage = Storage.new(repo, sha)
  read!
end

Public Instance Methods

[](name) click to toggle source
# File lib/ttnt/metadata.rb, line 15
def [](name)
  @data[name]
end
[]=(name, value) click to toggle source
# File lib/ttnt/metadata.rb, line 19
def []=(name, value)
  @data[name] = value
end
read!() click to toggle source
# File lib/ttnt/metadata.rb, line 23
def read!
  @data = @storage.read(STORAGE_SECTION)
end
write!() click to toggle source
# File lib/ttnt/metadata.rb, line 27
def write!
  @storage.write!(STORAGE_SECTION, @data)
end