ruby binding 追加

- FFI gem (libptouch)、exe ptouch-print-png(PNG のみ)
- ステータス 32 バイトを Hash に展開(parse_status / status_hash)
- CMake: libptouch 共有ライブラリ(ptouch_shared)
- RuboCop、gemspec(homepage / source_code_uri)

Made-with: Cursor
This commit is contained in:
knb
2026-04-12 16:06:10 +09:00
parent d649b1b014
commit c5c7c2ba52
16 changed files with 889 additions and 0 deletions

31
ruby/libptouch.gemspec Normal file
View File

@@ -0,0 +1,31 @@
# frozen_string_literal: true
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "libptouch/version"
Gem::Specification.new do |spec|
spec.name = "libptouch"
spec.version = Libptouch::VERSION
spec.authors = ["knb"]
spec.email = ["knb@artif.org"]
spec.summary = "FFI bindings for libptouch (Brother P-touch USB raster printing)"
spec.description = [
"Ruby wrapper around the ptouch_label C library libptouch.",
"Requires libptouch shared library (libusb, libpng)."
].join(" ")
spec.license = "MIT"
spec.required_ruby_version = ">= 3.0"
repo = "https://gitea.artif.org/knb/ptouch_label"
spec.homepage = repo
spec.metadata["source_code_uri"] = repo
spec.metadata["rubygems_mfa_required"] = "true"
spec.files = Dir.chdir(__dir__) { Dir["lib/**/*.rb", "exe/*", "README.md"] }
spec.bindir = "exe"
spec.executables = ["ptouch-print-png"]
spec.require_paths = ["lib"]
spec.add_dependency "ffi", "~> 1.15"
end