Sha256: 7c3f9fe09caffa258142aecc5b35bc47677285c432f572227a578b98ef4cce25

Contents?: true

Size: 439 Bytes

Versions: 9

Compression:

Stored size: 439 Bytes

Contents

module Propshaft::Resolver
  class Dynamic
    attr_reader :load_path, :prefix

    def initialize(load_path:, prefix:)
      @load_path, @prefix = load_path, prefix
    end

    def resolve(logical_path)
      if asset = load_path.find(logical_path)
        File.join prefix, asset.digested_path
      end
    end

    def read(logical_path)
      if asset = load_path.find(logical_path)
        asset.content
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
propshaft-0.9.1 lib/propshaft/resolver/dynamic.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/propshaft-0.6.4/lib/propshaft/resolver/dynamic.rb
propshaft-0.8.0 lib/propshaft/resolver/dynamic.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/propshaft-0.6.4/lib/propshaft/resolver/dynamic.rb
propshaft-0.7.0 lib/propshaft/resolver/dynamic.rb
propshaft-0.6.4 lib/propshaft/resolver/dynamic.rb
propshaft-0.6.3 lib/propshaft/resolver/dynamic.rb
propshaft-0.6.2 lib/propshaft/resolver/dynamic.rb
propshaft-0.6.1 lib/propshaft/resolver/dynamic.rb