Skip to content
Browse files

Split assets task into build and copy

Normally we just want to copy the pre-build assets that
are checked into the mocha and chai repositories.
  • Loading branch information...
1 parent 7371f02 commit 5af71b484cd9e37544cb562cc901da767382d9c4 @jfirebaugh committed
Showing with 17 additions and 9 deletions.
  1. +17 −9 Rakefile
View
26 Rakefile
@@ -6,15 +6,23 @@ 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 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'
- 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/'
+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

0 comments on commit 5af71b4

Please sign in to comment.
Something went wrong with that request. Please try again.