lib/technologist/rules/file_content_rule.rb in technologist-0.3.0 vs lib/technologist/rules/file_content_rule.rb in technologist-0.4.0
- old
+ new
@@ -1,9 +1,11 @@
require 'technologist/rules/rule'
class FileContentRule < Rule
attr_accessor :file_name, :file_content_pattern
- def matches?(framework_name, repository)
- !!(repository.file_content(file_name) =~ /#{file_content_pattern}/)
+ def matches?(repository)
+ !!repository.file_with_content_exists?(file_name) do |content|
+ content =~ /#{file_content_pattern}/
+ end
end
end