Class: GitStats::GitData::Tree

Inherits:
Object
  • Object
show all
Includes:
HashInitializable
Defined in:
lib/git_stats/git_data/tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashInitializable

#initialize

Instance Attribute Details

#relative_pathObject (readonly)

Returns the value of attribute relative_path


9
10
11
# File 'lib/git_stats/git_data/tree.rb', line 9

def relative_path
  @relative_path
end

#repoObject (readonly)

Returns the value of attribute repo


9
10
11
# File 'lib/git_stats/git_data/tree.rb', line 9

def repo
  @repo
end

Instance Method Details

#==(other) ⇒ Object


17
18
19
# File 'lib/git_stats/git_data/tree.rb', line 17

def ==(other)
  ((self.repo == other.repo) && (self.relative_path == other.relative_path))
end

#authorsObject


11
12
13
14
15
# File 'lib/git_stats/git_data/tree.rb', line 11

def authors
  @authors ||= run_and_parse("git shortlog -se #{commit_range}").map do |author|
    Author.new(repo: self, name: author[:name], email: author[:email])
  end
end