module Webpack::Manifest

Public Class Methods

config() click to toggle source
# File lib/webpack/manifest.rb, line 10
def config
  @config ||= Configuration.new
end
configure() { |config| ... } click to toggle source
# File lib/webpack/manifest.rb, line 6
def configure
  yield config
end
load(path) click to toggle source
# File lib/webpack/manifest.rb, line 14
def load(path)
  # read file
  uri = URI.parse(path.to_s)
  str = case uri
        when URI::HTTP, URI::HTTPS
          OpenURI.open_uri(uri.to_s).read
        else # default read file
          File.read(uri.path)
        end

  # to json
  entries = JSON.parse str

  # return Manifest instance
  Entries.new entries
end