Sha256: ba24ab2c59bb28ff2da7bbbcc7768d9d4b94a817cddc892c24a6813cddee1707

Contents?: true

Size: 595 Bytes

Versions: 5

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

module Roadie
  # An asset provider that returns empty stylesheets for any name.
  #
  # Use it to ignore missing assets or in your tests when you need a provider
  # but you do not care what it contains or that it is even referenced at all.
  class NullProvider
    def find_stylesheet(name)
      empty_stylesheet
    end

    def find_stylesheet!(name)
      empty_stylesheet
    end

    def to_s
      inspect
    end

    def inspect
      "#<#{self.class}>"
    end

    private

    def empty_stylesheet
      Stylesheet.new "(null)", ""
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roadie-5.2.1 lib/roadie/null_provider.rb
roadie-5.2.0 lib/roadie/null_provider.rb
roadie-5.1.0 lib/roadie/null_provider.rb
roadie-5.0.1 lib/roadie/null_provider.rb
roadie-5.0.0 lib/roadie/null_provider.rb