4 desc 'Use UglifyJS to compress Underscore.string'
7 source = File.read('lib/underscore.string.js')
8 compressed = Uglifier.compile(source, copyright: false)
9 File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed }
10 compression_rate = compressed.length.to_f/source.length
11 puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%"
17 system %{bundle exec serve 2>/dev/null &}
20 puts "Running underscore.string test suite."
21 result1 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test.html"}
23 puts "Running Underscore test suite."
24 result2 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test_underscore/test.html"}
26 exit(result1 && result2 ? 0 : 1)