class Reflekt::Renderer

Public Class Methods

new(package_path, output_path) click to toggle source
# File lib/renderer.rb, line 4
def initialize(package_path, output_path)
  @package_path = package_path
  @output_path = output_path
end

Public Instance Methods

render() click to toggle source

Place files in output path.

# File lib/renderer.rb, line 12
def render()

  filenames = [
    "bundle.js",
    "index.html",
    "package-lock.json",
    "package.json",
    "README.md",
    "server.js"
  ]

  filenames.each do |filename|
    file = File.read(File.join(@package_path, "web", filename))
    File.open(File.join(@output_path, filename), 'w+') do |f|
      f.write file
    end
  end

  file = File.read(File.join(@package_path, "web", "gitignore.txt"))
  File.open(File.join(@output_path, ".gitignore"), 'w+') do |f|
    f.write file
  end

end