From bab84ddbb29879bc19d6a5229bb23e3ecae7fee5 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Sun, 17 Feb 2019 23:09:08 -0700 Subject: [PATCH] Add helper scripts for managing appraisals --- bin/install_gems_in_all_appraisals | 16 ++++++++++++++++ bin/run_all_tests | 16 ++++++++++++++++ bin/supported_ruby_versions | 7 +++++++ bin/update_gem_in_all_appraisals | 17 +++++++++++++++++ bin/update_gems_in_all_appraisals | 16 ++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100755 bin/install_gems_in_all_appraisals create mode 100755 bin/run_all_tests create mode 100755 bin/supported_ruby_versions create mode 100755 bin/update_gem_in_all_appraisals create mode 100755 bin/update_gems_in_all_appraisals diff --git a/bin/install_gems_in_all_appraisals b/bin/install_gems_in_all_appraisals new file mode 100755 index 00000000..1ba61167 --- /dev/null +++ b/bin/install_gems_in_all_appraisals @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euo pipefail + +SUPPORTED_VERSIONS=$(script/supported_ruby_versions) + +install-gems-for-version() { + local version="$1" + (export RBENV_VERSION=$version; bundle && bundle exec appraisal install) +} + +for version in $SUPPORTED_VERSIONS; do + echo + echo "*** Installing gems for $version ***" + install-gems-for-version $version +done diff --git a/bin/run_all_tests b/bin/run_all_tests new file mode 100755 index 00000000..f610f3d8 --- /dev/null +++ b/bin/run_all_tests @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euo pipefail + +SUPPORTED_VERSIONS=$(script/supported_ruby_versions) + +run-tests-for-version() { + local version="$1" + (export RBENV_VERSION=$version; bundle exec rake) +} + +for version in $SUPPORTED_VERSIONS; do + echo + echo "*** Running tests for $version ***" + run-tests-for-version $version +done diff --git a/bin/supported_ruby_versions b/bin/supported_ruby_versions new file mode 100755 index 00000000..003e2b1c --- /dev/null +++ b/bin/supported_ruby_versions @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby + +require 'yaml' + +travis_config_path = File.expand_path('../../.travis.yml', __FILE__) +travis_config = YAML.load_file(travis_config_path) +puts travis_config.fetch('rvm').join(' ') diff --git a/bin/update_gem_in_all_appraisals b/bin/update_gem_in_all_appraisals new file mode 100755 index 00000000..51694bb5 --- /dev/null +++ b/bin/update_gem_in_all_appraisals @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euo pipefail + +SUPPORTED_VERSIONS=$(script/supported_ruby_versions) +gem="$1" + +update-gem-for-version() { + local version="$1" + (export RBENV_VERSION=$version; bundle update "$gem"; bundle exec appraisal update "$gem") +} + +for version in $SUPPORTED_VERSIONS; do + echo + echo "*** Updating $gem for $version ***" + update-gem-for-version $version +done diff --git a/bin/update_gems_in_all_appraisals b/bin/update_gems_in_all_appraisals new file mode 100755 index 00000000..d2ac309a --- /dev/null +++ b/bin/update_gems_in_all_appraisals @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euo pipefail + +SUPPORTED_VERSIONS=$(script/supported_ruby_versions) + +update-gems-for-version() { + local version="$1" + (export RBENV_VERSION=$version; bundle update "${@:2}"; bundle exec appraisal update "${@:2}") +} + +for version in $SUPPORTED_VERSIONS; do + echo + echo "*** Updating gems for $version ***" + update-gems-for-version "$version" "$@" +done