Class: RubyAppraiser::Adapter::LineLength
- Inherits:
-
RubyAppraiser::Adapter
- Object
- RubyAppraiser::Adapter
- RubyAppraiser::Adapter::LineLength
- Defined in:
- lib/ruby-appraiser/adapter/line-length.rb
Instance Method Summary collapse
Methods inherited from RubyAppraiser::Adapter
adapter_type, all, attempt_require_adapter, find, find!, get, inherited, #initialize, registry
Constructor Details
This class inherits a constructor from RubyAppraiser::Adapter
Instance Method Details
#appraise ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ruby-appraiser/adapter/line-length.rb', line 6 def appraise source_files.each do |source_file| File.open(source_file) do |source| source.each_line do |line| line_length = line.chomp.length if line_length > 80 add_defect(source_file, source.lineno, "Line too long [#{line_length}/80]") end end end end end |