Created
January 28, 2009 03:42
-
-
Save mikedamage/53800 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# = Sinatra Action: Minify Javascript | |
# | |
# == Summary | |
# Takes JS files from the public directory and minifies them using the JSMin Rubygem | |
get '/js/minify/:file' do | |
content_type 'text/javascript', :charset => 'utf-8' | |
@file = Pathname.new("./public/javascripts/" + params[:file]) | |
@mini = JSMin.minify(@file.read) | |
@mini | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment