Class: Gollum::Git::Commit
- Inherits:
-
Object
- Object
- Gollum::Git::Commit
- Defined in:
- lib/grit_adapter/git_layer_grit.rb
Class Method Summary collapse
-
.list_from_string(repo, log) ⇒ Object
Grit::Commit.list_from_string(@wiki.repo, log).
Instance Method Summary collapse
- #author ⇒ Object
- #authored_date ⇒ Object
- #id ⇒ Object (also: #sha)
-
#initialize(commit) ⇒ Commit
constructor
A new instance of Commit.
- #message ⇒ Object
- #stats ⇒ Object
- #to_s ⇒ Object
- #tree ⇒ Object
Constructor Details
#initialize(commit) ⇒ Commit
Returns a new instance of Commit.
80 81 82 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 80 def initialize(commit) @commit = commit end |
Class Method Details
.list_from_string(repo, log) ⇒ Object
Grit::Commit.list_from_string(@wiki.repo, log)
118 119 120 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 118 def self.list_from_string(repo, log) Grit::Commit.list_from_string(repo, log) end |
Instance Method Details
#author ⇒ Object
100 101 102 103 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 100 def = @commit. Gollum::Git::Actor.new(.name, .email) end |
#authored_date ⇒ Object
105 106 107 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 105 def @commit. end |
#id ⇒ Object Also known as: sha
84 85 86 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 84 def id @commit.id end |
#message ⇒ Object
109 110 111 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 109 def @commit. end |
#stats ⇒ Object
93 94 95 96 97 98 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 93 def stats @stats ||= begin grit_stats = @commit.stats OpenStruct.new(:additions => grit_stats.additions, :deletions => grit_stats.deletions, :files => grit_stats.files, :id => id, :total => grit_stats.total) end end |
#to_s ⇒ Object
89 90 91 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 89 def to_s @commit.id end |
#tree ⇒ Object
113 114 115 |
# File 'lib/grit_adapter/git_layer_grit.rb', line 113 def tree Gollum::Git::Tree.new(@commit.tree) end |