Created
March 9, 2016 16:44
-
-
Save vortizhe/b512fa7baf4eab4186ef to your computer and use it in GitHub Desktop.
Replace asset pipeline ruby uglifyjs with node version
This file contains hidden or 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
require 'open3' | |
class NodeUglify | |
def compress(input) | |
output = '' | |
Open3.popen3('uglifyjs') do |i, o, t| | |
i.puts input | |
i.close | |
while line = o.gets | |
output += line | |
end | |
end | |
output | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment