Class: Docscribe::Server::Client
- Inherits:
-
Object
- Object
- Docscribe::Server::Client
- Defined in:
- lib/docscribe/server.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.
Constructor Details
#initialize(socket_path = nil, config_path: nil) ⇒ void
276 277 278 |
# File 'lib/docscribe/server.rb', line 276 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.
286 287 288 |
# File 'lib/docscribe/server.rb', line 286 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.
296 297 298 |
# File 'lib/docscribe/server.rb', line 296 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.
310 311 312 |
# File 'lib/docscribe/server.rb', line 310 def ping request('ping') end |
#shutdown ⇒ Hash<String, Object>?
Send a shutdown request to the server.
303 304 305 |
# File 'lib/docscribe/server.rb', line 303 def shutdown request('shutdown') end |