Module: CommitDB::GritCommit
- Defined in:
- lib/plugins/db.rb
Instance Method Summary collapse
-
#properties ⇒ Object
Read properties from a commit.
-
#properties=(data) ⇒ Object
Write properties for a commit.
- #save_properties ⇒ Object
Instance Method Details
#properties ⇒ Object
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_properties ⇒ Object
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 |