Sha256: c7e8ce13779c5d30be7404dfd4a836452c5278f6543f5c2a4501809368cc3330
Contents?: true
Size: 911 Bytes
Versions: 68
Compression:
Stored size: 911 Bytes
Contents
module Inferno module Utils # @private class StaticAssets class << self def static_assets_folder @static_assets_folder ||= File.expand_path(File.join(inferno_path, 'public')) end def base_path @base_path ||= Application['base_path'] end def public_path @public_path ||= "/#{base_path}/public".gsub('//', '/') end def inferno_path @inferno_path ||= File.expand_path(File.join(__dir__, '..')) end # A hash of urls => file_paths which will be served with `Rack::Static` def static_assets_map Dir.glob(File.join(static_assets_folder, '*')) .each_with_object({}) do |filename, hash| hash["#{public_path}/#{File.basename(filename)}"] = filename.delete_prefix(inferno_path) end end end end end end
Version data entries
68 entries across 68 versions & 1 rubygems