Sha256: 96b9c45f4aec974337c7a0e66ac7ab1c0ac91f59728ac1272ebb707640b4a16e

Contents?: true

Size: 529 Bytes

Versions: 4

Compression:

Stored size: 529 Bytes

Contents

# frozen_string_literal: true

# Base compiler from which other compilers can inherit
class Propshaft::Compiler
  attr_reader :assembly
  delegate :config, :load_path, to: :assembly

  def initialize(assembly)
    @assembly = assembly
  end

  # Override this in a specific compiler
  def compile(asset, input)
    raise NotImplementedError
  end

  def referenced_by(asset)
    Set.new
  end

  private
    def url_prefix
      @url_prefix ||= File.join(config.relative_url_root.to_s, config.prefix.to_s).chomp("/")
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
propshaft-1.1.0 lib/propshaft/compiler.rb
propshaft-1.0.1 lib/propshaft/compiler.rb
propshaft-1.0.0 lib/propshaft/compiler.rb
propshaft-0.9.1 lib/propshaft/compiler.rb