Skip to content

Instantly share code, notes, and snippets.

View andrewkolesnikov's full-sized avatar

Andrew Kolesnikov andrewkolesnikov

View GitHub Profile
get %r{^/([a-zA-Z0-9_/-]+\.coffee)\.js} do |filename|
content_type :js
base_name = options.public + '/' + filename
if File.exists? base_name
haml File.open(base_name, 'r'){|f| f.read }, :layout => false
else
File.open(base_name + '.js', 'r'){|f| f.read }
end
end