Sha256: 24fe1835fbe689daa14b595401888b7bb0ae4dc04bf7b5fb2bda998d2b2bcdb7
Contents?: true
Size: 794 Bytes
Versions: 4
Compression:
Stored size: 794 Bytes
Contents
require 'rack' class Susanoo::Application # This controller is responsible for serving/building index.html file. class Index < Susanoo::Controller def call(env) # Tilt template object template = Tilt.new(File.join(project_root, 'src/index.html.erb')) [200, {'Content-Type' => 'text/html'}, [template.render(self)]] end def build(generator) # Configure Sprockets::Helpers (if necessary) Sprockets::Helpers.configure do |config| config.environment = @environment config.prefix = 'assets' end template = Tilt.new(File.join(project_root, 'src/index.html.erb')) data = template.render(self) # God forgive me for hard coding this part generator.create_file 'www/index.html', data end end end
Version data entries
4 entries across 4 versions & 1 rubygems