forked from kshnurov/mandrill_dm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
35 lines (29 loc) · 883 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
33
34
35
require 'bundler'
require 'bundler/gem_tasks'
Bundler.require(:default, :development)
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
require 'rubocop/rake_task'
RuboCop::RakeTask.new
task default: %w[all_checks]
desc 'Run all specs and rubocop checks'
task :all_checks do
Rake::Task['spec'].invoke
Rake::Task['rubocop'].invoke
end
directory 'tmp/coverage'
desc 'Generates spec coverage results'
task :coverage do
ENV['COVERAGE'] = '1'
Rake::Task[:spec].invoke
ENV['COVERAGE'] = nil
`open tmp/coverage/index.html` if RUBY_PLATFORM['darwin']
end
desc 'Validate Travis CI configuration'
task :validate do
print ' Travis CI Validation '.center(80, '*') + "\n"
result = `travis-lint #{File.expand_path('../.travis.yml', __FILE__)}`
puts result.empty? ? 'OK' : result
print '*' * 80 + "\n"
raise 'Travis CI validation failed' unless result.empty?
end