-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
62 lines (46 loc) · 1.3 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
require 'bundler/gem_tasks'
task :default => :spec
Rake::Task[:release].enhance [:spec]
# Bootstrap
#-----------------------------------------------------------------------------#
desc 'Initializes your working copy to run the specs'
task :bootstrap do
sh "bundle install"
end
# Spec
#-----------------------------------------------------------------------------#
desc 'Run all specs'
task :spec => 'spec:all'
namespace :spec do
def specs(dir)
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
end
desc 'Automatically run specs for updated files'
task :kick do
exec 'bundle exec kicker -c'
end
task :all do
title 'Running Unit Tests'
sh "bundle exec bacon #{specs('**')}"
# title 'Checking code style...'
# Rake::Task['rubocop'].invoke
end
end
# Rubocop
#-----------------------------------------------------------------------------#
desc 'Checks code style'
task :rubocop do
require 'rubocop'
cli = Rubocop::CLI.new
result = cli.run(FileList['lib/**/*.rb'].exclude('lib/cocoapods-core/vendor/**/*').to_a)
abort('RuboCop failed!') unless result == 0
end
#-----------------------------------------------------------------------------#
def title(title)
cyan_title = "\033[0;36m#{title}\033[0m"
puts
puts '-' * 80
puts cyan_title
puts '-' * 80
puts
end