class FoodCritic::Review
The collected warnings (if any) raised against a cookbook tree.
def failed?
def failed? warnings.any?(&:failed?) end
def failures
def failures warnings.select(&:failed?) end
def initialize(cookbook_paths, warnings)
def initialize(cookbook_paths, warnings) @cookbook_paths = Array(cookbook_paths) @warnings = warnings end
def to_s
Returns a string representation of this review. This representation is
def to_s # Sorted by filename and line number. # # FC123: My rule name: foo/recipes/default.rb @warnings.map do |w| ["#{w.rule.code}: #{w.rule.name}: #{w.match[:filename]}", w.match[:line].to_i] end.sort do |x, y| x.first == y.first ? x[1] <=> y[1] : x.first <=> y.first end.map { |w| "#{w.first}:#{w[1]}" }.uniq.join("\n") end