Sha256: e5bc6dd3b5d99dc6f9aa640a414f516d6f05e1a6442800c4d2b944b2ea1d879b
Contents?: true
Size: 733 Bytes
Versions: 44
Compression:
Stored size: 733 Bytes
Contents
module Opal module Sprockets class PathReader def initialize(env, context) @env ||= env @context ||= context end def read path if path.end_with? '.js' context.depend_on_asset(path) env[path, bundle: true].to_s else context.depend_on(path) File.open(expand(path), 'rb:UTF-8'){|f| f.read} end rescue ::Sprockets::FileNotFound nil end def expand path env.resolve(path) or # Sprockets 3 just returns nil for unknown paths raise ::Sprockets::FileNotFound, path.inspect end def paths env.paths end attr_reader :env, :context end end end
Version data entries
44 entries across 44 versions & 3 rubygems