Class: SubjectWordsCheck

Inherits:
CommitCheck show all
Defined in:
lib/wcc/commit_lint/subject_words_check.rb

Constant Summary collapse

MESSAGE =
'Please use more than one word.'

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommitCheck

fail?

Constructor Details

#initialize(message, _options = {}) ⇒ SubjectWordsCheck

Returns a new instance of SubjectWordsCheck.



10
11
12
# File 'lib/wcc/commit_lint/subject_words_check.rb', line 10

def initialize(message, _options = {})
  @subject = message[:subject]
end

Class Method Details

.typeObject



6
7
8
# File 'lib/wcc/commit_lint/subject_words_check.rb', line 6

def self.type
  :subject_words
end

Instance Method Details

#fail?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/wcc/commit_lint/subject_words_check.rb', line 18

def fail?
  @subject.split.count < 2
end

#messageObject



14
15
16
# File 'lib/wcc/commit_lint/subject_words_check.rb', line 14

def message
  MESSAGE
end