Class: CaptainHook::Events::PostCommit
- Inherits:
-
Object
- Object
- CaptainHook::Events::PostCommit
- Defined in:
- lib/captain_hook/events/post_commit.rb
Instance Method Summary collapse
- #author ⇒ Object
-
#commit ⇒ Object
The represents the git commit object in question.
-
#diff ⇒ Object
The diff string from the commit Concatenates all of the sub-diffs into one string.
-
#initialize(options = {}) ⇒ PostCommit
constructor
A new instance of PostCommit.
-
#message ⇒ Object
The commit message.
- #ref_name ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PostCommit
Returns a new instance of PostCommit.
4 5 6 |
# File 'lib/captain_hook/events/post_commit.rb', line 4 def initialize(={}) @repo = [:repo] end |
Instance Method Details
#author ⇒ Object
18 19 20 |
# File 'lib/captain_hook/events/post_commit.rb', line 18 def commit. end |
#commit ⇒ Object
The represents the git commit object in question
9 10 11 |
# File 'lib/captain_hook/events/post_commit.rb', line 9 def commit @commit ||= @repo.commit(@repo.head.commit) end |
#diff ⇒ Object
The diff string from the commit Concatenates all of the sub-diffs into one string
24 25 26 27 28 |
# File 'lib/captain_hook/events/post_commit.rb', line 24 def diff @diff ||= begin commit.diffs.collect{|diff| diff.diff}.join("\n") end end |
#message ⇒ Object
The commit message
14 15 16 |
# File 'lib/captain_hook/events/post_commit.rb', line 14 def commit. end |
#ref_name ⇒ Object
30 31 32 |
# File 'lib/captain_hook/events/post_commit.rb', line 30 def ref_name @ref_name ||= @repo.head.name end |