class Jekyll::Assets::Manifest
Attributes
data[R]
Public Class Methods
keep_keys()
click to toggle source
– Allows you to add a manifest key for us to keep. @note the format should be `key: { hashKey: hashVal }` or `key: []` @note complex keys aren't supported. @return [Array<String>] –
# File lib/jekyll/assets/manifest.rb, line 47 def self.keep_keys @keep_keys ||= %w( assets ) end
new(*args)
click to toggle source
– Set @new_manifest to false by default. @override Sprockets::Manifest#initialize @return See upstream. –
Calls superclass method
# File lib/jekyll/assets/manifest.rb, line 27 def initialize(*args) @new_manifest = false super end
simple_logical_path?(file)
click to toggle source
– Works around some weird behavior in Sprockets
3.x that seemd to make it so that when you use an absolute path, it was automatically a filter and so you could never find an asset that was dynamically added. –
Calls superclass method
# File lib/jekyll/assets/manifest.rb, line 37 def self.simple_logical_path?(file) super || File.file?(file) end
Public Instance Methods
find_directory_manifest(dirname)
click to toggle source
– rubocop:disable Metrics/LineLength Allows us to discover the manifest path, but know
if it's new.
–
# File lib/jekyll/assets/manifest.rb, line 58 def find_directory_manifest(dirname) entries = File.directory?(dirname) ? Dir.entries(dirname) : [] entry = (f = entries.find { |e| e =~ MANIFEST_RE }) || generate_manifest_path f || @new_manifest = true File.join(dirname, entry) end
new_manifest?()
click to toggle source
– Determines if we've a new manifest file. @note it helps us keep the cache directory clean. rubocop:disable Style/RedundantReturn @return [true, false] –
# File lib/jekyll/assets/manifest.rb, line 18 def new_manifest? return @new_manifest end