Sha256: 10fcf5bfda4f2fb29799cf46a2d3a6914adf3a8d435b6f79bdc8d3042a9a8248

Contents?: true

Size: 397 Bytes

Versions: 10

Compression:

Stored size: 397 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
      else
        raise Propshaft::MissingAssetError.new(logical_path)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
propshaft-0.5.0 lib/propshaft/resolver/dynamic.rb
propshaft-0.4.4 lib/propshaft/resolver/dynamic.rb
propshaft-0.4.3 lib/propshaft/resolver/dynamic.rb
propshaft-0.4.2 lib/propshaft/resolver/dynamic.rb
propshaft-0.4.1 lib/propshaft/resolver/dynamic.rb
propshaft-0.4.0 lib/propshaft/resolver/dynamic.rb
propshaft-0.3.1 lib/propshaft/resolver/dynamic.rb
propshaft-0.3.0 lib/propshaft/resolver/dynamic.rb
propshaft-0.2.2 lib/propshaft/resolver/dynamic.rb
propshaft-0.2.1 lib/propshaft/resolver/dynamic.rb