-
Notifications
You must be signed in to change notification settings - Fork 117
/
Rakefile
32 lines (25 loc) · 956 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new :spec
desc 'Build and copy Mocha and Chai assets from submodules into vendor/assets'
task :assets => ['assets:build', 'assets:copy']
namespace :assets do
task :build do
sh 'git submodule update --init' unless File.exist?('mocha/Makefile') || File.exist?('chai/Makefile')
sh 'cd mocha && npm install && make clean && make'
sh 'cd chai && npm install && make clean && make'
end
task :copy do
sh 'git submodule update --init' unless File.exist?('mocha/Makefile') || File.exist?('chai/Makefile')
mkdir_p 'vendor/assets/javascripts'
mkdir_p 'vendor/assets/stylesheets'
cp 'mocha/mocha.js', 'vendor/assets/javascripts/'
cp 'mocha/mocha.css', 'vendor/assets/stylesheets/'
cp 'chai/chai.js', 'vendor/assets/javascripts/'
end
end
task :default => :spec
task :server do
sh 'rackup -p 3500 config.ru'
end