module Fanforce::Plugin::Sinatra::AssetHelpers def stylesheet(s) s += '.css' unless s.include?('.css') s = asset_path(s) unless s =~ /^https?:\// or s =~ /^\/\/.+/ "" end def javascript(s) s += '.js' unless s.include?('.js') s = asset_path(s) unless s =~ /^https?:\// or s =~ /^\/\/.+/ "" end def asset_path(source, options={}) source = ('/assets/' + source).gsub('//', '/').gsub('/assets/assets/', '/assets/') end def image_path(source) asset_path(source) end end