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
259 260 261 |
# File 'lib/docscribe/server.rb', line 259 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.
269 270 271 |
# File 'lib/docscribe/server.rb', line 269 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.
279 280 281 |
# File 'lib/docscribe/server.rb', line 279 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.
293 294 295 |
# File 'lib/docscribe/server.rb', line 293 def ping request('ping') end |
#shutdown ⇒ Hash<String, Object>?
Send a shutdown request to the server.
286 287 288 |
# File 'lib/docscribe/server.rb', line 286 def shutdown request('shutdown') end |