1 # frozen_string_literal: true
2
3 require_relative 'lib/onde/version'
4
5 Gem::Specification.new do |spec|
6 spec.name = 'onde-inference'
7 spec.version = Onde::VERSION
8 spec.authors = ['Seto Elkahfi']
9 spec.email = ['setoelkahfi@gmail.com']
10
11 spec.summary = 'On-device AI inference for Ruby — powered by Rust.'
12 spec.description = 'Ruby bindings for the Onde inference engine. ' \
13 'Run LLMs and speech-to-text locally with automatic ' \
14 'HuggingFace model management, cache inspection, and GPU acceleration.'
15 spec.homepage = 'https://ondeinference.com'
16 spec.license = 'MIT'
17 spec.required_ruby_version = '>= 3.0.0'
18 spec.required_rubygems_version = '>= 3.3.11'
19
20 spec.metadata['homepage_uri'] = spec.homepage
21 spec.metadata['source_code_uri'] = 'https://github.com/ondeinference/onde'
22 spec.metadata['changelog_uri'] = 'https://github.com/ondeinference/onde/blob/main/CHANGELOG.md'
23 # Tell rb_sys / RbSys::ExtensionTask the actual Rust crate name so it
24 # resolves gem/ext/onde-ruby/Cargo.toml instead of walking up to the
25 # parent lib/crates/onde/Cargo.toml (name = "onde").
26 spec.metadata['cargo_crate_name'] = 'onde-ruby'
27
28 # Explicit file list — git ls-files does not work reliably in monorepo
29 # subdirectories that may be untracked or partially ignored.
30 # We exclude target/ directories (Cargo build artifacts), compiled native
31 # extensions (.bundle, .so, .dylib, .dll, .o, .a), and tmp/ build staging.
32 spec.files = Dir.chdir(__dir__) do
33 Dir.glob('{lib,ext}/**/*').select { |f| File.file?(f) }
34 .reject { |f| f.include?('/target/') }
35 .reject { |f| f.match?(/\.(bundle|so|dylib|dll|o|a|dSYM)$/) }
36 .reject { |f| f.start_with?('tmp/') } +
37 %w[
38 Cargo.toml
39 Cargo.lock
40 README.md
41 rust-toolchain.toml
42 ]
43 end.select { |f| File.exist?(File.join(__dir__, f)) }
44
45 spec.bindir = 'exe'
46 spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
47 spec.require_paths = ['lib']
48 spec.extensions = ['ext/onde-ruby/Cargo.toml']
49 end