class Pannier::ManifestWriter

Public Class Methods

new(app, env) click to toggle source
# File lib/pannier/manifest_writer.rb, line 9
def initialize(app, env)
  @app, @env = app, env
  @report = Report.new(@app)
end

Public Instance Methods

basename() click to toggle source
# File lib/pannier/manifest_writer.rb, line 14
def basename
  ".assets.#{@env.name}.json"
end
clobber!(dir_path) click to toggle source
# File lib/pannier/manifest_writer.rb, line 23
def clobber!(dir_path)
  path = File.join(*[dir_path, basename].compact)
  FileUtils.rm_f(path)
end
content() click to toggle source
# File lib/pannier/manifest_writer.rb, line 18
def content
  @report.build!
  MultiJson.dump(@report.tree)
end
write!(dir_path) click to toggle source
# File lib/pannier/manifest_writer.rb, line 28
def write!(dir_path)
  @report.build!
  FileUtils.mkdir_p(dir_path)
  File.open(File.join(dir_path, basename), 'w+') do |f|
    f << content
  end
end