forked from jfrog/cocoapods-art
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
60 lines (49 loc) · 1.5 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#-----------------------------------------------------------------------#
# Bootstrap
#-----------------------------------------------------------------------#
desc 'Initializes your working copy to run the specs'
task :bootstrap do
if system('which bundle')
title 'Installing gems'
sh 'bundle install'
else
$stderr.puts "\033[0;31m" \
"[!] Please install the bundler gem manually:\n" \
' $ [sudo] gem install bundler'
"\e[0m"
exit 1
end
end
begin
require 'bundler/gem_tasks'
task :default => :spec
#-----------------------------------------------------------------------#
# Specs
#-----------------------------------------------------------------------#
desc 'Runs all the specs'
task :spec do
title 'Running Unit Tests'
files = FileList['spec/**/*_spec.rb'].shuffle.join(' ')
sh "bundle exec bacon #{files}"
#title 'Checking code style...'
#Rake::Task['rubocop'].invoke if RUBY_VERSION >= '1.9.3'
end
#-----------------------------------------------------------------------#
# Rubocop
#-----------------------------------------------------------------------#
if RUBY_VERSION >= '1.9.3'
require 'rubocop/rake_task'
RuboCop::RakeTask.new
end
end
#-----------------------------------------------------------------------#
# Helpers
#-----------------------------------------------------------------------#
def title(title)
cyan_title = "\033[0;36m#{title}\033[0m"
puts
puts '-' * 80
puts cyan_title
puts '-' * 80
puts
end