Class: Gollum::Git::Commit
- Inherits:
-
Object
- Object
- Gollum::Git::Commit
- Defined in:
- lib/rugged_adapter/git_layer_rugged.rb
Instance Attribute Summary collapse
-
#commit ⇒ Object
readonly
Returns the value of attribute commit.
-
#tracked_pathname ⇒ Object
readonly
Returns the value of attribute tracked_pathname.
Instance Method Summary collapse
- #author ⇒ Object
- #authored_date ⇒ Object
- #id ⇒ Object (also: #sha, #to_s)
-
#initialize(commit, tracked_pathname = nil) ⇒ Commit
constructor
A new instance of Commit.
- #message ⇒ Object
- #parent ⇒ Object
- #stats ⇒ Object
- #tree ⇒ Object
Constructor Details
#initialize(commit, tracked_pathname = nil) ⇒ Commit
Returns a new instance of Commit.
97 98 99 100 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 97 def initialize(commit, tracked_pathname = nil) @commit = commit @tracked_pathname = tracked_pathname end |
Instance Attribute Details
#commit ⇒ Object (readonly)
Returns the value of attribute commit.
108 109 110 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 108 def commit @commit end |
#tracked_pathname ⇒ Object (readonly)
Returns the value of attribute tracked_pathname.
108 109 110 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 108 def tracked_pathname @tracked_pathname end |
Instance Method Details
#author ⇒ Object
110 111 112 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 110 def @author ||= Gollum::Git::Actor.new(@commit.[:name], @commit.[:email]) end |
#authored_date ⇒ Object
114 115 116 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 114 def @commit.[:time] end |
#id ⇒ Object Also known as: sha, to_s
102 103 104 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 102 def id @commit.oid end |
#message ⇒ Object
118 119 120 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 118 def @commit. end |
#parent ⇒ Object
130 131 132 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 130 def parent @commit.parents.empty? ? nil : Gollum::Git::Commit.new(@commit.parents.first) end |
#stats ⇒ Object
126 127 128 |
# File 'lib/rugged_adapter/git_layer_rugged.rb', line 126 def stats @stats ||= build_stats end |