<commit_before>require 'gotcha/artifact'
require 'gotcha/artifact_finder'

class Gotcha
  attr_reader :finders
  def initialize
    (@finders = []) << Artifact::Finder::FileSystem.new
  end

  def get(spec)
    finders.each do |finder|
      artifact = finder.get(spec)
      return artifact if artifact
    end
  end

  def define(url)
    finder = Artifact::Finder::Rest.new(url)
    finders.push finder
    finder
  end
end<commit_msg>define set cache on a rest finder to first finder<commit_after>require 'gotcha/artifact'
require 'gotcha/artifact_finder'

class Gotcha
  attr_reader :finders
  def initialize
    (@finders = []) << Artifact::Finder::FileSystem.new
  end

  def get(spec)
    finders.each do |finder|
      artifact = finder.get(spec)
      return artifact if artifact
    end
  end

  def define(url)
    finder = Artifact::Finder::Rest.new(url).with_cache(finders.first)
    finders.push(finder)
    finder
  end
end
{'fraction_non_alphanumeric': 0.0979765708200213, 'fraction_numerical': 0.0, 'mean_word_length': 3.4976076555023923, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1720761', 'n_tokens_mistral': 322, 'n_tokens_neox': 302, 'n_words': 77}