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
|
require "neovim/version"
module Neovim
# @api private
class ClientInfo
HOST_METHOD_SPEC = {poll: {}, specs: {nargs: 1}}.freeze
ATTRIBUTES = {
website: "https://github.com/neovim/neovim-ruby",
license: "MIT"
}.freeze
def self.for_host(host)
name = host.plugins.map(&:script_host?) == [true] ?
"ruby-script-host" :
"ruby-rplugin-host"
new(name, :host, HOST_METHOD_SPEC, ATTRIBUTES)
end
def self.for_client
new("ruby-client", :remote, {}, ATTRIBUTES)
end
def initialize(name, type, method_spec, attributes)
@name = name
@type = type
@method_spec = method_spec
@attributes = attributes
@version = ["major", "minor", "patch"]
.zip(Neovim::VERSION.segments)
.to_h
end
def to_args
[
@name,
@version,
@type,
@method_spec,
@attributes
]
end
end
end
|