-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
43 lines (35 loc) · 1 KB
/
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
36
37
38
39
40
41
42
43
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "yard"
require "yard/doctest/rake"
RSpec::Core::RakeTask.new(:spec) do |t|
# TruffleRuby 21.2.0 reports as "like ruby 2.7.3" but does not support pattern matching
t.exclude_pattern = "spec/rb27/*" if RUBY_VERSION < '2.7.0' || RUBY_ENGINE == "truffleruby"
end
task :docs do
Rake::Task["docs:yard"].invoke
Rake::Task["docs:yard:doctest"].invoke
end
namespace :docs do
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb']
t.options = []
t.stats_options = ['--list-undoc']
end
task :fswatch do
sh 'fswatch -0 lib | while read -d "" e; do rake docs:yard; done'
end
YARD::Doctest::RakeTask.new do |task|
task.doctest_opts = %w[-v]
task.pattern = Dir.glob('lib/**/*.rb')
end
end
desc "Test example code in user-docs (aka pages)"
task :byexample do
system "#{__dir__}/bin/byexample"
end
task :default do
Rake::Task["spec"].invoke
Rake::Task["docs:yard:doctest"].invoke
end