Files
replicate/packages/ruby/lib/replicate_vfs.rb
zeekay a485f34a14 rebrand: complete litestream -> replicate rename
- All source files, configs, docs, CI renamed
- Binary: replicate (not litestream)
- Config: replicate.yml (litestream.yml as fallback)
- Env: REPLICATE_* (LITESTREAM_* as fallback)
- Socket: /var/run/replicate.sock
- Image: ghcr.io/hanzoai/replicate
- Module: github.com/hanzoai/replicate
- Package name: replicate (Go), replicate-vfs (npm/pip/gem)
- VFS: registered as "replicate", pragmas replicate_*
- C exports: ReplicateVFSRegister, GoReplicate*
- Windows service: Replicate
- Systemd unit: replicate.service
- Upstream attribution preserved (README, upgrade test scripts)
2026-04-09 18:03:37 -07:00

29 lines
705 B
Ruby

require "rbconfig"
module ReplicateVfs
EXT_MAP = {
"linux" => "replicate-vfs.so",
"darwin" => "replicate-vfs.dylib",
}.freeze
def self.loadable_path
os = RbConfig::CONFIG["host_os"]
key = case os
when /linux/ then "linux"
when /darwin/i then "darwin"
else raise "Unsupported platform: #{os}"
end
filename = EXT_MAP.fetch(key)
path = File.join(__dir__, filename)
raise "VFS extension not found at #{path}" unless File.exist?(path)
path
end
def self.load(db)
db.enable_load_extension(true)
db.load_extension(loadable_path.delete_suffix(File.extname(loadable_path)))
db.enable_load_extension(false)
end
end