Tizen 2.0 Release
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.2.0 / node_modules / grunt / node_modules / underscore.string / Rakefile
1 # encoding: utf-8
2 task default: :test
3
4 desc 'Use UglifyJS to compress Underscore.string'
5 task :build do
6   require 'uglifier'
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}%"
12 end
13
14
15 desc 'Run tests'
16 task :test do
17   system %{bundle exec serve 2>/dev/null &}
18   sleep 2
19
20   puts "Running underscore.string test suite."
21   result1 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test.html"}
22
23   puts "Running Underscore test suite."
24   result2 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test_underscore/test.html"}
25
26   exit(result1 && result2 ? 0 : 1)
27 end