Class: Cane::HashCheck
- Inherits:
-
Struct
- Object
- Struct
- Cane::HashCheck
- Defined in:
- lib/cane/hashcheck/hash_check.rb
Constant Summary collapse
- DESCRIPTION =
'Ruby 1.9 hash syntax violation'- DEFAULT_GLOB =
'{app,lib}/**/*.rb'
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
4 5 6 |
# File 'lib/cane/hashcheck/hash_check.rb', line 4 def end |
Class Method Details
.key ⇒ Object
9 |
# File 'lib/cane/hashcheck/hash_check.rb', line 9 def self.key; :hash; end |
.name ⇒ Object
10 |
# File 'lib/cane/hashcheck/hash_check.rb', line 10 def self.name; 'Hash check'; end |
.options ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/cane/hashcheck/hash_check.rb', line 11 def self. { hash_glob: [ 'File glob to run hash checks over', default: DEFAULT_GLOB, clobber: :no_hash ] } end |
Instance Method Details
#violations ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/cane/hashcheck/hash_check.rb', line 21 def violations [].tap do |violations| unless [:no_hash] each_violation do |file_name, line_number| violations << new_violation(file_name, line_number) end end end end |