Class: PreCommit::Checks::BeforeAll

Inherits:
Grep show all
Defined in:
lib/plugins/pre_commit/checks/before_all.rb

Instance Attribute Summary

Attributes inherited from Plugin

#config, #pluginator

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Grep

#call, #extra_pattern, #initialize

Methods inherited from Plugin

#initialize, #name

Constructor Details

This class inherits a constructor from PreCommit::Checks::Grep

Class Method Details

.descriptionObject



23
24
25
# File 'lib/plugins/pre_commit/checks/before_all.rb', line 23

def self.description
  "Find ruby files with 'before :all' pattern"
end

Instance Method Details

#extra_grepObject



11
12
13
# File 'lib/plugins/pre_commit/checks/before_all.rb', line 11

def extra_grep
  %w{-v //}
end

#files_filter(staged_files) ⇒ Object



7
8
9
# File 'lib/plugins/pre_commit/checks/before_all.rb', line 7

def files_filter(staged_files)
  staged_files.grep(/\.rb$/)
end

#messageObject



15
16
17
# File 'lib/plugins/pre_commit/checks/before_all.rb', line 15

def message
  "before(:all) found:"
end

#patternObject



19
20
21
# File 'lib/plugins/pre_commit/checks/before_all.rb', line 19

def pattern
  "before.*:all"
end