Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[traveling-fastlane] Fix traveling-ruby failing when installed in a p…
Browse files Browse the repository at this point in the history
…ath with spaces

traveling-ruby failed to run when installed in a directory with spaces
in the path. (See: phusion/traveling-ruby#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:
phusion/traveling-ruby#94
  • Loading branch information
fson committed Mar 14, 2018
1 parent 9a99645 commit 920bb1a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dev/traveling-fastlane/RakeFile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 920bb1a

Please sign in to comment.