-
Notifications
You must be signed in to change notification settings - Fork 17
/
Rakefile
50 lines (40 loc) · 1.06 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
44
45
46
47
48
49
50
require "bundler/gem_tasks"
require "rspec/core/rake_task"
Bundler.setup
namespace :spec do
desc "Run functional specs"
RSpec::Core::RakeTask.new(:functional)
desc "Run acceptance specs"
task acceptance: "acceptance:deps" do
run_script("run_acceptance.rb", "--reporter", "dot", "spec/acceptance")
end
namespace :acceptance do
desc "Install acceptance spec dependencies"
task :deps do
sh "vim-flavor update --vimfiles-path=spec/acceptance/runtime"
end
end
end
namespace :docs do
desc "Generate Neovim remote API docs"
task :generate do
run_script("generate_docs.rb")
end
end
namespace :ci do
task :download_nvim do
run_script("ci/download_nvim.sh")
end
end
desc "Run specs"
task spec: [:"spec:functional", :"spec:acceptance"]
task default: :spec
def run_script(relpath, *args)
path = File.expand_path("script/#{relpath}", __dir__)
cmd_handler = ->(ok, status) { ok || exit(status.exitstatus) }
if File.extname(path) == ".rb"
ruby(path, *args, &cmd_handler)
else
sh(path, *args, &cmd_handler)
end
end