Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

58 lines (47 sloc) 1.74 kb
# encoding: UTF-8
require 'rake'
require 'rake/clean'
require 'rake/testtask'
ignore = File.read('web/lib/javascripts/.gitignore')
.split("\n").map {|f| "web/lib/javascripts/#{f}" }
CLOBBER.include('pkg', 'web/chat/javascripts', *ignore)
directory 'pkg'
desc 'Build distributable packages'
task :build => [:assets, :pkg] do
system 'gem build vines.gemspec && mv vines-*.gem pkg/'
end
Rake::TestTask.new(:test) do |test|
test.libs << 'test'
test.libs << 'test/storage'
test.pattern = 'test/**/*_test.rb'
test.warning = false
end
desc 'Compile and minimize web assets'
task :assets do
require 'coffee-script'
require 'uglifier'
# combine and compile library coffeescripts
File.open('web/lib/javascripts/base.js', 'w') do |basejs|
assets = %w[layout button contact filter session transfer router navbar notification login logout]
coffee = assets.inject('') do |sum, name|
sum + File.read("web/lib/coffeescripts/#{name}.coffee")
end
js = %w[jquery jquery.cookie raphael icons strophe].inject('') do |sum, name|
sum + File.read("web/lib/javascripts/#{name}.js")
end
compiled = js + CoffeeScript.compile(coffee)
compressed = Uglifier.compile(compiled)
basejs.write(compressed)
end
# combine and compile chat application's coffeescripts
Dir.mkdir('web/chat/javascripts') unless File.exists?('web/chat/javascripts')
File.open('web/chat/javascripts/app.js', 'w') do |appjs|
coffee = %w[chat init].inject('') do |sum, name|
sum + File.read("web/chat/coffeescripts/#{name}.coffee")
end
compiled = CoffeeScript.compile(coffee)
compressed = Uglifier.compile(compiled)
appjs.write(compressed)
end
end
task :default => [:clobber, :test, :build]
Jump to Line
Something went wrong with that request. Please try again.