<commit_before>require 'sprockets'
require 'compass/sprite_importer'

module CompassRails
  class SpriteImporter < Compass::SpriteImporter
    attr_reader :context, :root

    def initialize(context, root)
      @context = context
      @root = root
    end

    def find(uri, options)
      if old = super(uri, options)
        self.class.files(uri).each do |file|
          relative_path = Pathname.new(file).relative_path_from(Pathname.new(root))
          if pathname = context.resolve(relative_path)
            context.depend_on_asset(pathname)
          end
        end
      end

      old
    end
  end
end<commit_msg>use rescue for sprite importer patch if sprockets cant find the dependent file<commit_after>require 'sprockets'
require 'compass/sprite_importer'

module CompassRails
  class SpriteImporter < Compass::SpriteImporter
    attr_reader :context, :root

    def initialize(context, root)
      @context = context
      @root = root
    end

    def find(uri, options)
      if old = super(uri, options)
        self.class.files(uri).each do |file|
          puts file.inspect
          relative_path = Pathname.new(file).relative_path_from(Pathname.new(root))
          begin
            pathname = context.resolve(relative_path)
            context.depend_on_asset(pathname)
          rescue Sprockets::FileNotFound

          end
        end
      end

      old
    end
  end
end
{'fraction_non_alphanumeric': 0.07621082621082621, 'fraction_numerical': 0.0, 'mean_word_length': 2.53904282115869, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7381721', 'n_tokens_mistral': 421, 'n_tokens_neox': 416, 'n_words': 101}