Skip to content

Commit

Permalink
don't require yardstick for Rakefile to work
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni authored and ekohl committed Dec 30, 2023
1 parent 58182b2 commit 04bc541
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ RuboCop::RakeTask.new
require 'yard'
YARD::Rake::YardocTask.new

require 'yardstick/rake/measurement'
Yardstick::Rake::Measurement.new do |measurement|
measurement.output = 'measurement/report.txt'
end
task default: [:spec, :rubocop]

require 'yardstick/rake/verify'
Yardstick::Rake::Verify.new do |verify|
verify.threshold = 67.1
end
begin
require 'yardstick/rake/measurement'
Yardstick::Rake::Measurement.new do |measurement|
measurement.output = 'measurement/report.txt'
end

task default: [:spec, :rubocop, :verify_measurements]
require 'yardstick/rake/verify'
Yardstick::Rake::Verify.new do |verify|
verify.threshold = 67.1
end

Rake::Task[:default].enhance(:verify_measurements)
rescue LoadError
# yardstick not present
end

0 comments on commit 04bc541

Please sign in to comment.