Class: GitHooks::PreCommit::Rubocop
- Inherits:
-
Object
- Object
- GitHooks::PreCommit::Rubocop
- Defined in:
- lib/git_hooks/pre_commit/rubocop.rb
Instance Attribute Summary collapse
-
#git_repository ⇒ Object
readonly
Returns the value of attribute git_repository.
-
#rubocop_validator ⇒ Object
readonly
Returns the value of attribute rubocop_validator.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(git_repository, rubocop_validator) ⇒ Rubocop
constructor
A new instance of Rubocop.
- #validate ⇒ Object
Constructor Details
#initialize(git_repository, rubocop_validator) ⇒ Rubocop
Returns a new instance of Rubocop.
12 13 14 |
# File 'lib/git_hooks/pre_commit/rubocop.rb', line 12 def initialize(git_repository, rubocop_validator) @git_repository, @rubocop_validator = git_repository, rubocop_validator end |
Instance Attribute Details
#git_repository ⇒ Object (readonly)
Returns the value of attribute git_repository.
4 5 6 |
# File 'lib/git_hooks/pre_commit/rubocop.rb', line 4 def git_repository @git_repository end |
#rubocop_validator ⇒ Object (readonly)
Returns the value of attribute rubocop_validator.
4 5 6 |
# File 'lib/git_hooks/pre_commit/rubocop.rb', line 4 def rubocop_validator @rubocop_validator end |
Class Method Details
.validate ⇒ Object
6 7 8 9 10 |
# File 'lib/git_hooks/pre_commit/rubocop.rb', line 6 def self.validate new( GitHooks.configurations.git_repository, RubocopValidator.new ).validate end |
Instance Method Details
#validate ⇒ Object
16 17 18 |
# File 'lib/git_hooks/pre_commit/rubocop.rb', line 16 def validate abort 'Check rubocop offences' if offences? end |