From 920bb1a68abfca57f553693ea06b54b045d95ea6 Mon Sep 17 00:00:00 2001 From: Ville Immonen Date: Wed, 14 Mar 2018 14:42:45 +0200 Subject: [PATCH] [traveling-fastlane] Fix traveling-ruby failing when installed in a path with spaces traveling-ruby failed to run when installed in a directory with spaces in the path. (See: https://github.com/phusion/traveling-ruby/issues/38) Worked around this by adding the necessary escapes for quotes with `sed` in the build script. Also opened a PR with a proper upstream fix: https://github.com/phusion/traveling-ruby/pull/94 --- dev/traveling-fastlane/RakeFile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dev/traveling-fastlane/RakeFile b/dev/traveling-fastlane/RakeFile index 1c3e2e6993..301a76de58 100644 --- a/dev/traveling-fastlane/RakeFile +++ b/dev/traveling-fastlane/RakeFile @@ -2,7 +2,7 @@ require 'bundler/setup' PACKAGE_NAME = "traveling-fastlane" -VERSION = "1.4.5" +VERSION = "1.4.6" TRAVELING_RUBY_VERSION = "20150715-2.2.2" JSON_VERSION = '1.8.2' UNF_VERSION = '0.0.6' @@ -118,6 +118,15 @@ def create_package target sh "mkdir #{package_dir}/lib/vendor/.bundle" sh "cp packaging/bundler-config #{package_dir}/lib/vendor/.bundle/config" + # Hack to fix traveling-ruby failing when installed in a path that contains spaces. + # https://github.com/phusion/traveling-ruby/issues/38 + sh "mv #{package_dir}/lib/ruby/lib/restore_environment.rb #{package_dir}/lib/ruby/lib/ruby/site_ruby/" + sh <<-eos + sed -i '' -e 's|RUBYOPT=\\\\"-r$ROOT/lib/restore_environment\\\\"|RUBYOPT=\\\\"-rrestore_environment\\\\"|' #{package_dir}/lib/ruby/bin/ruby_environment + sed -i '' -e 's|GEM_HOME="\\(.*\\)"|GEM_HOME=\\\\"\\1\\\\"|' #{package_dir}/lib/ruby/bin/ruby_environment + sed -i '' -e 's|GEM_PATH="\\(.*\\)"|GEM_PATH=\\\\"\\1\\\\"|' #{package_dir}/lib/ruby/bin/ruby_environment + eos + # Put in our native dependencies rather than the one provided by bundle for native_lib, version in {'json':JSON_VERSION, 'unf_ext':UNF_VERSION} do pkg = "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-#{target}-#{native_lib}-#{version}.tar.gz"