aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/gem.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/installers/gem.lua')
-rw-r--r--lua/nvim-lsp-installer/installers/gem.lua36
1 files changed, 22 insertions, 14 deletions
diff --git a/lua/nvim-lsp-installer/installers/gem.lua b/lua/nvim-lsp-installer/installers/gem.lua
index 6cd56547..17f53620 100644
--- a/lua/nvim-lsp-installer/installers/gem.lua
+++ b/lua/nvim-lsp-installer/installers/gem.lua
@@ -1,5 +1,7 @@
local path = require "nvim-lsp-installer.path"
local process = require "nvim-lsp-installer.process"
+local installers = require "nvim-lsp-installer.installers"
+local std = require "nvim-lsp-installer.installers.std"
local platform = require "nvim-lsp-installer.platform"
local M = {}
@@ -7,20 +9,26 @@ local M = {}
local gem = platform.is_win and "gem.cmd" or "gem"
function M.packages(packages)
- return function(server, callback, context)
- process.spawn(gem, {
- args = {
- "install",
- "--no-user-install",
- "--install-dir=.",
- "--bindir=bin",
- "--no-document",
- table.concat(packages, " "),
- },
- cwd = server.root_dir,
- stdio_sink = context.stdio_sink,
- }, callback)
- end
+ return installers.pipe {
+ std.ensure_executables {
+ { "ruby", "ruby was not found in path, refer to https://wiki.openstack.org/wiki/RubyGems." },
+ { "gem", "gem was not found in path, refer to https://wiki.openstack.org/wiki/RubyGems." },
+ },
+ function(server, callback, context)
+ process.spawn(gem, {
+ args = {
+ "install",
+ "--no-user-install",
+ "--install-dir=.",
+ "--bindir=bin",
+ "--no-document",
+ table.concat(packages, " "),
+ },
+ cwd = server.root_dir,
+ stdio_sink = context.stdio_sink,
+ }, callback)
+ end,
+ }
end
function M.executable(root_dir, executable)