Skip to content

Commit

Permalink
Add helper scripts for managing appraisals
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmire committed Feb 18, 2019
1 parent f48c9eb commit bab84dd
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/install_gems_in_all_appraisals
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions bin/run_all_tests
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions bin/supported_ruby_versions
Original file line number Diff line number Diff line change
@@ -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(' ')
17 changes: 17 additions & 0 deletions bin/update_gem_in_all_appraisals
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions bin/update_gems_in_all_appraisals
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bab84dd

Please sign in to comment.