Skip to content

Commit

Permalink
move build to new folder
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrins committed Sep 4, 2011
1 parent b9644ea commit 2b395be
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'rubygems'

HEADER = /((^\s*\/\/.*\n)+)/

desc "rebuild the spectrum.js files for distribution"
task :build do
begin
require 'closure-compiler'
rescue LoadError
puts "closure-compiler not found.\nInstall it by running 'gem install closure-compiler"
exit
end
source = File.read 'spectrum.js'
header = source.match(HEADER)
File.open('spectrum-min.js', 'w+') do |file|
file.write header[1].squeeze(' ') + Closure::Compiler.new.compress(source)
end
end

0 comments on commit 2b395be

Please sign in to comment.