lib/plagiarism/strategries/engine.rb in plagiarism2-0.0.6 vs lib/plagiarism/strategries/engine.rb in plagiarism2-0.0.7

- old
+ new

@@ -8,11 +8,11 @@ class << self def fetch(content, params) raise end - def iterate(r) + def iterate(r, a = :all?) raise end def exists?(response) iterate(response) { |uri| uri.host =~ whitelists_regex } @@ -49,10 +49,10 @@ typhoeus = self.class.fetch("\"#{content}\"", params) typhoeus.success? && retrieve_link(typhoeus.response_body) end def retrieve_link(response) - self.class.iterate(response) { |uri| uri.host !~ self.class.whitelists_regex and return uri.to_s } + self.class.iterate(response, :find) { |uri| uri.host !~ self.class.whitelists_regex and return uri.to_s } end end end end