Class: Jekyll::Assets::Plugins::SrcMap::Writer

Inherits:
Sprockets::Exporters::Base
  • Object
show all
Defined in:
lib/jekyll/assets/plugins/srcmap/writer.rb

Instance Method Summary collapse

Instance Method Details

#callObject



21
22
23
24
25
26
# File 'lib/jekyll/assets/plugins/srcmap/writer.rb', line 21

def call
  clean_file!
  clean_sources!
  write_map!
  write_src!
end

#filesArray<String>

Note:

We push everything from the file we are writing to the maps.

– Provides our custom manifest key, full of files. –

Returns:

  • (Array<String>)


33
34
35
36
37
38
39
40
41
42
43
# File 'lib/jekyll/assets/plugins/srcmap/writer.rb', line 33

def files
  @files ||= begin
    key = "sourceMapFiles"
    out = env.manifest.data[key] ||= []
    unless Manifest.keep_keys.include?(key)
      Manifest.keep_keys << key
    end

    out
  end
end

#skip?(_) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/jekyll/assets/plugins/srcmap/writer.rb', line 15

def skip?(_)
  !env.asset_config[:source_maps] ||
    !asset.[:map]
end