Class: GitBreeze::PrepareCommitMessage
- Inherits:
-
Object
- Object
- GitBreeze::PrepareCommitMessage
- Defined in:
- lib/git_breeze/prepare_commit_message.rb
Instance Attribute Summary collapse
-
#commit_sha ⇒ Object
readonly
Returns the value of attribute commit_sha.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, source = nil, commit_sha = nil) ⇒ PrepareCommitMessage
constructor
A new instance of PrepareCommitMessage.
- #run ⇒ Object
Constructor Details
#initialize(file, source = nil, commit_sha = nil) ⇒ PrepareCommitMessage
Returns a new instance of PrepareCommitMessage.
12 13 14 15 16 |
# File 'lib/git_breeze/prepare_commit_message.rb', line 12 def initialize(file, source=nil, commit_sha=nil) @file = file @source = source @commit_sha = commit_sha end |
Instance Attribute Details
#commit_sha ⇒ Object (readonly)
Returns the value of attribute commit_sha.
6 7 8 |
# File 'lib/git_breeze/prepare_commit_message.rb', line 6 def commit_sha @commit_sha end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
6 7 8 |
# File 'lib/git_breeze/prepare_commit_message.rb', line 6 def file @file end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/git_breeze/prepare_commit_message.rb', line 6 def source @source end |
Class Method Details
.run(file, source = nil, commit_sha = nil) ⇒ Object
8 9 10 |
# File 'lib/git_breeze/prepare_commit_message.rb', line 8 def self.run(file, source=nil, commit_sha=nil) new(file, source, commit_sha).run end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/git_breeze/prepare_commit_message.rb', line 18 def run exit_when_commit_exists story = story_number_from_branch = CommitMessage.new(file) exit if .mentions_story?(story) movelist = .movelist = ["##{story}", movelist].compact.join(' ') .append(" -- Applies to story #{}") end |