class MiddlemanWebpacker::Manifest

Public Class Methods

lookup(name) click to toggle source
# File lib/middleman-webpacker/manifest.rb, line 8
def self.lookup(name)
  load

  unless instance
    raise MiddlemanWebpacker::FileLoader::FileLoaderError.new('load must be called first')
  end

  instance.data[name.to_s] or raise(MiddlemanWebpacker::FileLoader::NotFoundError.new(
    "Can't find #{name} in #{file_path}. Is webpack still compiling?"))
end

Private Instance Methods

load() click to toggle source
Calls superclass method MiddlemanWebpacker::FileLoader::load
# File lib/middleman-webpacker/manifest.rb, line 21
def load
  return super unless File.exist?(@path)
  JSON.parse(File.read(@path))
end