Class: NodeUglify

Inherits:
Object
  • Object
show all
Defined in:
lib/node_uglify.rb,
lib/node_uglify/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Method Summary collapse

Instance Method Details

#compress(input) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/node_uglify.rb', line 5

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