Class: AboutPage::GitLog

Inherits:
Configuration::Node show all
Defined in:
lib/about_page/git_log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Configuration::Node

#add_header, #expects, #messages, #preflight, render_with, #set_headers!

Constructor Details

#initialize(opts = {}) ⇒ GitLog

Returns a new instance of GitLog.



7
8
9
10
11
# File 'lib/about_page/git_log.rb', line 7

def initialize(opts = {})
  root  = opts.fetch(:root, Rails.root)
  @limit = opts.fetch(:limit, %r{/tags/})
  @repo = Grit::Repo.new(root)
end

Instance Attribute Details

#commitsObject (readonly)

Returns the value of attribute commits.



5
6
7
# File 'lib/about_page/git_log.rb', line 5

def commits
  @commits
end

Instance Method Details

#to_hObject



27
28
29
# File 'lib/about_page/git_log.rb', line 27

def to_h
  commits
end