Class: Gollum::Git::Commit

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commit) ⇒ Commit

Returns a new instance of Commit.



79
80
81
# File 'lib/grit_adapter/git_layer_grit.rb', line 79

def initialize(commit)
  @commit = commit
end

Class Method Details

.list_from_string(repo, log) ⇒ Object

Grit::Commit.list_from_string(@wiki.repo, log)



110
111
112
# File 'lib/grit_adapter/git_layer_grit.rb', line 110

def self.list_from_string(repo, log)
  Grit::Commit.list_from_string(repo, log)
end

Instance Method Details

#authorObject



92
93
94
95
# File 'lib/grit_adapter/git_layer_grit.rb', line 92

def author
  author = @commit.author
  Gollum::Git::Actor.new(author.name, author.email)
end

#authored_dateObject



97
98
99
# File 'lib/grit_adapter/git_layer_grit.rb', line 97

def authored_date
  @commit.authored_date
end

#idObject Also known as: sha



83
84
85
# File 'lib/grit_adapter/git_layer_grit.rb', line 83

def id
  @commit.id
end

#messageObject



101
102
103
# File 'lib/grit_adapter/git_layer_grit.rb', line 101

def message
  @commit.message
end

#to_sObject



88
89
90
# File 'lib/grit_adapter/git_layer_grit.rb', line 88

def to_s
  @commit.id
end

#treeObject



105
106
107
# File 'lib/grit_adapter/git_layer_grit.rb', line 105

def tree
  Gollum::Git::Tree.new(@commit.tree)
end