Repository navigation
Expand file tree
/
Copy pathRakefile
More file actions
65 lines (54 loc) · 1.86 KB
/
Copy pathRakefile
File metadata and controls
65 lines (54 loc) · 1.86 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
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
# frozen_string_literal: true
require "bundler/setup"
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "lib"
t.libs << "test"
t.test_files = FileList["test/**/*_test.rb"]
t.verbose = true
t.warning = false
end
require "rubocop/rake_task"
RuboCop::RakeTask.new do |t|
t.options += %w[--display-style-guide --display-cop-names --extra-details]
end
task default: %i[test rubocop]
namespace :docs do
desc "Highlight the code blocks of docs/*.html with Rouge"
task :highlight do
ruby "script/highlight_docs.rb"
end
desc "Fail if a code block of docs/*.html is not highlighted"
task "highlight:check" do
ruby "script/highlight_docs.rb", "--check"
end
desc "Write docs/llms.txt and docs/llms-full.txt from docs/*.html and the README"
task :llms do
ruby "script/llms_docs.rb"
end
desc "Fail if docs/llms.txt or docs/llms-full.txt is out of date"
task "llms:check" do
ruby "script/llms_docs.rb", "--check"
end
desc "Render the numbers of docs/*.html from docs/benchmarks.json and docs/bot_coverage.json"
task :render do
ruby "script/render_docs.rb"
end
desc "Fail if a number of docs/*.html is not rendered from its JSON file"
task "render:check" do
ruby "script/render_docs.rb", "--check"
end
end
desc "Benchmark fnando/browser (UPSTREAM=path/to/upstream) and Agentry into docs/benchmarks.json, then render it"
task :bench do
upstream_lib = File.join(ENV.fetch("UPSTREAM") { abort "UPSTREAM=path/to/a clone of fnando/browser at dd88933" }, "lib")
# Outside the bundle, or bundler/setup would put Agentry's lib on upstream's load path.
Bundler.with_unbundled_env do
[["--yjit"], []].each do |jit|
[upstream_lib, "lib"].each { |lib| ruby(*jit, "-I", lib, "bench/request.rb", "--write") }
end
end
Rake::Task["docs:render"].invoke
Rake::Task["docs:llms"].invoke
end