Class: CommitMessage
- Inherits:
-
Object
- Object
- CommitMessage
- Defined in:
- lib/commit_message.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#revision ⇒ Object
Returns the value of attribute revision.
Instance Method Summary collapse
-
#initialize(revision: "HEAD", repo: nil) ⇒ CommitMessage
constructor
A new instance of CommitMessage.
- #to_s ⇒ Object
Constructor Details
#initialize(revision: "HEAD", repo: nil) ⇒ CommitMessage
Returns a new instance of CommitMessage.
4 5 6 7 |
# File 'lib/commit_message.rb', line 4 def initialize(revision: "HEAD", repo: nil) @revision = revision @repo = repo || Dir.pwd end |
Instance Attribute Details
#repo ⇒ Object
Returns the value of attribute repo.
2 3 4 |
# File 'lib/commit_message.rb', line 2 def repo @repo end |
#revision ⇒ Object
Returns the value of attribute revision.
2 3 4 |
# File 'lib/commit_message.rb', line 2 def revision @revision end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/commit_message.rb', line 9 def to_s if pull_request "Pull Request ##{pull_request}: #{branch}" elsif branch "#{name}: Merge '#{branch}' into '#{local_branch}'" else "#{name}: #{}" end end |