Module: GitFeats::History
Constant Summary collapse
- PATH =
Dir.home + '/.git_feats/history'
Instance Method Summary collapse
- #add(pattern) ⇒ Object
- #count(pattern) ⇒ Object
- #data ⇒ Object
-
#serialize ⇒ Object
write data to file.
-
#unserialize ⇒ Object
load data from file.
Instance Method Details
#add(pattern) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/git-feats/history.rb', line 18 def add(pattern) if @history[pattern] @history[pattern] += 1 else @history[pattern] = 1 end end |
#count(pattern) ⇒ Object
26 27 28 |
# File 'lib/git-feats/history.rb', line 26 def count(pattern) @history[pattern] end |
#data ⇒ Object
30 31 32 |
# File 'lib/git-feats/history.rb', line 30 def data @history end |
#serialize ⇒ Object
write data to file
14 15 16 |
# File 'lib/git-feats/history.rb', line 14 def serialize Serializer.serialize(PATH, @history) end |
#unserialize ⇒ Object
load data from file
9 10 11 |
# File 'lib/git-feats/history.rb', line 9 def unserialize @history = Serializer.unserialize(PATH) || {} end |