Sha256: 8b17776c10b87bbe99763c5de49ff95cf1fee7a29214aa903de2aef12776f3ac
Contents?: true
Size: 710 Bytes
Versions: 1
Compression:
Stored size: 710 Bytes
Contents
module Pelusa module Lint class CaseStatements def initialize @violations = Set.new end def check(klass) iterate_lines!(klass) return SuccessfulAnalysis.new(name) if @violations.empty? FailedAnalysis.new(name, @violations) do |violations| "There are #{violations.length} case statements in lines #{violations.to_a.join(', ')}" end end private def name "Doesn't use case statements" end def iterate_lines!(klass) ClassAnalyzer.walk(klass) do |node| if node.is_a?(Rubinius::AST::Case) @violations << node.line end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pelusa-0.2.3 | lib/pelusa/lint/case_statements.rb |