Sha256: f9e49a5c4443b90582576ebf5e343eef35eac7644520957e43828885cd3433b2
Contents?: true
Size: 916 Bytes
Versions: 96
Compression:
Stored size: 916 Bytes
Contents
module Sinatra module RbbtToolHelper def tool(toolname, options = {}) options[:id] ||= toolname.to_s + "_#{rand(10000)}" template_file = locate_template("tools/#{toolname}") Log.debug "Loading tool #{toolname} from: #{template_file}" content = Tilt::HamlTemplate.new(template_file, :filename => template_file, :ugly => production?).render(self, options) styles = begin path = locate_sass("tools/#{toolname}") link_css "/stylesheets/tools/#{toolname}" if path.exists? rescue Exception "" end javascript = begin path = locate_javascript("tools/#{toolname}") link_js "/js-find/tools/#{toolname}" if path.exists? rescue Exception "" end styles + content + javascript end end end
Version data entries
96 entries across 96 versions & 1 rubygems