This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new d2ba7f7  [Ruby] Don't use ../ for RubyGems packaging (#119)
d2ba7f7 is described below

commit d2ba7f706456fd8e45167bbc99e06011ceeed866
Author: Sutou Kouhei <[email protected]>
AuthorDate: Fri Sep 9 23:04:22 2022 +0900

    [Ruby] Don't use ../ for RubyGems packaging (#119)
    
    Fix #118
---
 .github/workflows/cpp.yml |  3 +++
 ruby/.gitignore           |  3 +++
 ruby/red-adbc.gemspec     | 13 +++++++++++--
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml
index e8b349a..41fbc40 100644
--- a/.github/workflows/cpp.yml
+++ b/.github/workflows/cpp.yml
@@ -182,11 +182,14 @@ jobs:
           export DYLD_LIBRARY_PATH=$HOME/local/lib
           export 
GI_TYPELIB_PATH=$HOME/local/lib/girepository-1.0:$CONDA_PREFIX/lib/girepository-1.0
           export LD_LIBRARY_PATH=$HOME/local/lib
+          export 
PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig:$CONDA_PREFIX/lib/pkgconfig
           pushd ruby
           bundle install
           bundle exec \
             env DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH} \
               ruby test/run.rb
+          bundle exec rake build
+          gem install pkg/*.gem
           popd
 
 
diff --git a/ruby/.gitignore b/ruby/.gitignore
new file mode 100644
index 0000000..a0da271
--- /dev/null
+++ b/ruby/.gitignore
@@ -0,0 +1,3 @@
+/LICENSE.txt
+/NOTICE.txt
+/pkg/
diff --git a/ruby/red-adbc.gemspec b/ruby/red-adbc.gemspec
index 01f5ffd..65dfb0b 100644
--- a/ruby/red-adbc.gemspec
+++ b/ruby/red-adbc.gemspec
@@ -17,6 +17,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
+require "fileutils"
+
 require_relative "lib/adbc/version"
 
 Gem::Specification.new do |spec|
@@ -32,8 +34,15 @@ Gem::Specification.new do |spec|
     "ADBC (Apache Arrow Database Connectivity) is an API standard for " +
     "database access libraries that uses Apache Arrow for data."
   spec.license = "Apache-2.0"
-  spec.files = ["../README.md", "Rakefile", "Gemfile", "#{spec.name}.gemspec"]
-  spec.files += ["../LICENSE.txt", "../NOTICE.txt"]
+  spec.files = ["README.md"]
+  shared_files = [
+    "LICENSE.txt",
+    "NOTICE.txt",
+  ]
+  shared_files.each do |file|
+    FileUtils.cp("../#{file}", file)
+    spec.files += [file]
+  end
   spec.files += Dir.glob("lib/**/*.rb")
   spec.extensions = ["dependency-check/Rakefile"]
 

Reply via email to