Class: SimpleChangelog::Repository
- Inherits:
-
Object
- Object
- SimpleChangelog::Repository
- Defined in:
- app/models/simple_changelog/repository.rb
Constant Summary collapse
- NEW_LINE_SPLITTER =
/\r?\n/
Instance Method Summary collapse
-
#initialize(path = Rails.root) ⇒ Repository
constructor
A new instance of Repository.
- #load_history ⇒ Object
Constructor Details
#initialize(path = Rails.root) ⇒ Repository
Returns a new instance of Repository.
6 7 8 9 10 |
# File 'app/models/simple_changelog/repository.rb', line 6 def initialize(path = Rails.root) @repo = MiniGit.new path end |
Instance Method Details
#load_history ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/models/simple_changelog/repository.rb', line 12 def load_history history = {} if @tags.any? @tags.each_cons(2) do |prev, succ| history[prev] = commits_between(succ, prev) end end history end |