Class: Docscribe::Server::Client
- Inherits:
-
Object
- Object
- Docscribe::Server::Client
- Defined in:
- lib/docscribe/server/client.rb
Overview
Client for communicating with a running Docscribe daemon.
Instance Method Summary collapse
-
#check(file:, strategy: :safe, **rest) ⇒ Hash<String, Object>?
Send a check request to the server.
-
#fix(file:, strategy: :safe, **rest) ⇒ Hash<String, Object>?
Send a fix request to the server.
- #initialize(socket_path = nil, config_path: nil) ⇒ void constructor
-
#ping ⇒ Hash<String, Object>?
Ping the server and get version/pid/uptime info.
-
#shutdown ⇒ Hash<String, Object>?
Send a shutdown request to the server.
-
#update_types(dir: '.', **rest) ⇒ Hash<String, Object>?
Send an update_types request to the server.
Constructor Details
#initialize(socket_path = nil, config_path: nil) ⇒ void
12 13 14 |
# File 'lib/docscribe/server/client.rb', line 12 def initialize(socket_path = nil, config_path: nil) @socket_path = socket_path || Server.socket_path(config_path) end |
Instance Method Details
#check(file:, strategy: :safe, **rest) ⇒ Hash<String, Object>?
Send a check request to the server.
22 23 24 |
# File 'lib/docscribe/server/client.rb', line 22 def check(file:, strategy: :safe, **rest) request('check', file: file, strategy: strategy, **rest) end |
#fix(file:, strategy: :safe, **rest) ⇒ Hash<String, Object>?
Send a fix request to the server.
32 33 34 |
# File 'lib/docscribe/server/client.rb', line 32 def fix(file:, strategy: :safe, **rest) request('fix', file: file, strategy: strategy, **rest) end |
#ping ⇒ Hash<String, Object>?
Ping the server and get version/pid/uptime info.
55 56 57 |
# File 'lib/docscribe/server/client.rb', line 55 def ping request('ping') end |
#shutdown ⇒ Hash<String, Object>?
Send a shutdown request to the server.
39 40 41 |
# File 'lib/docscribe/server/client.rb', line 39 def shutdown request('shutdown') end |
#update_types(dir: '.', **rest) ⇒ Hash<String, Object>?
Send an update_types request to the server.
48 49 50 |
# File 'lib/docscribe/server/client.rb', line 48 def update_types(dir: '.', **rest) request('update_types', dir: dir, **rest) end |