-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ruby): dynamic bundler and cocoapods (#252)
* feat(ruby): dynamic bundler and cocoapods * fix: add allow-root arg
- Loading branch information
Showing
7 changed files
with
125 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
check_command ruby | ||
|
||
. /usr/local/buildpack/utils/ruby.sh | ||
|
||
gem_install | ||
gem_shell_wrapper | ||
|
||
bundler --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
check_command ruby | ||
|
||
. /usr/local/buildpack/utils/ruby.sh | ||
|
||
gem_install | ||
gem_shell_wrapper pod | ||
|
||
pod --version --allow-root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
function gem_install() { | ||
tool_path=$(find_tool_path) | ||
|
||
if [[ -z "${tool_path}" ]]; then | ||
INSTALL_DIR=$(get_install_dir) | ||
base_path=${INSTALL_DIR}/${TOOL_NAME} | ||
tool_path=${base_path}/${TOOL_VERSION} | ||
|
||
mkdir -p ${tool_path} | ||
|
||
GEM_HOME=$tool_path gem install --bindir $tool_path/bin ${TOOL_NAME} -v ${TOOL_VERSION} | ||
|
||
# TODO: clear gem cache | ||
fi | ||
} | ||
|
||
|
||
function gem_link_wrapper() { | ||
link_wrapper ${1:-$TOOL_NAME} $tool_path/bin | ||
} | ||
|
||
function gem_shell_wrapper () { | ||
local install_dir=$(get_install_dir) | ||
local FILE="${install_dir}/bin/${1:-$TOOL_NAME}" | ||
# TODO: make generic | ||
local ruby_version=$(cat /usr/local/ruby/.version) | ||
tool_path=$(find_tool_path) | ||
check_command ${tool_path}/bin/${1:-$TOOL_NAME} | ||
cat > $FILE <<- EOM | ||
#!/bin/bash | ||
export GEM_PATH=${tool_path}:/usr/local/ruby/${ruby_version}/lib/ruby/gems/${ruby_version} PATH=${tool_path}/bin:\$PATH | ||
${1:-$TOOL_NAME} "\$@" | ||
EOM | ||
chmod +x $FILE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters