Skip to content

Commit

Permalink
Merge pull request #14 from fetlife/ruby-3.3-compat
Browse files Browse the repository at this point in the history
Ruby 3.3 compatibility
  • Loading branch information
Antti committed Jan 9, 2024
2 parents 14cf963 + d8bb8e9 commit 55d5191
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
*.bundle
*.so
/target
Gemfile.lock
.ruby-version
13 changes: 12 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
require 'rubygems/package_task'

spec = eval(File.read("libfacedetection.gemspec"))
GEM_RUBY_VERSION = "3.3.0"

gem_task = Gem::PackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end

desc "Generate a pre-compiled native gem"
desc "Generate a pre-compiled native gem for #{RUBY_PLATFORM}"
task "gem:native" => ["gem"] do
sh "gem compile #{gem_task.package_dir_path}.gem"
end

desc "Generate a pre-compiled native gem for aarch64-linux"
task "gem:native:aarch64-linux" => ["gem"] do
sh %{docker run --rm --platform linux/arm64 -v $(pwd):/src -w /src ruby:#{GEM_RUBY_VERSION} /bin/bash -c "gem instal gem-compiler; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; source '/root/.cargo/env'; rake gem:native"}
end

desc "Generate a pre-compiled native gem for x86_64-linux"
task "gem:native:x86_64-linux" => ["gem"] do
sh %{docker run --rm --platform linux/amd64 -v $(pwd):/src -w /src ruby:#{GEM_RUBY_VERSION} /bin/bash -c "gem instal gem-compiler; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; source '/root/.cargo/env'; rake gem:native"}
end
2 changes: 1 addition & 1 deletion lib/libfacedetection/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Libfacedetection
VERSION = "0.2.6".freeze
VERSION = "0.2.7".freeze
end
2 changes: 1 addition & 1 deletion libfacedetection.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

$:.push File.expand_path("../lib", __FILE__)
$:.push File.expand_path("lib", __dir__)
require "libfacedetection/version"

Gem::Specification.new do |spec|
Expand Down

0 comments on commit 55d5191

Please sign in to comment.