- Ruby script with no external dependencies
- Ruby app with ruby gem dependency (faker)
- Ruby app with ruby & native gem dependency (faker + sqlite3)
- Rack app with ruby & native gem dependency (pact_broker)
- Rails app with ruby & native gem dependency (rails)
See the GitHub Actions build script .github/workflows/package.yml to see the demos built and tested cross platform.
- cd
examples/<demo> bundle exec rake package- package app for all platformsbundle exec rake package:darwin-arm64for indiv platformDIR_ONLY=1 bundle exec rake package:darwin-arm64to skip packaging, useful for testing
- To test each demo app, from the root of this repo
APP_NAME=<demo> ./scripts/unpack-and-test.sh
-
You can only use applications with native gems, and versions that have been published for the required traveling-ruby release. If other gems are required, these can be built by forking the repository and updating the Gemfile.
-
If using bundler and rubygems (anything other than a simple script that uses standard gems), you will need to write a
bundler-configfile to yourpackagingdirectoryBUNDLE_PATH: . BUNDLE_WITHOUT: development BUNDLE_DISABLE_SHARED_GEMS: '1' -
Add all supported platforms to your Gemfile.lock
PLATFORMS aarch64-linux aarch64-mingw-ucrt arm64-darwin arm64-darwin-20 arm64-darwin-21 arm64-darwin-22 arm64-darwin-23 ruby x64-mingw-ucrt x86_64-darwin x86_64-darwin-20 x86_64-darwin-21 x86_64-darwin-22 x86_64-darwin-23 x86_64-linux -
Remove any platform/arch specific resolutions from your Gemfile.lock
-
example
ffi (1.17.2) ffi (1.17.2-aarch64-linux-gnu) ffi (1.17.2-arm64-darwin) ffi (1.17.2-x64-mingw-ucrt) ffi (1.17.2-x86_64-darwin) ffi (1.17.2-x86_64-linux-gnu) -
should be updated to
ffi (1.17.2)
-
-
A wrapper file should be created for
unixandwindowsplatforms, depending on your required level of support
hello
├── Rakefile
├── hello.rb
└── packaging
├── wrapper.bat
└── wrapper.sh
- Print running platform & arch along with fake name
gem
├── Gemfile
├── Gemfile.lock
├── Rakefile
├── gem.rb
└── packaging
├── Gemfile
├── Gemfile.lock
├── bundler-config
├── wrapper.bat
└── wrapper.sh
- Generate fake name with faker gem
- Print running platform & arch along with fake name
native
├── Gemfile
├── Gemfile.lock
├── Rakefile
├── native.rb
└── packaging
├── Gemfile
├── Gemfile.lock
├── bundler-config
├── wrapper.bat
└── wrapper.sh
- Generate fake name with faker gem
- Print running platform & arch along with fake name
- Create sqlite3 db
- Insert fake name into sqlite3 db
- Read database contents back
pact_broker
├── Gemfile
├── Gemfile.lock
├── Rakefile
├── packaging
│ ├── Gemfile
│ ├── Gemfile.lock
│ ├── GettingStartedOrderWeb-GettingStartedOrderApi.json
│ ├── bundler-config
│ ├── config.ru
│ ├── wrapper.bat
│ └── wrapper.sh
└── pact_broker.rb
- Pact broker (Rake based) app is configured via
config.ru - Pact broker app is started cross platform
- curl request is made to the homepage to check server is available
- Pact broker client app (in ruby) publishes pact contract file to pact broker
rails
├── Gemfile
├── Gemfile.lock
├── Rakefile
└── packaging
├── Gemfile
├── Gemfile.lock
├── bundler-config
├── wrapper.bat
└── wrapper.sh
- New rails app is created during packaging
- Rails app is started cross platform
- curl request is made to the homepage