Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
namespace :jasmine do | ||
task :ci do | ||
require 'jasmine' | ||
load 'jasmine/tasks/jasmine.rake' | ||
### rescue LoadError | ||
### task :jasmine do | ||
### abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine" | ||
### end | ||
end | ||
end | ||
|
||
namespace :jshint do | ||
task :require do | ||
sh "which jshint" do |ok, res| | ||
fail 'Cannot find jshint on $PATH' unless ok | ||
end | ||
end | ||
|
||
task :check => 'jshint:require' do | ||
project_root = File.expand_path('', File.dirname(__FILE__)) | ||
### config_file = File.join(project_root, 'config', 'jshint.json') | ||
js_root_dir = File.join(project_root, 'src') | ||
|
||
files = Rake::FileList.new | ||
files.include File.join(js_root_dir, '**', '*.js') | ||
files.exclude File.join(js_root_dir, 'lib', '**', '*.js') | ||
print js_root_dir | ||
print js_root_dir | ||
###sh "jshint #{files.join(' ')} --config #{config_file}" do |ok, res| | ||
sh "jshint #{files.join(' ')}" do |ok, res| | ||
fail 'JSHint found errors.' unless ok | ||
end | ||
end | ||
end | ||
|
||
desc 'Run JSHint checks against Javascript source' | ||
task :jshint => 'jshint:check' | ||
|
||
task :default => 'jasmine:ci' |