lib/pronto/flay.rb in pronto-flay-0.6.1 vs lib/pronto/flay.rb in pronto-flay-0.6.2

- old
+ new

@@ -2,23 +2,30 @@ require 'flay' module Pronto class Flay < Runner def run - files = ruby_patches.map(&:new_file_full_path) - files = ::Flay.filter_files(files) - if files.any? - flay.process(*files) flay.analyze messages else [] end end + # The current Flay (2.8.0) takes care of filtering + # files by looking at .flayignore. + # Saving the returned Flay object at @flay so we + # can inspect it and build the messages Array. + # + # Coercing files with Array to protect against + # +nil+ values. def flay - @flay ||= ::Flay.new + @flay ||= ::Flay.run(Array(files)) + end + + def files + @files ||= ruby_patches.map(&:new_file_full_path) end def messages nodes.map do |node| patch = patch_for_node(node)