From a210f012155dcd25054f8806ec85389045592649 Mon Sep 17 00:00:00 2001 From: Todd Fisher Date: Sat, 25 Feb 2023 13:14:31 -0500 Subject: [PATCH] rubygems need to have the files in the local dir before packaging --- bindings/ruby/Rakefile | 7 +++++-- bindings/ruby/lib/whispercpp.gemspec.erb | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bindings/ruby/Rakefile b/bindings/ruby/Rakefile index 5fe0fe6..2ba61ac 100644 --- a/bindings/ruby/Rakefile +++ b/bindings/ruby/Rakefile @@ -1,15 +1,18 @@ require 'erb' require 'rubygems/package' +BUILD_VERSION=1 # Determine the current version of the software if File.read('../../CMakeLists.txt') =~ /project.*\s*VERSION\s*(\d.+)\)/ - CURRENT_VERSION = $1 + CURRENT_VERSION = "#{$1}.#{BUILD_VERSION}" else - CURRENT_VERSION = "0.0.0" + CURRENT_VERSION = "0.0.0.#{BUILD_VERSION}" end desc 'Generate gem specification' task :gemspec do + system("cp ../../LICENSE .") + system("cp ../../README.md .") tspec = ERB.new(File.read(File.join(File.dirname(__FILE__),'lib','whispercpp.gemspec.erb'))) File.open(File.join(File.dirname(__FILE__),'whispercpp.gemspec'),'wb') do|f| f << tspec.result diff --git a/bindings/ruby/lib/whispercpp.gemspec.erb b/bindings/ruby/lib/whispercpp.gemspec.erb index 1ccba1a..e1e6e4b 100644 --- a/bindings/ruby/lib/whispercpp.gemspec.erb +++ b/bindings/ruby/lib/whispercpp.gemspec.erb @@ -5,9 +5,9 @@ Gem::Specification.new do |s| s.date = '<%= Time.now.strftime("%Y-%m-%d") %>' s.description = %q{High-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model via Ruby} s.email = 'todd.fisher@gmail.com' - s.extra_rdoc_files = ['../../LICENSE', '../../README.md'] + s.extra_rdoc_files = ['LICENSE', 'README.md'] <% - files = %w(../../LICENSE ../../README.md Rakefile ext/extconf.rb) + + files = %w(LICENSE README.md Rakefile ext/extconf.rb) + Dir["lib/**/**.rb"] + Dir["ext/**/**.c"] + Dir["ext/**/**.cpp"] +