class Neovim::Executable

Object representing the `nvim` executable.

Constants

VERSION_PATTERN

Attributes

path[R]

Public Class Methods

from_env(env=ENV) click to toggle source

Load the current executable from the NVIM_EXECUTABLE environment variable.

@param env [Hash] @return [Executable]

# File lib/neovim/executable.rb, line 13
def self.from_env(env=ENV)
  new(env.fetch("NVIM_EXECUTABLE", "nvim"))
end
new(path) click to toggle source
# File lib/neovim/executable.rb, line 19
def initialize(path)
  @path = path
end

Public Instance Methods

version() click to toggle source

Fetch the nvim version.

@return [String]

# File lib/neovim/executable.rb, line 26
def version
  @version ||= IO.popen([@path, "--version"]) do |io|
    io.gets[VERSION_PATTERN, 1]
  end
rescue => e
  raise Error, "Couldn't load #{@path}: #{e}"
end