-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
87 additions
and
0 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
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,20 @@ | ||
@echo off | ||
|
||
SET RUNNING_PATH=%~dp0 | ||
CALL :RESOLVE "%RUNNING_PATH%\.." ROOT_PATH | ||
|
||
:: Tell Bundler where the Gemfile and gems are. | ||
set "BUNDLE_GEMFILE=%ROOT_PATH%\lib\vendor\Gemfile" | ||
set BUNDLE_IGNORE_CONFIG= | ||
set RUBYGEMS_GEMDEPS= | ||
set BUNDLE_APP_CONFIG= | ||
set BUNDLE_FROZEN=1 | ||
|
||
:: Run the actual app using the bundled Ruby interpreter, with Bundler activated. | ||
@"%ROOT_PATH%\lib\ruby\bin\ruby.bat" -E UTF-8 -rbundler/setup -I "%ROOT_PATH%\lib\app\lib" "%ROOT_PATH%\lib\app\pactflow.rb" %* | ||
|
||
GOTO :EOF | ||
|
||
:RESOLVE | ||
SET %2=%~f1 | ||
GOTO :EOF |
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,28 @@ | ||
require 'pactflow/client/cli/pactflow' | ||
|
||
class Thor | ||
module Base | ||
module ClassMethods | ||
|
||
def basename | ||
# chomps the trailing .rb so it doesn't show in the help text | ||
File.basename($PROGRAM_NAME).split(" ").first.chomp(".rb") | ||
end | ||
end | ||
end | ||
end | ||
|
||
# Travelling Ruby sets its own CA cert bundle in lib/ruby/bin/ruby_environment | ||
# and creates backup environment variables for the original SSL_CERT values. | ||
# Restore the original values here *if they are present* so that we can connect to | ||
# a broker with a custom SSL certificate. | ||
|
||
if ENV['ORIG_SSL_CERT_DIR'] && ENV['ORIG_SSL_CERT_DIR'] != '' | ||
ENV['SSL_CERT_DIR'] = ENV['ORIG_SSL_CERT_DIR'] | ||
end | ||
|
||
if ENV['ORIG_SSL_CERT_FILE'] && ENV['ORIG_SSL_CERT_FILE'] != '' | ||
ENV['SSL_CERT_FILE'] = ENV['ORIG_SSL_CERT_FILE'] | ||
end | ||
|
||
Pactflow::Client::CLI::Pactflow.start |
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,28 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SOURCE="$0" | ||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | ||
TARGET="$(readlink "$SOURCE")" | ||
START="$( echo "$TARGET" | cut -c 1 )" | ||
if [ "$START" = "/" ]; then | ||
SOURCE="$TARGET" | ||
else | ||
DIR="$( dirname "$SOURCE" )" | ||
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | ||
fi | ||
done | ||
RDIR="$( dirname "$SOURCE" )" | ||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
|
||
# Figure out where this script is located. | ||
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`" | ||
|
||
# Tell Bundler where the Gemfile and gems are. | ||
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile" | ||
unset BUNDLE_IGNORE_CONFIG | ||
unset RUBYGEMS_GEMDEPS | ||
export BUNDLE_FROZEN=1 | ||
|
||
# Run the actual app using the bundled Ruby interpreter, with Bundler activated. | ||
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pactflow.rb" "$@" |