Class: Gitlab::Suggestions::CommitMessage
- Inherits:
-
Object
- Object
- Gitlab::Suggestions::CommitMessage
- Defined in:
- lib/gitlab/suggestions/commit_message.rb
Constant Summary collapse
- DEFAULT_SUGGESTION_COMMIT_MESSAGE =
"Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)\n\n%{co_authored_by}"
Instance Method Summary collapse
-
#initialize(user, suggestion_set, custom_message = nil) ⇒ CommitMessage
constructor
A new instance of CommitMessage.
- #message ⇒ Object
Constructor Details
#initialize(user, suggestion_set, custom_message = nil) ⇒ CommitMessage
Returns a new instance of CommitMessage.
9 10 11 12 13 |
# File 'lib/gitlab/suggestions/commit_message.rb', line 9 def initialize(user, suggestion_set, = nil) @user = user @suggestion_set = suggestion_set @custom_message = end |
Instance Method Details
#message ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/gitlab/suggestions/commit_message.rb', line 15 def project = suggestion_set.target_project = @custom_message.presence || project..presence = || DEFAULT_SUGGESTION_COMMIT_MESSAGE Gitlab::StringPlaceholderReplacer .replace_string_placeholders(, PLACEHOLDERS_REGEX) do |key| PLACEHOLDERS[key].call(user, suggestion_set) end end |