Sha256: 03653aa512f4b9aab1a436453561820ab79ed15a58ce14b369833061f5533d1e
Contents?: true
Size: 843 Bytes
Versions: 4
Compression:
Stored size: 843 Bytes
Contents
# frozen_string_literal: true module UltraSettings # Helper class for rendering the settings information in an HTML page. class WebView attr_reader :css def initialize @index_template = erb_template("index.html.erb") @layout_template = erb_template("layout.html.erb") @layout_css = read_app_file("layout.css") @css = read_app_file("application.css") @javascript = read_app_file("application.js") end def render_settings @layout_template.result(binding) end def content @index_template.result(binding) end private def erb_template(path) ERB.new(read_app_file(path)) end def read_app_file(path) File.read(File.join(app_dir, path)) end def app_dir File.expand_path(File.join("..", "..", "app"), __dir__) end end end
Version data entries
4 entries across 4 versions & 1 rubygems