Class: SimpleChangelog::Repository

Inherits:
Object
  • Object
show all
Defined in:
app/models/simple_changelog/repository.rb

Constant Summary collapse

NEW_LINE_SPLITTER =
/\r?\n/

Instance Method Summary collapse

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

  create_tags
end

Instance Method Details

#load_historyObject



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