-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add pact-stub-service to standalone package
- Loading branch information
Showing
6 changed files
with
55 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,17 @@ | ||
@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= | ||
|
||
:: Run the actual app using the bundled Ruby interpreter, with Bundler activated. | ||
@"%ROOT_PATH%\lib\ruby\bin\ruby.bat" -rbundler/setup -I%ROOT_PATH%\lib\app\lib "%ROOT_PATH%\lib\app\pact-stub-service.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,2 @@ | ||
require 'pact/stub_service/cli' | ||
Pact::StubService::CLI.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,25 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
SOURCE="$0" | ||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | ||
TARGET="$(readlink "$SOURCE")" | ||
if [[ $TARGET == /* ]]; 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 | ||
|
||
# Run the actual app using the bundled Ruby interpreter, with Bundler activated. | ||
exec "$LIBDIR/ruby/bin/ruby" -rreadline -rbundler/setup -I$LIBDIR/app/lib "$LIBDIR/app/pact-stub-service.rb" $@ |
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