2020-12-28 01:31:47 +00:00
|
|
|
require "bundler/gem_tasks"
|
|
|
|
|
|
|
|
require 'rubocop/rake_task'
|
|
|
|
|
|
|
|
desc 'Run RuboCop on the lib directory'
|
|
|
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
|
|
task.patterns = ['lib/**/*.rb']
|
|
|
|
# only show the files with failures
|
|
|
|
task.formatters = ['progress']
|
|
|
|
# don't abort rake on failure
|
|
|
|
task.fail_on_error = false
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'rake/clean'
|
|
|
|
|
2021-01-01 00:04:25 +00:00
|
|
|
CLOBBER.include('coverage', 'doc')
|
|
|
|
CLEAN.include('.yardoc')
|
2020-12-28 01:31:47 +00:00
|
|
|
|
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
|
|
|
|
namespace :spec do
|
|
|
|
RSpec::Core::RakeTask.new(:all)
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Alias to spec:all'
|
|
|
|
task 'spec' => 'spec:all'
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'yard'
|
|
|
|
require 'yard/rake/yardoc_task'
|
|
|
|
|
|
|
|
YARD::Rake::YardocTask.new do |t|
|
|
|
|
t.files = ['lib/**/*.rb', 'generated/**/*.rb']
|
|
|
|
t.options = ['--verbose', '--markup', 'markdown']
|
|
|
|
end
|
|
|
|
rescue LoadError
|
2021-01-01 00:04:25 +00:00
|
|
|
task :yard
|
2020-12-28 01:31:47 +00:00
|
|
|
puts "YARD not available"
|
|
|
|
end
|
|
|
|
|
2021-01-01 00:04:25 +00:00
|
|
|
task :ci => [:spec, :yard, :build]
|
|
|
|
|
|
|
|
task :default => :ci
|