Module: CommitDB::GritCommit

Defined in:
lib/plugins/db.rb

Instance Method Summary collapse

Instance Method Details

#propertiesObject

Read properties from a commit



6
7
8
9
10
11
# File 'lib/plugins/db.rb', line 6

def properties
   db = get_commit_database
   @properties ||= (v = db[self.sha] and Marshal.load v) || {}
ensure
   db.close
end

#properties=(data) ⇒ Object

Write properties for a commit



14
15
16
17
18
19
20
# File 'lib/plugins/db.rb', line 14

def properties=(data)
   @properties = data
   db = get_commit_database
   db[self.sha] = Marshal.dump data
ensure
   db.close
end

#save_propertiesObject



22
23
24
25
26
27
# File 'lib/plugins/db.rb', line 22

def save_properties
  db = get_commit_database
  db[self.sha] = Marshal.dump(@properties || {})
ensure
  db.close
end