Class: Metior::GitHub::Commit
- Defined in:
- lib/metior/github/commit.rb
Overview
Represents a commit in a GitHub source code repository
Instance Attribute Summary
Attributes inherited from Commit
#author, #authored_date, #children, #committed_date, #committer, #id, #message, #parents, #repo
Instance Method Summary collapse
-
#initialize(repo, commit) ⇒ Commit
constructor
Creates a new GitHub commit object linked to the repository and branch it belongs to and the data parsed from the corresponding JSON data.
Methods inherited from Commit
#add_child, #added_files, #additions, #deleted_files, #deletions, #inspect, #load_file_stats, #load_line_stats, #merge?, #modifications, #modified_files, #subject
Methods included from AutoIncludeVCS
Constructor Details
#initialize(repo, commit) ⇒ Commit
Creates a new GitHub commit object linked to the repository and branch it belongs to and the data parsed from the corresponding JSON data
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/metior/github/commit.rb', line 24 def initialize(repo, commit) super repo @added_files = [] @additions = 0 @authored_date = Time.parse commit. @committed_date = Time.parse commit.committed_date @deleted_files = [] @deletions = 0 @id = commit.id @message = commit. @modified_files = [] @parents = commit.parents.map { |parent| parent.id } self. = commit. self.committer = commit.committer end |