Class: PreCommit::Checks::RubySymbolHashrockets
- Inherits:
-
Grep
show all
- Defined in:
- lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
Instance Attribute Summary
Attributes inherited from Plugin
#config, #pluginator
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Grep
#call, #extra_grep, #extra_pattern, #initialize
Methods inherited from Plugin
#initialize, #name
Class Method Details
.description ⇒ Object
19
20
21
|
# File 'lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb', line 19
def self.description
"Finds ruby 1.8 '=>' hash definitions."
end
|
Instance Method Details
#files_filter(staged_files) ⇒ Object
7
8
9
|
# File 'lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb', line 7
def files_filter(staged_files)
staged_files.grep(/\.rb$/)
end
|
#message ⇒ Object
11
12
13
|
# File 'lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb', line 11
def message
"detected :symbol => value hashrocket:"
end
|
#pattern ⇒ Object
15
16
17
|
# File 'lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb', line 15
def pattern
'[^:](:{1}(?:\$|@|@@|[_A-Za-z])?\w*[=!?]?\s*=>\s*)'
end
|