Class: GitReport::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project = nil) ⇒ Log

Returns a new instance of Log.



6
7
8
9
# File 'lib/log.rb', line 6

def initialize project = nil
  raise 'No git repo found!' unless project
  @project = project
end

Instance Attribute Details

#commitsObject

returns all the commits of that project of the currently checked out branch



12
13
14
# File 'lib/log.rb', line 12

def commits
  @commits
end

#projectObject

Returns the value of attribute project.



4
5
6
# File 'lib/log.rb', line 4

def project
  @project
end

Instance Method Details

#firstObject

returns the initial commit



22
23
24
# File 'lib/log.rb', line 22

def first
  @@first ||= self.commits.first
end

#lastObject

returns the most recent commit



17
18
19
# File 'lib/log.rb', line 17

def last
  @@last ||= self.commits.last
end