Skip to content

Apache DataFusion SQL Query Engine

ARROW-2537: [Ruby] Import

Kouhei Sutou3d6ae070734c
diff --git a/.travis.yml b/.travis.yml
index 34ab5c18dc..7918eb8a6c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -151,7 +151,7 @@ matrix:
- $TRAVIS_BUILD_DIR/ci/travis_before_script_js.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_js.sh
- # C++ & glib w/ gcc 4.9
+ # C++ & GLib & Ruby w/ gcc 4.9
- compiler: gcc
language: cpp
os: linux
@@ -160,13 +160,15 @@ matrix:
- CC="gcc-4.9"
- CXX="g++-4.9"
before_script:
- - if [ $ARROW_CI_C_GLIB_AFFECTED != "1" ]; then exit; fi
+ - if [ $ARROW_CI_RUBY_AFFECTED != "1" ]; then exit; fi
- $TRAVIS_BUILD_DIR/ci/travis_install_linux.sh
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh --only-library
- $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh
+ - $TRAVIS_BUILD_DIR/ci/travis_before_script_ruby.sh
script:
- - $TRAVIS_BUILD_DIR/ci/travis_script_c_glib.sh
- # [OS X] C++ & glib w/ XCode 8.3 & homebrew
+ - if [ $ARROW_CI_C_GLIB_AFFECTED = "1" ]; then $TRAVIS_BUILD_DIR/ci/travis_script_c_glib.sh; fi
+ - $TRAVIS_BUILD_DIR/ci/travis_script_ruby.sh
+ # [OS X] C++ & GLib & Ruby w/ XCode 8.3 & homebrew
- compiler: clang
osx_image: xcode8.3
os: osx
@@ -174,12 +176,14 @@ matrix:
addons:
rvm: 2.2
before_script:
- - if [ $ARROW_CI_C_GLIB_AFFECTED != "1" ]; then exit; fi
+ - if [ $ARROW_CI_RUBY_AFFECTED != "1" ]; then exit; fi
- $TRAVIS_BUILD_DIR/ci/travis_install_osx.sh
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh --only-library --homebrew
- $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh
+ - $TRAVIS_BUILD_DIR/ci/travis_before_script_ruby.sh
script:
- - $TRAVIS_BUILD_DIR/ci/travis_script_c_glib.sh
+ - if [ $ARROW_CI_C_GLIB_AFFECTED = "1" ]; then $TRAVIS_BUILD_DIR/ci/travis_script_c_glib.sh; fi
+ - $TRAVIS_BUILD_DIR/ci/travis_script_ruby.sh
# Rust
- language: rust
cache: cargo
diff --git a/ci/detect-changes.py b/ci/detect-changes.py
index fce2ba5d94..b2b87204a2 100644
--- a/ci/detect-changes.py
+++ b/ci/detect-changes.py
@@ -26,7 +26,7 @@ import subprocess
perr = functools.partial(print, file=sys.stderr)
-LANGUAGE_TOPICS = ['c_glib', 'cpp', 'java', 'js', 'python', 'rust']
+LANGUAGE_TOPICS = ['c_glib', 'cpp', 'java', 'js', 'python', 'ruby', 'rust']
ALL_TOPICS = LANGUAGE_TOPICS + ['integration', 'site']
@@ -141,7 +141,10 @@ def get_affected_topics(affected_files):
elif p in ('java', 'js'):
affected[p] = True
affected['integration'] = True
- elif p in ('c_glib', 'integration', 'python', 'site', 'rust'):
+ elif p in ('c_glib'):
+ affected[p] = True
+ affected['ruby'] = True
+ elif p in ('integration', 'python', 'site', 'ruby', 'rust'):
affected[p] = True
return affected
diff --git a/ci/travis_before_script_ruby.sh b/ci/travis_before_script_ruby.sh
new file mode 100755
index 0000000000..c70168715c
--- /dev/null
+++ b/ci/travis_before_script_ruby.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
+
+pushd $ARROW_RUBY_DIR/red-arrow
+bundle install
+popd
+
+# TODO: GPU required
+# pushd $ARROW_RUBY_DIR/red-arrow-gpu
+# bundle install
+# popd
diff --git a/ci/travis_env_common.sh b/ci/travis_env_common.sh
index 42a3bbc4b5..8704bd4660 100755
--- a/ci/travis_env_common.sh
+++ b/ci/travis_env_common.sh
@@ -29,6 +29,7 @@ export ARROW_C_GLIB_DIR=$TRAVIS_BUILD_DIR/c_glib
export ARROW_JAVA_DIR=${TRAVIS_BUILD_DIR}/java
export ARROW_JS_DIR=${TRAVIS_BUILD_DIR}/js
export ARROW_INTEGRATION_DIR=$TRAVIS_BUILD_DIR/integration
+export ARROW_RUBY_DIR=$TRAVIS_BUILD_DIR/ruby
export ARROW_RUST_DIR=${TRAVIS_BUILD_DIR}/rust
if [ $ARROW_TRAVIS_COVERAGE == "1" ]; then
diff --git a/ci/travis_script_ruby.sh b/ci/travis_script_ruby.sh
new file mode 100755
index 0000000000..57ca652588
--- /dev/null
+++ b/ci/travis_script_ruby.sh
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
+
+arrow_ruby_run_test()
+{
+ local arrow_c_glib_lib_dir=$1
+
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$arrow_c_glib_lib_dir
+ export GI_TYPELIB_PATH=$arrow_c_glib_lib_dir/girepository-1.0
+ test/run-test.rb
+}
+
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ARROW_CPP_INSTALL/lib
+export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_CPP_INSTALL/lib/pkgconfig
+
+pushd $ARROW_RUBY_DIR/red-arrow
+(arrow_ruby_run_test $ARROW_C_GLIB_INSTALL_AUTOTOOLS/lib)
+if [ -d $ARROW_C_GLIB_INSTALL_MESON/lib/$(arch)-linux-gnu ]; then
+ (arrow_ruby_run_test $ARROW_C_GLIB_INSTALL_MESON/lib/$(arch)-linux-gnu)
+# else # TODO: Enable this
+# (arrow_ruby_run_test $ARROW_C_GLIB_INSTALL_MESON/lib)
+fi
+popd
+
+# TODO: GPU required
+# pushd $ARROW_RUBY_DIR/red-arrow-gpu
+# (arrow_ruby_run_test $ARROW_C_GLIB_INSTALL_AUTOTOOLS/lib)
+# if [ -d $ARROW_C_GLIB_INSTALL_MESON/lib/$(arch)-linux-gnu ]; then
+# (arrow_ruby_run_test $ARROW_C_GLIB_INSTALL_MESON/lib/$(arch)-linux-gnu)
+# # else # TODO: Enable this
+# # (arrow_ruby_run_test $ARROW_C_GLIB_INSTALL_MESON/lib)
+# fi
+# popd