-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRakefile
More file actions
40 lines (34 loc) · 1.01 KB
/
Rakefile
File metadata and controls
40 lines (34 loc) · 1.01 KB
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
# frozen_string_literal: true
require 'rake'
require 'rspec/core/rake_task'
is_lite_mode = ENV.fetch('MINDEE_GEM_NAME', 'mindee') == 'mindee-lite'
begin
require 'bundler/setup'
require 'bundler/gem_helper'
Bundler::GemHelper.install_tasks(name: ENV.fetch('MINDEE_GEM_NAME', 'mindee'))
rescue LoadError
puts 'although not required, bundler is recommended for running the tests'
end
task default: :spec
exclusion_opts = is_lite_mode ? ['--tag', '~all_deps'] : []
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = exclusion_opts
end
unless is_lite_mode
require 'yard'
desc 'Generate documentation'
YARD::Rake::YardocTask.new(:doc) do |task|
task.files = ['lib/**/*.rb']
end
Rake::Task[:doc].enhance do
FileUtils.cp_r(
File.join('docs', 'code_samples'),
File.join('docs', '_build')
)
end
end
desc 'Run integration tests'
RSpec::Core::RakeTask.new(:integration) do |t|
t.pattern = 'spec/**/*_integration.rb'
t.rspec_opts = ['--require', 'integration_helper'] + exclusion_opts
end