Module: Kreuzberg::APIProxy
- Defined in:
- lib/kreuzberg/api_proxy.rb
Overview
Defined Under Namespace
Classes: Error, MissingBinaryError, Server, ServerError
Class Method Summary collapse
-
.find_api_binary ⇒ Pathname
Find the API binary.
-
.missing_binary_message ⇒ String
Error message for missing binary.
-
.run(port: 8000, host: '0.0.0.0') {|Server| ... } ⇒ Object
Run server with a block.
Class Method Details
.find_api_binary ⇒ Pathname
Find the API binary
104 105 106 107 108 109 110 |
# File 'lib/kreuzberg/api_proxy.rb', line 104 def find_api_binary binary_name = Gem.win_platform? ? 'kreuzberg.exe' : 'kreuzberg' found = CLIProxy.search_paths(binary_name).find(&:file?) return found if found raise MissingBinaryError, end |
.missing_binary_message ⇒ String
Error message for missing binary
116 117 118 119 120 121 122 123 |
# File 'lib/kreuzberg/api_proxy.rb', line 116 def <<~MSG.strip kreuzberg binary not found for API server. Build it with: `cargo build --release --package kreuzberg-cli` Or ensure kreuzberg is installed with API support. MSG end |