From 416d425a4d94b67ce8dac1bee15d574e207f794c Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 11:06:27 +1000 Subject: [PATCH] 0.17.3 --- .github/workflows/ruby.yml | 21 ++++- .gitignore | 9 +- CHANGES.md | 12 +++ EXAMPLES.md | 8 +- Gemfile | 7 ++ Gemfile.lock | 22 ----- NEWS.md | 3 +- README.md | 58 +++++++++--- TODO.md | 15 ++- lib/libclimate.rb | 4 +- lib/libclimate/climate.rb | 4 +- lib/libclimate/libclimate.rb | 4 +- lib/libclimate/version.rb | 6 +- libCLImate.gemspec => libclimate-ruby.gemspec | 39 ++++++-- run_all_unit_tests.sh | 94 ++++++++++++------- 15 files changed, 194 insertions(+), 112 deletions(-) delete mode 100644 Gemfile.lock rename libCLImate.gemspec => libclimate-ruby.gemspec (77%) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index ff21ec7..c29543f 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -7,7 +7,7 @@ # # Created: 15th August 2026 -# Updated: 15th August 2026 +# Updated: 19th August 2026 # name: Ruby @@ -70,13 +70,20 @@ jobs: uses: actions/checkout@v4 - name: Remove Gemfile.lock + shell: bash run: rm -f Gemfile.lock - name: Set up Ruby v${{ matrix.ruby-version }} uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true # runs 'bundle install' and caches installed gems automatically + # Bundler 4 honours Gemfile `lockfile false`, so no Gemfile.lock + # is written. bundler-cache cats that file after `bundle lock` + # and fails on Windows 3.2+ (setup-ruby installs Bundler ~> 4). + bundler-cache: false + + - name: Install gems + run: bundle install - name: Show Ruby version run: ruby -v @@ -87,7 +94,7 @@ jobs: - name: Gem build and install smoke shell: bash run: | - gem build libCLImate.gemspec + gem build libclimate-ruby.gemspec gem install --local libclimate-ruby-*.gem ruby -e "require 'libclimate/version'; abort('VERSION missing') unless defined?(LibCLImate::VERSION); puts LibCLImate::VERSION" @@ -102,13 +109,17 @@ jobs: uses: actions/checkout@v4 - name: Remove Gemfile.lock + shell: bash run: rm -f Gemfile.lock - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3' - bundler-cache: true + ruby-version: '3.4' + bundler-cache: false + + - name: Install gems + run: bundle install - name: Show Ruby version run: ruby -v diff --git a/.gitignore b/.gitignore index 0d510c3..ce639ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ # directories (by name) -/.bzr/ /.bundle/ +/.bzr/ /.config/ /.svn/ +/.vscode/ /.yardoc/ +/_build/ /_yardoc/ /InstalledFiles/ @@ -23,8 +25,10 @@ /tmp/ /vendor/bundle/ + # directories (by pattern) + # files (by name) .DS_Store @@ -32,8 +36,11 @@ .ruby-version .rvmrc +Gemfile.lock + /spec/examples.txt + # files (by pattern) *~ diff --git a/CHANGES.md b/CHANGES.md index 42b14ea..33ecccf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,18 @@ # libCLImate.Ruby - Changes +## 0.17.3 - 19th August 2026 + +* library source **Home:** URLs now use `https`; +* renamed **libCLImate.gemspec** to **libclimate-ruby.gemspec** so the filename stem matches `spec.name`; +* **libclimate-ruby.gemspec**: `required_ruby_version` is the range `>= 2.0`; **Gemfile.lock** and **.ruby-version** excluded from `spec.files`; `spec.summary` matches the README tagline; packaged **AUTHORS**, **CHANGES**, **CONTRIBUTING**, **EXAMPLES**, **FAQ**, **INSTALL**, **NEWS**, **SECURITY**, **TODO**; +* **Gemfile** sets `lockfile false` when Bundler supports it; stop tracking **Gemfile.lock**; +* CI uses `bundler-cache: false` and explicit `bundle install`; **Warnings** job on Ruby **3.4**; `gem build libclimate-ruby.gemspec`; +* updated **run_all_unit_tests.sh** (from https://github.com/synesissoftware/misc-dev-scripts) to skip **tput** when **$TERM** is unset or stdout is not a TTY; +* **README.md**: dropped Downloads / GitHub-release badges; nested **Dependencies** (Efferent / Afferent); listed **oss-src-tools** as a runtime dependent; dropped the broken **xqsr3** related-project URL; +* **EXAMPLES.md** example links are repo-relative (`./examples/…`); + + ## 0.17.2 - 15th August 2026 * added `# frozen_string_literal: true` to all **lib/** sources; diff --git a/EXAMPLES.md b/EXAMPLES.md index 8aa74c4..d3eb521 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -1,10 +1,10 @@ -# libCLImate.Ruby Examples +# libCLImate.Ruby - Examples |Name|Source & Description|Summary| |---|---|---| -|**show_usage_and_version**|[examples/show_usage_and_version.rb](/examples/show_usage_and_version.rb)
[examples/show_usage_and_version.md](/examples/show_usage_and_version.md)|Simple example supporting ```--help``` and ```--version```| -|**flag_and_option_specifications**|[examples/flag_and_option_specifications.rb](/examples/flag_and_option_specifications.rb)
[examples/flag_and_option_specifications.md](/examples/flag_and_option_specifications.md)|Example illustrating various kinds of *flag* and *option* specifications| -|**flag_and_option_specifications**|[examples/flag_and_option_specifications.from_DATA.rb](/examples/flag_and_option_specifications.from_DATA.rb)
[examples/flag_and_option_specifications.from_DATA.md](/examples/flag_and_option_specifications.from_DATA.md)|Example illustrating various kinds of *flag* and *option* specifications loaded from the ``__END__``/``DATA`` section of the program file as **YAML**| +|**show_usage_and_version**|[examples/show_usage_and_version.rb](./examples/show_usage_and_version.rb)
[examples/show_usage_and_version.md](./examples/show_usage_and_version.md)|Simple example supporting ```--help``` and ```--version```| +|**flag_and_option_specifications**|[examples/flag_and_option_specifications.rb](./examples/flag_and_option_specifications.rb)
[examples/flag_and_option_specifications.md](./examples/flag_and_option_specifications.md)|Example illustrating various kinds of *flag* and *option* specifications| +|**flag_and_option_specifications.from_DATA**|[examples/flag_and_option_specifications.from_DATA.rb](./examples/flag_and_option_specifications.from_DATA.rb)
[examples/flag_and_option_specifications.from_DATA.md](./examples/flag_and_option_specifications.from_DATA.md)|Example illustrating various kinds of *flag* and *option* specifications loaded from the ``__END__``/``DATA`` section of the program file as **YAML**| diff --git a/Gemfile b/Gemfile index 29f6d2e..79965e8 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,13 @@ source "https://rubygems.org" +# Suppress lockfile on Bundler 4+ (gem: do not pin the graph). No-op on +# Bundler that lacks the DSL (Ruby 2.x CI). Do not combine with +# ruby/setup-ruby `bundler-cache: true` — that action cats Gemfile.lock +# after `bundle lock` and fails when no file is written (Windows 3.2+, +# where setup-ruby installs Bundler ~> 4). +lockfile false if respond_to?(:lockfile) + gemspec # rake 13 requires Ruby >= 2.3 diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 5574c30..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,22 +0,0 @@ -PATH - remote: . - specs: - libclimate-ruby (0.17.1) - clasp-ruby (~> 0.23, >= 0.23.0.2) - xqsr3 (~> 0.39) - -GEM - remote: https://rubygems.org/ - specs: - clasp-ruby (0.23.1) - xqsr3 (0.39.5) - -PLATFORMS - arm64-darwin-25 - ruby - -DEPENDENCIES - libclimate-ruby! - -BUNDLED WITH - 2.6.9 diff --git a/NEWS.md b/NEWS.md index 4494425..c3c780b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,10 +2,11 @@ | Date | News Item | | ------------------ | ----------------------------------------------------------------------------------------------- | +| 19th August 2026 | [**libCLImate.Ruby** 0.17.3](https://github.com/synesissoftware/libCLImate.Ruby/releases/tag/0.17.3) | | 15th August 2026 | [**libCLImate.Ruby** 0.17.2](https://github.com/synesissoftware/libCLImate.Ruby/releases/tag/0.17.2) | | 30th July 2026 | [**libCLImate.Ruby** 0.17.1](https://github.com/synesissoftware/libCLImate.Ruby/releases/tag/0.17.1) | | 30th July 2026 | **libCLImate.Ruby** 0.17.0.2 released | -| 6th March 2025 | **libCLImate.Ruby** 0.17.0.1 released | +| 5th March 2025 | **libCLImate.Ruby** 0.17.0.1 released | | 10th August 2024 | **libCLImate.Ruby** 0.17.0 released | | 1st December 2023 | **libCLImate.Ruby** 0.16.0.1 released | | 1st December 2023 | **libCLImate.Ruby** 0.16.0 released | diff --git a/README.md b/README.md index 1372621..b586474 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ libCLImate, for Ruby ![Language](https://img.shields.io/badge/Ruby-CC342D?style=flat&logo=ruby&logoColor=white) [![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Gem Version](https://badge.fury.io/rb/libclimate-ruby.svg)](https://badge.fury.io/rb/libclimate-ruby) -[![Gem Downloads](https://img.shields.io/gem/dt/libclimate-ruby.svg)](https://rubygems.org/gems/libclimate-ruby) -[![GitHub release](https://img.shields.io/github/v/release/synesissoftware/libCLImate.Ruby.svg)](https://github.com/synesissoftware/libCLImate.Ruby/releases/latest) [![Last Commit](https://img.shields.io/github/last-commit/synesissoftware/libCLImate.Ruby)](https://github.com/synesissoftware/libCLImate.Ruby/commits/master) [![Ruby](https://github.com/synesissoftware/libCLImate.Ruby/actions/workflows/ruby.yml/badge.svg)](https://github.com/synesissoftware/libCLImate.Ruby/actions/workflows/ruby.yml) @@ -21,6 +19,12 @@ libCLImate, for Ruby - [Where to get help](#where-to-get-help) - [Contribution guidelines](#contribution-guidelines) - [Dependencies](#dependencies) + - [Efferent (fan-out)](#efferent-fan-out) + - [Runtime Dependencies (aka "Normal Dependencies")](#runtime-dependencies-aka-normal-dependencies) + - [Development Dependencies](#development-dependencies) + - [Afferent (fan-in)](#afferent-fan-in) + - [Runtime dependents](#runtime-dependents) + - [Development dependents](#development-dependents) - [Related projects](#related-projects) - [License](#license) @@ -115,25 +119,49 @@ Defect reports, feature requests, and pull requests are welcome on https://githu ### Dependencies -This library has efferent dependencies on: -* the [**CLASP.Ruby**](https://github.com/synesissoftware/CLASP.Ruby) library; and -* the [**xqsr3**](https://github.com/synesissoftware/xqsr3) library. +#### Efferent (fan-out) -It has no known afferent dependencies. +Libraries upon which **libCLImate.Ruby** depends: + + +##### Runtime Dependencies (aka "Normal Dependencies") + +* [**CLASP.Ruby**](https://github.com/synesissoftware/CLASP.Ruby); +* [**xqsr3**](https://github.com/synesissoftware/xqsr3); + + +##### Development Dependencies + +* [**rake**](https://rubygems.org/gems/rake); +* [**test-unit**](https://rubygems.org/gems/test-unit); + + +#### Afferent (fan-in) + +Projects that depend on **libCLImate.Ruby**: + + +##### Runtime dependents + +* [**oss-src-tools**](https://github.com/mwsis/oss-src-tools); + + +##### Development dependents + +* \; ### Related projects -* [**CLASP**](https://github.com/synesissoftware/CLASP/) -* [**CLASP.Go**](https://github.com/synesissoftware/CLASP.Go/) -* [**CLASP.js**](https://github.com/synesissoftware/CLASP.js/) -* [**CLASP.NET**](https://github.com/synesissoftware/CLASP.NET/) -* [**CLASP.Python**](https://github.com/synesissoftware/CLASP.Python/) -* [**CLASP.Ruby**](https://github.com/synesissoftware/CLASP.Ruby/) -* [**libCLImate** (C/C++)](https://github.com/synesissoftware/libCLImate) -* [**libCLImate.Go** (Go)](https://github.com/synesissoftware/libCLImate.Go) -* [**xqsr3**](https://github.com/synesissoftware.com/libCLImate.Ruby-xml/) +* [**CLASP**](https://github.com/synesissoftware/CLASP/); +* [**CLASP.Go**](https://github.com/synesissoftware/CLASP.Go/); +* [**CLASP.js**](https://github.com/synesissoftware/CLASP.js/); +* [**CLASP.NET**](https://github.com/synesissoftware/CLASP.NET/); +* [**CLASP.Python**](https://github.com/synesissoftware/CLASP.Python/); +* [**CLASP.Ruby**](https://github.com/synesissoftware/CLASP.Ruby/); +* [**libCLImate** (C/C++)](https://github.com/synesissoftware/libCLImate); +* [**libCLImate.Go**](https://github.com/synesissoftware/libCLImate.Go); ### License diff --git a/TODO.md b/TODO.md index 5c15580..f17c9c1 100644 --- a/TODO.md +++ b/TODO.md @@ -1,13 +1,6 @@ # libCLImate.Ruby - TODO -## Table of Contents - -- [Functional improvements](#functional-improvements) -- [Performance improvements](#performance-improvements) -- [Packaging improvements](#packaging-improvements) - - ## Functional improvements * [ ] Take `make_abort_message_()` to non-`public` again; @@ -20,8 +13,12 @@ ## Packaging improvements -* [ ] GitHub Actions; -* [ ] Rename gemspec so the filename stem matches `spec.name` (`libCLImate.gemspec` → **libclimate-ruby.gemspec**); +* [x] ~~~GitHub Actions~~~; +* [x] ~~~rename gemspec so the filename stem matches `spec.name` (`libCLImate.gemspec` → **libclimate-ruby.gemspec**)~~~; +* [x] ~~~obtain a **run_all_unit_tests.sh** (from **misc-dev-scripts**) that skips `tput` when `$TERM` is unset or stdout is not a TTY (CI: `tput: No value for $TERM and no -T specified`)~~~; +* [x] ~~~**libclimate-ruby.gemspec**: `required_ruby_version` is the range `>= 2.0`; **Gemfile.lock** and **.ruby-version** excluded from `spec.files`; `spec.summary` matches the README tagline; packaged **AUTHORS**, **CHANGES**, **CONTRIBUTING**, **EXAMPLES**, **FAQ**, **INSTALL**, **NEWS**, **SECURITY**, **TODO**~~~; +* [x] ~~~**Gemfile** sets `lockfile false` when Bundler supports it; stop tracking **Gemfile.lock**; CI uses `bundler-cache: false` because Bundler 4 then writes no lockfile and **ruby/setup-ruby** cache cats **Gemfile.lock**~~~; +* [x] ~~~after the packaging/boilerplate/CI baseline: bump **VERSION** and align **CHANGES**/**NEWS**~~~; diff --git a/lib/libclimate.rb b/lib/libclimate.rb index 7e25b75..032d56b 100644 --- a/lib/libclimate.rb +++ b/lib/libclimate.rb @@ -5,9 +5,9 @@ # Purpose: Top-level include for libclimate.Ruby library # # Created: 13th July 2015 -# Updated: 15th August 2026 +# Updated: 19th August 2026 # -# Home: http://github.com/synesissoftware/libCLImate.Ruby +# Home: https://github.com/synesissoftware/libCLImate.Ruby # # Copyright (c) 2015-2016, Matthew Wilson and Synesis Software # All rights reserved. diff --git a/lib/libclimate/climate.rb b/lib/libclimate/climate.rb index 74b2710..4213530 100644 --- a/lib/libclimate/climate.rb +++ b/lib/libclimate/climate.rb @@ -5,9 +5,9 @@ # Purpose: Definition of the ::LibCLImate::Climate class # # Created: 13th July 2015 -# Updated: 15th August 2026 +# Updated: 19th August 2026 # -# Home: http://github.com/synesissoftware/libCLImate.Ruby +# Home: https://github.com/synesissoftware/libCLImate.Ruby # # Author: Matthew Wilson # diff --git a/lib/libclimate/libclimate.rb b/lib/libclimate/libclimate.rb index cf7fb8d..e45264c 100644 --- a/lib/libclimate/libclimate.rb +++ b/lib/libclimate/libclimate.rb @@ -5,9 +5,9 @@ # Purpose: Main file for libclimate.Ruby library # # Created: 13th July 2015 -# Updated: 15th August 2026 +# Updated: 19th August 2026 # -# Home: http://github.com/synesissoftware/libCLImate.Ruby +# Home: https://github.com/synesissoftware/libCLImate.Ruby # # Copyright (c) 2015-2024, Matthew Wilson and Synesis Software # All rights reserved. diff --git a/lib/libclimate/version.rb b/lib/libclimate/version.rb index f67c576..ff5004a 100644 --- a/lib/libclimate/version.rb +++ b/lib/libclimate/version.rb @@ -5,9 +5,9 @@ # Purpose: Version for libclimate.Ruby library # # Created: 13th July 2015 -# Updated: 15th August 2026 +# Updated: 19th August 2026 # -# Home: http://github.com/synesissoftware/libCLImate.Ruby +# Home: https://github.com/synesissoftware/libCLImate.Ruby # # Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems # Copyright (c) 2015-2019, Matthew Wilson and Synesis Software @@ -45,7 +45,7 @@ module LibCLImate # Current version of the libCLImate.Ruby library - VERSION = '0.17.2' + VERSION = '0.17.3' private VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc: diff --git a/libCLImate.gemspec b/libclimate-ruby.gemspec similarity index 77% rename from libCLImate.gemspec rename to libclimate-ruby.gemspec index 0a476ee..aace07c 100644 --- a/libCLImate.gemspec +++ b/libclimate-ruby.gemspec @@ -1,12 +1,13 @@ -# ######################################################################### # -# File: libclimate.gemspec +# ######################################################################## # +# File: libclimate-ruby.gemspec # # Purpose: Gemspec for libCLImate.Ruby library # # Created: 1st March 2019 -# Updated: 15th August 2026 +# Updated: 19th August 2026 # -# ######################################################################### # +# ######################################################################## # + $:.unshift File.join(File.dirname(__FILE__), 'lib') @@ -16,8 +17,8 @@ require 'libclimate/version' Gem::Specification.new do |spec| spec.name = 'libclimate-ruby' + spec.summary = 'libCLImate, for Ruby' spec.version = LibCLImate::VERSION - spec.summary = 'libCLImate.Ruby' spec.description = <= 2.0', '< 4' ] + spec.required_ruby_version = [ '>= 2.0' ] + + spec.add_runtime_dependency "clasp-ruby", [ '~> 0.23', '>= 0.23.0.2' ] + spec.add_runtime_dependency "xqsr3", [ '>= 0.39.5', '< 1.0' ] spec.metadata = { 'bug_tracker_uri' => 'https://github.com/synesissoftware/libCLImate.Ruby/issues', @@ -47,10 +51,25 @@ END_DESC 'source_code_uri' => 'https://github.com/synesissoftware/libCLImate.Ruby', } - spec.add_runtime_dependency "clasp-ruby", [ '~> 0.23', '>= 0.23.0.2' ] - spec.add_runtime_dependency "xqsr3", [ '>= 0.39.5', '< 1.0' ] - - spec.files = Dir[ 'Rakefile', '{bin,examples,lib,man,spec,test}/**/*', 'README*', 'LICENSE*' ] & `git ls-files -z`.split("\0") + spec.files = Dir[ + 'Rakefile', + '{bin,examples,lib,man,spec,test}/**/*', + 'AUTHORS*', + 'CHANGES*', + 'CONTRIBUTING*', + 'EXAMPLES*', + 'FAQ*', + 'INSTALL*', + 'LICENSE*', + 'NEWS*', + 'README*', + 'SECURITY*', + 'TODO*', + ] & `git ls-files -z`.split("\0") + spec.files -= [ + '.ruby-version', + 'Gemfile.lock', + ] end diff --git a/run_all_unit_tests.sh b/run_all_unit_tests.sh index 6aea55b..0a05634 100755 --- a/run_all_unit_tests.sh +++ b/run_all_unit_tests.sh @@ -8,7 +8,7 @@ # executing each rbenv version # # Created: 9th June 2011 -# Updated: 12th August 2026 +# Updated: 19th August 2026 # # Copyright (c) Matthew Wilson, 2011-2026 # All rights reserved @@ -58,18 +58,20 @@ Basename="$(basename "$Source")" # colours -if command -v tput > /dev/null; then +SisClr_Blue=${FG_BLUE:-} +SisClr_Red=${FG_RED:-} +SisClr_Bold=${FD_BOLD:-} +SisClr_None=${FD_NONE:-} - SisClr_Blue=${FG_BLUE:-$(tput setaf 4)} - SisClr_Red=${FG_RED:-$(tput setaf 1)} - SisClr_Bold=${FD_BOLD:-$(tput bold)} - SisClr_None=${FD_NONE:-$(tput sgr0)} -else +if [ -n "${TERM:-}" ] && [ -t 1 ] && command -v tput >/dev/null 2>&1; then + + if tput sgr0 >/dev/null 2>&1; then - SisClr_Blue= - SisClr_Red= - SisClr_Bold= - SisClr_None= + SisClr_Blue=${FG_BLUE:-$(tput setaf 4)} + SisClr_Red=${FG_RED:-$(tput setaf 1)} + SisClr_Bold=${FD_BOLD:-$(tput bold)} + SisClr_None=${FD_NONE:-$(tput sgr0)} + fi fi @@ -115,19 +117,19 @@ if [ ! -z "$RunRbEnvAllVersions" ]; then if ! command -v rbenv > /dev/null; then - >&2 echo "$0: ${SisClr_Red}${SisClr_Bold}rbenv${SisClr_None} not detected" + >&2 echo "$0: ${SisClr_Red}${SisClr_Bold}rbenv${SisClr_None} not detected" - exit 1 + exit 1 fi exclusions=() if [ -e "$ProjectDir/.ruby-version-exclusions" ]; then - exclusion_lines=`cat "$ProjectDir/.ruby-version-exclusions"` - for line in $exclusion_lines; do + exclusion_lines=`cat "$ProjectDir/.ruby-version-exclusions"` + for line in $exclusion_lines; do - exclusions+=("$line") - done + exclusions+=("$line") + done fi echo "executing command line '${SisClr_Blue}${SisClr_Bold}$0 ${ForwardArgs[*]}${SisClr_None}' with all Ruby versions ..." @@ -138,11 +140,20 @@ if [ ! -z "$RunRbEnvAllVersions" ]; then current=$(tr -d '[:space:]' < "$ProjectDir/.ruby-version") fi + if ! version_output=$(rbenv versions --bare); then + + >&2 echo "$0: ${SisClr_Red}${SisClr_Bold}failed to enumerate Ruby versions via rbenv${SisClr_None}" + exit 1 + fi + versions=() - while IFS= read -r line; do + if [ -n "$version_output" ]; then - versions+=("$line") - done < <(rbenv versions --bare) + while IFS= read -r line; do + + versions+=("$line") + done <<< "$version_output" + fi echo "versions: ${SisClr_Blue}${SisClr_Bold}${versions[*]}${SisClr_None}; skipped versions: ${SisClr_Blue}${SisClr_Bold}${exclusions[*]}${SisClr_None}; current version: ${SisClr_Blue}${SisClr_Bold}${current:-(none)}${SisClr_None}" @@ -151,32 +162,32 @@ if [ ! -z "$RunRbEnvAllVersions" ]; then for version in "${versions[@]}" do - echo + echo - skip= + skip= - for exclusion in "${exclusions[@]}"; do + for exclusion in "${exclusions[@]}"; do - if [[ "$exclusion" == "$version" ]]; then + if [[ "$exclusion" == "$version" ]]; then - skip=1 - fi - done + skip=1 + fi + done - if [ "$skip" != "" ]; then + if [ "$skip" != "" ]; then - echo "skipping Ruby version ${SisClr_Blue}${SisClr_Bold}$version${SisClr_None}:" - else + echo "skipping Ruby version ${SisClr_Blue}${SisClr_Bold}$version${SisClr_None}:" + else - echo "processing Ruby version ${SisClr_Blue}${SisClr_Bold}$version${SisClr_None}:" + echo "processing Ruby version ${SisClr_Blue}${SisClr_Bold}$version${SisClr_None}:" - echo -e "\texecuting command line 'RBENV_VERSION=$version $0 ${ForwardArgs[*]}' with Ruby version $version ..." + echo -e "\texecuting command line 'RBENV_VERSION=$version $0 ${ForwardArgs[*]}' with Ruby version $version ..." - if ! RBENV_VERSION="$version" "$0" "${ForwardArgs[@]}"; then + if ! RBENV_VERSION="$version" "$0" "${ForwardArgs[@]}"; then - result=1 + result=1 + fi fi - fi done exit $result @@ -275,13 +286,24 @@ else result=0 + test_files=$(mktemp "${TMPDIR:-/tmp}/run_all_unit_tests.XXXXXX") || { + >&2 echo "$0: ${SisClr_Red}${SisClr_Bold}failed to create temporary file for test discovery${SisClr_None}" + exit 1 + } + trap 'rm -f "$test_files"' EXIT + + if ! find "$ProjectDir" -name 'tc_*.rb' -print0 > "$test_files"; then + >&2 echo "$0: ${SisClr_Red}${SisClr_Bold}failed to discover test files${SisClr_None}" + exit 1 + fi + while IFS= read -r -d '' testfile; do if ! ruby $DebugFlag $WarningsFlag "$testfile"; then result=1 fi - done < <(find "$ProjectDir" -name 'tc_*.rb' -print0) + done < "$test_files" exit $result fi