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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
# frozen_string_literal: true
require 'rubygems'
require 'helix_runtime/build_task'
require 'date'
require 'open3'
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
require 'rake/testtask'
Rake::TestTask.new(minitests: :build) do |t|
t.test_files = FileList['minitests/**/test_*.rb']
t.verbose = true
end
task test: %i[build spec minitests]
rescue LoadError
end
HelixRuntime::BuildTask.new
def rubocop(fix:)
sh "bundle exec rubocop #{'-a' if fix} lib spec minitests " \
'Rakefile hypothesis-specs.gemspec'
end
task :checkformat do
rubocop(fix: false)
end
task :format do
rubocop(fix: true)
end
begin
require 'yard'
YARD::Rake::YardocTask.new(:runyard) do |t|
t.files = [
'lib/hypothesis.rb', 'lib/hypothesis/errors.rb',
'lib/hypothesis/possible.rb'
]
t.options = ['--markup=markdown', '--no-private']
end
task doc: :runyard do
YARD::Registry.load
objs = YARD::Registry.select do |o|
is_private = false
t = o
until t.root?
if t.visibility != :public
is_private = true
break
end
t = t.parent
end
!is_private && o.docstring.blank?
end
objs.sort_by! { |o| o.name.to_s }
unless objs.empty?
abort "Undocumented objects: #{objs.map(&:name).join(', ')}"
end
end
rescue LoadError
end
GEMSPEC = 'hypothesis-specs.gemspec'
RELEASE_FILE = 'RELEASE.md'
CHANGELOG = 'CHANGELOG.md'
def run_for_output(*args)
out, result = Open3.capture2(*args)
abort if result.exitstatus != 0
out.strip
end
task :clean do
sh 'git clean -fdx lib'
sh 'rm -rf hypothesis-specs*.gem'
sh 'rm -rf ../target'
end
task gem: :clean do
sh 'gem build hypothesis-specs.gemspec'
end
|