File: run_acceptance.rb

package info (click to toggle)
ruby-neovim 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 548 kB
  • sloc: ruby: 4,178; sh: 23; makefile: 4
file content (39 lines) | stat: -rwxr-xr-x 910 bytes parent folder | download
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
#!/usr/bin/env ruby

require "fileutils"

ENV.delete("VIM")
ENV.delete("VIMRUNTIME")

root = File.expand_path("..", __dir__)
acceptance_root = File.join(root, "spec/acceptance")
themis_rtp = File.join(acceptance_root, "runtime")
themis_home = File.join(themis_rtp, "pack/flavors/start/thinca_vim-themis")
manifest = File.join(themis_rtp, "rplugin_manifest.vim")
vimrc = File.join(themis_rtp, "init.vim")
nvim = ENV.fetch("NVIM_EXECUTABLE", "nvim")

themis_exe = Gem.win_platform? ?
  File.join(themis_home, "bin/themis.bat") :
  File.join(themis_home, "bin/themis")

env = {
  "NVIM_RPLUGIN_MANIFEST" => manifest,
  "THEMIS_VIM" => nvim,
  "THEMIS_HOME" => themis_home,
  "THEMIS_ARGS" => "-e --headless -u #{vimrc}"
}

FileUtils.rm_f(manifest)

Dir.chdir(root) do
  system(
    env,
    nvim,
    "-e", "--headless",
    "-u", vimrc,
    "+UpdateRemotePlugins", "+qa!"
  )

  exec(env, themis_exe, *ARGV)
end