From 09cdceee37aa7b0cd9ee730ec18c3566256413dd Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 10:01:01 +1000 Subject: [PATCH 01/28] **run_all_unit_tests.sh** : ~ updated to latest (from https://github.com/synesissoftware/misc-dev-scripts) --- run_all_unit_tests.sh | 222 +++++++++++++++++++++++------------------- 1 file changed, 120 insertions(+), 102 deletions(-) diff --git a/run_all_unit_tests.sh b/run_all_unit_tests.sh index 78126a7..6aea55b 100755 --- a/run_all_unit_tests.sh +++ b/run_all_unit_tests.sh @@ -8,9 +8,9 @@ # executing each rbenv version # # Created: 9th June 2011 -# Updated: 12th April 2024 +# Updated: 12th August 2026 # -# Copyright (c) Matthew Wilson, 2011-2024 +# Copyright (c) Matthew Wilson, 2011-2026 # All rights reserved # # Redistribution and use in source and binary forms, with or without @@ -53,144 +53,132 @@ while [ -h "$Source" ]; do [[ $Source != /* ]] && Source="$ScriptDir/$Source" done ScriptDir="$(cd -P "$( dirname "$Source" )" && pwd)" +Basename="$(basename "$Source")" # colours if command -v tput > /dev/null; then - RbEnvClr_Blue=${FG_BLUE:-$(tput setaf 4)} - RbEnvClr_Red=${FG_BLUE:-$(tput setaf 1)} - RbEnvClr_Bold=${FD_BOLD:-$(tput bold)} - RbEnvClr_None=${FD_NONE:-$(tput sgr0)} + 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 - RbEnvClr_Blue= - RbEnvClr_Red= - RbEnvClr_Bold= - RbEnvClr_None= + SisClr_Blue= + SisClr_Red= + SisClr_Bold= + SisClr_None= fi -# special command-line handling ('--pwd') +# special command-line handling ('--pwd', '--rbenv-versions') ProjectDir="$ScriptDir" +ForwardArgs=() +FoundHelp= +RunRbEnvAllVersions= for arg in "$@" do case "$arg" in - --pwd) - - ProjectDir=$(pwd) - ;; - *) - - Arguments="$Arguments $arg" - ;; - esac -done - + --help) -# special command-line handling ('--rbenv-versions') -# rbenv handling - -RunRbEnvAllVersions= -Arguments= + FoundHelp=1 + ForwardArgs+=("$arg") + ;; + --pwd) -for arg in "$@" -do + ProjectDir=$(pwd) + ForwardArgs+=("$arg") + ;; + --rbenv-versions) - case "$arg" in + RunRbEnvAllVersions=1 + ;; + *) - --rbenv-versions) - - RunRbEnvAllVersions=1 - ;; - *) - - Arguments="$Arguments $arg" - ;; + ForwardArgs+=("$arg") + ;; esac done -if [ ! -z "$RunRbEnvAllVersions" ]; then - - if ! command -v rbenv > /dev/null; then +if [ ! -z "$FoundHelp" ]; then - >&2 echo "$0: ${RbEnvClr_Red}${RbEnvClr_Bold}rbenv${RbEnvClr_None} not detected" + RunRbEnvAllVersions= +fi - exit 1 - fi +if [ ! -z "$RunRbEnvAllVersions" ]; then - if [ ! -e "$ProjectDir/.ruby-version" ];then + if ! command -v rbenv > /dev/null; then - >&2 echo "$0: ${RbEnvClr_Red}${RbEnvClr_Bold}.ruby-version${RbEnvClr_None} file 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 '${RbEnvClr_Blue}${RbEnvClr_Bold}$0 $Arguments${RbEnvClr_None}' with all Ruby versions ..." + echo "executing command line '${SisClr_Blue}${SisClr_Bold}$0 ${ForwardArgs[*]}${SisClr_None}' with all Ruby versions ..." - current=$(rbenv local) + current= + if [ -f "$ProjectDir/.ruby-version" ]; then - #echo "current version: $current" + current=$(tr -d '[:space:]' < "$ProjectDir/.ruby-version") + fi versions=() while IFS= read -r line; do - versions+=("$line") + versions+=("$line") done < <(rbenv versions --bare) - echo "versions: ${RbEnvClr_Blue}${RbEnvClr_Bold}${versions[*]}${RbEnvClr_None}; skipped versions: ${RbEnvClr_Blue}${RbEnvClr_Bold}${exclusions[*]}${RbEnvClr_None}; current version: ${RbEnvClr_Blue}${RbEnvClr_Bold}${current}${RbEnvClr_None}" + 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}" result=0 - for version in ${versions[@]} + 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 ${RbEnvClr_Blue}${RbEnvClr_Bold}$version${RbEnvClr_None}:" - else + echo "skipping Ruby version ${SisClr_Blue}${SisClr_Bold}$version${SisClr_None}:" + else - echo "processing Ruby version ${RbEnvClr_Blue}${RbEnvClr_Bold}$version${RbEnvClr_None}:" + echo "processing Ruby version ${SisClr_Blue}${SisClr_Bold}$version${SisClr_None}:" - echo -e "\texecuting command line '$0 $Arguments' with Ruby version $version ..." - rbenv local $version + echo -e "\texecuting command line 'RBENV_VERSION=$version $0 ${ForwardArgs[*]}' with Ruby version $version ..." - if ! $0 $Arguments; then + if ! RBENV_VERSION="$version" "$0" "${ForwardArgs[@]}"; then - result=1 - fi + result=1 fi + fi done - rbenv local $current - exit $result fi @@ -199,6 +187,7 @@ fi Separate= DebugFlag= +PrependLib= WarningsFlag=-W0 for v in "$@" @@ -212,46 +201,58 @@ do ;; --help) - echo "USAGE: $Source { | --help | [ --debug ] [ --separate ] }" - echo - echo "flags:" - echo - echo " --help" - echo " shows this help and terminates" - echo - echo " --debug" - echo " executes Ruby interpreter in debug mode" - echo - echo " --pwd" - echo " executes from present working directory, rather than relative to the script directory" - echo - echo " --rbenv-versions" - echo " executes this script (with all other specified arguments) for each rbenv version (except those listed in the file .ruby-version-exclusions, if present)" - echo - echo " --separate" - echo " executes each unit-test in a separate program" - echo - echo " --warnings" - echo " executes Ruby interpreter in warnings mode" - echo - - exit + cat << EOF +USAGE: $Basename { | --help | [ --debug ] [ --lib ] [ --pwd ] [ --rbenv-versions ] [ --separate ] [ --warnings ]} + +flags: + + --help + shows this help and terminates + + --debug + executes Ruby interpreter in debug mode + + --lib + prepends the lib directory under the script's directory into RUBYLIB before executing + + --pwd + executes from present working directory, rather than relative to the script directory + + --rbenv-versions + executes this script (with all other specified arguments) for each rbenv version (except those listed in the file .ruby-version-exclusions, if present) + + --separate + executes each unit-test in a separate program + + --warnings + executes Ruby interpreter in warnings mode +EOF + + exit 0 + ;; + --lib) + + PrependLib=1 ;; --pwd) + # already-processed as special case above + ;; + --rbenv-versions) + # already-processed as special case above ;; --separate) Separate=true ;; - --warnings) + --warnings|--warn) WarningsFlag=-W2 #-W:performance ;; *) - echo "unrecognised argument; use --help for usage" + >&2 echo "unrecognised argument '$v'; use --help for usage" exit 1 ;; @@ -261,13 +262,30 @@ done # executing tests +if [ ! -z "$PrependLib" ]; then + + export RUBYLIB=$ProjectDir/lib:$RUBYLIB +fi + + if [ -z "$Separate" ]; then ruby $DebugFlag $WarningsFlag "$ProjectDir/test/unit/ts_all.rb" else - find "$ProjectDir" -name 'tc_*.rb' -exec ruby $DebugFlag $WarningsFlag {} \; + result=0 + + while IFS= read -r -d '' testfile; do + + if ! ruby $DebugFlag $WarningsFlag "$testfile"; then + + result=1 + fi + done < <(find "$ProjectDir" -name 'tc_*.rb' -print0) + + exit $result fi + # ############################## end of file ############################# # From 5ccdd4582577f89dd12f739777cf51514414508f Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 11:47:50 +1000 Subject: [PATCH 02/28] boilerplate: markdown files --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 855d1df..85e6e2c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# **libCLImate.Ruby** Changes +# libCLImate.Ruby Changes ## 0.17.1 - 30th July 2026 From 4a23d2f5fdeca020b55faf7b17351a418acc8a51 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 11:54:42 +1000 Subject: [PATCH 03/28] boilerplate: .gitattributes --- .gitattributes | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/.gitattributes b/.gitattributes index e69de29..702382f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -0,0 +1,75 @@ +# .gitattributes — Ruby (GitHub-hosted) +# +# Sources: GitHub Docs (line endings), git-scm gitattributes (diff=ruby), +# gitattributes/gitattributes Common.gitattributes + Web (*.rb), +# github-linguist overrides. + +# Default: detect text, normalize to LF in the repository +* text=auto + +# --- Source --- +*.gemspec text eol=lf diff=ruby +*.rake text eol=lf diff=ruby +*.rb text eol=lf diff=ruby +*.ru text eol=lf diff=ruby +Gemfile text eol=lf diff=ruby +Rakefile text eol=lf diff=ruby +Capfile text eol=lf diff=ruby +Guardfile text eol=lf diff=ruby +*.erb text +*.haml text +*.slim text + +# --- Lock / config --- +Gemfile.lock text -diff +*.gemspec.lock text -diff +*.yml text +*.yaml text +*.toml text +*.json text + +# --- Scripts --- +*.bash text eol=lf +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf +*.sh text eol=lf +*.zsh text eol=lf + +# --- Docs / meta --- +*.adoc text +*.markdown text diff=markdown +*.md text diff=markdown +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +LICENSE text +NEWS text +README text +TODO text +.gitattributes text +.gitignore text + +# --- Binary --- +*.gem binary +*.so binary + +# --- Archives / images (common) --- +*.gif binary +*.gz binary +*.ico binary +*.jpeg binary +*.jpg binary +*.png binary +*.tar binary +*.zip binary + +# --- GitHub Linguist --- +**/vendor/bundle/** linguist-vendored +**/vendor/cache/** linguist-vendored +**/coverage/** linguist-generated +**/doc/** linguist-documentation +**/pkg/** linguist-generated From e2697bfb07d0468f6af00d84e08ce555526cbf0c Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 12:08:51 +1000 Subject: [PATCH 04/28] boilerplate: .vscode/settings.json --- .vscode/settings.json | 264 +++++++----------------------------------- 1 file changed, 41 insertions(+), 223 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0858e77..19efccd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,225 +1,43 @@ { - "[bat]": { - "editor.insertSpaces": true, - "editor.rulers": [ 60, 76, ], - "editor.tabSize": 4, - }, - "[c]": { - "editor.insertSpaces": true, - "editor.rulers": [ 60, 64, 68, 72, 76, - ], - "editor.tabSize": 4, - }, - "[cmake]": { - "editor.insertSpaces": false, - "editor.tabSize": 4, - }, - "[cpp]": { - "editor.insertSpaces": true, - "editor.rulers": [ 60, 64, 68, 72, 76, - ], - "editor.tabSize": 4, - }, - "[csharp]": { - "editor.insertSpaces": true, - "editor.rulers": [ 60, 76, ], - "editor.tabSize": 4, - }, - "[go]": { - "editor.codeActionsOnSave": {}, - "editor.defaultFormatter": "golang.go", - "editor.formatOnSave": true, - "editor.insertSpaces": false, - "editor.tabSize": 2, - }, - "[json]": { - "editor.insertSpaces": false, - "editor.tabSize": 2, - }, - "[markdown]": { - "editor.insertSpaces": true, - "editor.tabSize": 2, - }, - "[python]": { - "diffEditor.ignoreTrimWhitespace": false, - "editor.insertSpaces": true, - "editor.rulers": [ 60, 76, ], - "editor.tabSize": 4, - }, - "[ruby]": { - "editor.insertSpaces": true, - "editor.rulers": [ 60, 76, ], - "editor.tabSize": 2, - }, - "[rust]": { - "editor.insertSpaces": true, - "editor.rulers": [ 60, 76, ], - "editor.tabSize": 4, - }, - "[shellscript]": { - "editor.insertSpaces": true, - "editor.rulers": [ 60, 76, ], - "editor.tabSize": 2, - }, - "[toml]": { - "editor.insertSpaces": false, - "editor.tabSize": 2, - }, - "[typescript]": { - "editor.insertSpaces": true, - "editor.tabSize": 2, - }, - "cmake.configureOnOpen": false, - "editor.detectIndentation": false, - "editor.insertSpaces": false, - "editor.renderWhitespace": "all", - "editor.rulers": [ 76, ], - "editor.tabSize": 2, - "files.associations": { - "__bit_reference": "cpp", - "__bits": "cpp", - "__config": "cpp", - "__debug": "cpp", - "__errc": "cpp", - "__functional_03": "cpp", - "__functional_base": "cpp", - "__hash_table": "cpp", - "__locale": "cpp", - "__memory": "cpp", - "__mutex_base": "cpp", - "__node_handle": "cpp", - "__nullptr": "cpp", - "__split_buffer": "cpp", - "__string": "cpp", - "__threading_support": "cpp", - "__tree": "cpp", - "__tuple": "cpp", - "__verbose_abort": "cpp", - "algorithm": "cpp", - "array": "cpp", - "atomic": "cpp", - "bit": "cpp", - "bitset": "cpp", - "cctype": "cpp", - "charconv": "cpp", - "chrono": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "compare": "cpp", - "complex": "cpp", - "concepts": "cpp", - "console_functions.h": "c", - "corecrt.h": "c", - "crtdefs.h": "c", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "deque": "cpp", - "exception": "cpp", - "execution": "cpp", - "fcntl.h": "c", - "format": "cpp", - "forward_list": "cpp", - "functional": "cpp", - "implicit_link.h": "c", - "initializer_list": "cpp", - "io.h": "c", - "iomanip": "cpp", - "ios": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "iterator": "cpp", - "limits": "cpp", - "list": "cpp", - "locale": "cpp", - "map": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "mutex": "cpp", - "new": "cpp", - "numeric": "cpp", - "optional": "cpp", - "ostream": "cpp", - "queue": "cpp", - "ratio": "cpp", - "set": "cpp", - "setenv.h": "c", - "shwild.h": "c", - "sstream": "cpp", - "stack": "cpp", - "stdexcept": "cpp", - "stdio.h": "c", - "streambuf": "cpp", - "string": "cpp", - "string_view": "cpp", - "system_error": "cpp", - "terse-api.h": "c", - "thread": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "typeinfo": "cpp", - "uio.h": "c", - "unixem.h": "c", - "unordered_map": "cpp", - "util.h": "c", - "utility": "cpp", - "variant": "cpp", - "vector": "cpp", - "xfacet": "cpp", - "xiosbase": "cpp", - "xlocale": "cpp", - "xlocbuf": "cpp", - "xlocinfo": "cpp", - "xlocmes": "cpp", - "xlocmon": "cpp", - "xlocnum": "cpp", - "xloctime": "cpp", - "xmemory": "cpp", - "xstring": "cpp", - "xtests.internal.string.c": "cpp", - "xtr1common": "cpp", - "xtree": "cpp", - "xutility": "cpp", - }, - "files.exclude": { - "**/*.egg-info": true, - "**/*.swp": true, - "**/.git": true, - "**/__pycache__": true, - }, - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "git.mergeEditor": false, - "go.formatFlags": [], - "go.formatTool": "goimports", - "go.lintFlags": [ - "--fast", - ], - "go.lintOnSave": "workspace", - "go.lintTool": "golangci-lint", - "go.useLanguageServer": true, - "gopls": { - "ui.completion.usePlaceholders": true, - "ui.semanticTokens": true, - }, - "python.analysis.typeCheckingMode": "standard", - "python.languageServer": "Pylance", - "rust-analyzer.completion.autoimport.enable": false, - "rust-analyzer.showUnlinkedFileNotification": false, - "search.exclude": { - "**/*.egg-info": true, - "**/*.swp": true, - "**/.git": true, - "**/__pycache__": true, - "**/node_modules": true, - "**/target": true, - }, - "search.useIgnoreFiles": false, + "[json]": { + "editor.insertSpaces": true, + "editor.tabSize": 2, + }, + "[markdown]": { + "editor.insertSpaces": true, + "editor.tabSize": 2, + }, + "[python]": { + "editor.insertSpaces": true, + "editor.rulers": [ 60, 76 ], + "editor.tabSize": 4, + }, + "[ruby]": { + "editor.defaultFormatter": "Shopify.ruby-lsp", + "editor.formatOnSave": true, + "editor.formatOnType": true, + "editor.insertSpaces": true, + "editor.rulers": [ 60, 76 ], + "editor.semanticHighlighting.enabled": true, + "editor.tabSize": 2, + }, + "[shellscript]": { + "editor.insertSpaces": true, + "editor.rulers": [ 60, 76 ], + "editor.tabSize": 2, + }, + "[toml]": { + "editor.insertSpaces": false, + "editor.tabSize": 2, + }, + "cmake.configureOnOpen": false, + "editor.detectIndentation": false, + "editor.insertSpaces": false, + "editor.renderWhitespace": "all", + "editor.rulers": [ 76 ], + "editor.tabSize": 2, + "files.insertFinalNewline": true, + "files.trimTrailingWhitespace": true, + "git.mergeEditor": false, + "rubyLsp.formatter": "auto", } From 638fd526e66725d7adf203e86b0fc0796eb1a2a4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 12:14:51 +1000 Subject: [PATCH 05/28] boilerplate: .vimrc --- .vimrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index 1bf33a0..b8184be 100644 --- a/.vimrc +++ b/.vimrc @@ -1,4 +1,4 @@ -" Synesis C/C++ project .vimrc — aligned with .sis/.vscode/c_cxx/settings.json +" Synesis Ruby project .vimrc — aligned with .vscode/settings.json (2-space Ruby) set nocompatible filetype indent plugin on @@ -17,12 +17,12 @@ set fixeol set list set listchars=tab:->,trail:-,extends:>,precedes:<,nbsp:+ -" editor.detectIndentation: false — global defaults (editor.tabSize: 4, insertSpaces: true) +" editor.detectIndentation: false — global defaults (editor.tabSize: 2, insertSpaces: true) set colorcolumn=76 set expandtab -set shiftwidth=4 -set softtabstop=4 -set tabstop=4 +set shiftwidth=2 +set softtabstop=2 +set tabstop=2 " colorcolumn draws a full-column tint in Vim (not a VS Code-style 1px line). " Keep it subtle via the ColorColumn highlight group; reapply after colorscheme changes. From abedb73c3b957346bf21164ca3cae7b1b20267ca Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 13:23:49 +1000 Subject: [PATCH 06/28] boilerplate: build_gem.cmd, build_gem.sh, generate_rdoc.cmd, generate_rdoc.sh --- .sis/project_name.txt | 1 + build_gem.cmd | 13 +++++++++++++ build_gem.sh | 9 +++------ generate_rdoc.cmd | 28 ++++++++++++++++++++++++++++ generate_rdoc.sh | 35 ++++++++++++++++++----------------- 5 files changed, 63 insertions(+), 23 deletions(-) create mode 100644 .sis/project_name.txt create mode 100644 build_gem.cmd create mode 100644 generate_rdoc.cmd diff --git a/.sis/project_name.txt b/.sis/project_name.txt new file mode 100644 index 0000000..67dc5fe --- /dev/null +++ b/.sis/project_name.txt @@ -0,0 +1 @@ +libCLImate.Ruby diff --git a/build_gem.cmd b/build_gem.cmd new file mode 100644 index 0000000..c894c21 --- /dev/null +++ b/build_gem.cmd @@ -0,0 +1,13 @@ +@ECHO OFF + +REM ######################################################################## +REM File: build_gem.cmd +REM +REM Purpose: Builds the gem +REM +REM Created: 11th July 2016 +REM Updated: 14th August 2026 +REM +REM ######################################################################## + +FOR %%f IN (*.gemspec) DO gem build "%%f" %* diff --git a/build_gem.sh b/build_gem.sh index 6425dde..864823e 100755 --- a/build_gem.sh +++ b/build_gem.sh @@ -5,12 +5,9 @@ # # Purpose: Builds the gem # -# Created: 14th July 2015 -# Updated: 30th July 2026 -# -# Author: Matthew Wilson +# Created: 9th June 2016 +# Updated: 14th August 2026 # ############################################################################# -gem build libCLImate.gemspec $* - +gem build *.gemspec $* diff --git a/generate_rdoc.cmd b/generate_rdoc.cmd new file mode 100644 index 0000000..4f6f7ad --- /dev/null +++ b/generate_rdoc.cmd @@ -0,0 +1,28 @@ +@ECHO OFF + +REM ######################################################################## +REM File: generate_rdoc.cmd +REM +REM Purpose: Generates documentation +REM +REM Created: 14th August 2026 +REM Updated: 14th August 2026 +REM +REM ######################################################################## + +IF EXIST doc RMDIR /S /Q doc +rdoc ^ + -x build_gem.cmd ^ + -x build_gem.sh ^ + -x generate_rdoc.cmd ^ + -x generate_rdoc.sh ^ + -x run_all_unit_tests.sh ^ + -x *.gemspec ^ + -x doc/ ^ + -x gems/ ^ + -x old-gems/ ^ + -x test/performance/ ^ + -x test/scratch/ ^ + -x tc_.*\.rb ^ + -x ts_all.rb ^ + %* diff --git a/generate_rdoc.sh b/generate_rdoc.sh index 8437ae2..e7dc865 100755 --- a/generate_rdoc.sh +++ b/generate_rdoc.sh @@ -6,25 +6,26 @@ # Purpose: Generates documentation # # Created: 11th June 2016 -# Updated: 30th July 2026 +# Updated: 14th August 2026 # ############################################################################# rm -rfd doc rdoc \ - -x build_gem.sh \ - -x generate_rdoc.sh \ - -x run_all_unit_tests.sh \ - -x libCLImate.gemspec \ - \ - -x doc/ \ - -x gems/ \ - -x old-gems/ \ - -x test/scratch/ \ - \ - -x ts_all.rb \ - -x tc_.*\.rb \ - \ - $* - - + -x build_gem.cmd \ + -x build_gem.sh \ + -x generate_rdoc.cmd \ + -x generate_rdoc.sh \ + -x run_all_unit_tests.sh \ + -x *.gemspec \ + \ + -x doc/ \ + -x gems/ \ + -x old-gems/ \ + -x test/performance/ \ + -x test/scratch/ \ + \ + -x tc_.*\.rb \ + -x ts_all.rb \ + \ + $* From 9fd69e31a8d5bd82125cedfa280aa797a612b64f Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 13:41:33 +1000 Subject: [PATCH 07/28] bolierplate: updating Gemfile --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 6d090cc..5586105 100644 --- a/Gemfile +++ b/Gemfile @@ -2,11 +2,11 @@ source "https://rubygems.org" -gem 'clasp-ruby', [ '~> 0.23', '>= 0.23.0.2' ] +gem 'clasp-ruby', [ '~> 0.23', '>= 0.23.1' ] if RUBY_VERSION >= '2' - gem 'xqsr3', '~> 0.39' + gem "xqsr3", [ '~> 0.39', '>= 0.39.4' ] else gem 'xqsr3', '~> 0.21.3' From 83f92df02c2a36af6f6d1c22bf55dbd59433f232 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 13:52:05 +1000 Subject: [PATCH 08/28] boilerplate: placeholder markdown files --- AUTHORS.md | 0 FAQ.md | 0 NEWS.md | 0 examples/flag_and_option_specifications.from_DATA.md | 2 +- examples/flag_and_option_specifications.md | 2 +- examples/show_usage_and_version.md | 2 +- 6 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 AUTHORS.md create mode 100644 FAQ.md create mode 100644 NEWS.md diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..e69de29 diff --git a/FAQ.md b/FAQ.md new file mode 100644 index 0000000..e69de29 diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..e69de29 diff --git a/examples/flag_and_option_specifications.from_DATA.md b/examples/flag_and_option_specifications.from_DATA.md index 1299cf9..814751e 100644 --- a/examples/flag_and_option_specifications.from_DATA.md +++ b/examples/flag_and_option_specifications.from_DATA.md @@ -1,4 +1,4 @@ -# libCLImate.Ruby Example - **flag_and_option_specifications.from_DATA** +# libCLImate.Ruby - Example - **flag_and_option_specifications.from_DATA** ## Summary diff --git a/examples/flag_and_option_specifications.md b/examples/flag_and_option_specifications.md index d1c20a4..142ce34 100644 --- a/examples/flag_and_option_specifications.md +++ b/examples/flag_and_option_specifications.md @@ -1,4 +1,4 @@ -# libCLImate.Ruby Example - **flag_and_option_specifications** +# libCLImate.Ruby - Example - **flag_and_option_specifications** ## Summary diff --git a/examples/show_usage_and_version.md b/examples/show_usage_and_version.md index f8b2e2d..98cb85c 100644 --- a/examples/show_usage_and_version.md +++ b/examples/show_usage_and_version.md @@ -1,4 +1,4 @@ -# libCLImate.Ruby Example - **show_usage_and_version** +# libCLImate.Ruby - Example - **show_usage_and_version** ## Summary From f96857c64544b183023d694734e1957dbdd719ff Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 14:05:54 +1000 Subject: [PATCH 09/28] boilerplate: .gitignore --- .gitignore | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 3615780..0d510c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,38 +1,39 @@ - # directories (by name) -build/ - +/.bzr/ /.bundle/ +/.config/ +/.svn/ /.yardoc/ + /_yardoc/ /InstalledFiles/ - +/build/ /coverage/ /doc/ /lib/bundler/man/ +/old-gems/ /pkg/ /rdoc/ +/scratch/ /spec/reports/ /test/tmp/ /test/version_tmp/ /tmp/ -/vendor/bundle +/vendor/bundle/ # directories (by pattern) # files (by name) -/.config -/.repl_history -/.ruby-version -/spec/examples.txt - .DS_Store .repl_history +.ruby-version .rvmrc +/spec/examples.txt + # files (by pattern) *~ @@ -42,6 +43,8 @@ build/ *.bridgesupport *.gem *.rbc +*.scc +*.suo *.swp +*.tmp *.zip - From d08255a638348904328baeef4261037edff39cd1 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 14:17:19 +1000 Subject: [PATCH 10/28] version dependencies --- Gemfile.lock | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 014dbd5..9e16380 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,15 +1,16 @@ GEM remote: https://rubygems.org/ specs: - clasp-ruby (0.23.0.2) - xqsr3 (0.39.3) + clasp-ruby (0.23.1) + xqsr3 (0.39.4.1) PLATFORMS - x86_64-darwin-20 + arm64-darwin-25 + ruby DEPENDENCIES - clasp-ruby (~> 0.23, >= 0.23.0.2) - xqsr3 (~> 0.39) + clasp-ruby (~> 0.23, >= 0.23.1) + xqsr3 (~> 0.39, >= 0.39.4) BUNDLED WITH - 2.3.16 + 2.6.9 From 3bfbf6e7a577e6562d4c38765aad837e0b627269 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 14:28:00 +1000 Subject: [PATCH 11/28] boilerplate: .ruby-version-exclusions --- .ruby-version-exclusions | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.ruby-version-exclusions b/.ruby-version-exclusions index 9e53287..a8df221 100644 --- a/.ruby-version-exclusions +++ b/.ruby-version-exclusions @@ -1,11 +1,2 @@ 1.8.7-p375 1.9.3-p551 -#2.0.0-p648 -#2.1.10 -#2.2.10 -#2.3.8 -#2.4.5 -#2.5.3 -#2.6.1 -4.0.6 - From deb7f6945d304c97e509306f184004b473fbe89c Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 16:08:22 +1000 Subject: [PATCH 12/28] Add canonical AUTHORS, FAQ, and NEWS markdown skeletons --- AUTHORS.md | 17 +++++++++++++++++ FAQ.md | 28 ++++++++++++++++++++++++++++ NEWS.md | 8 ++++++++ 3 files changed, 53 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index e69de29..4db17e5 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -0,0 +1,17 @@ +# libCLImate.Ruby - Authors + + +## Major Contributors: + +* Matt Wilson ([mwsis](https://github.com/mwsis)) + + +## Defect reports, fixes and suggestions (for which we are very grateful): + +* \ + +Contributions are welcomed. + + + + diff --git a/FAQ.md b/FAQ.md index e69de29..a988b90 100644 --- a/FAQ.md +++ b/FAQ.md @@ -0,0 +1,28 @@ +# libCLImate.Ruby - FAQ + +The FAQ list is under (constant) development. If you post a question on the +[Issues](https://github.com/synesissoftware/libCLImate.Ruby/issues) forum +it will be used to create one. + + +## Table of Contents + +- [Q1: "How do I install this library?"](#q1-how-do-i-install-this-library) + + +# FAQs: + + +## Q1: "How do I install this library?" + +Install via **gem**: + +``` +gem install libclimate-ruby +``` + +See [README.md](./README.md) for usage. + + + + diff --git a/NEWS.md b/NEWS.md index e69de29..d03662d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -0,0 +1,8 @@ +# libCLImate.Ruby - News + +| Date | News Item | +| ------------- | --------- | + + + + From 12b5da5fac07a4c4af9ad8fd2b48d7d4aded51f7 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 16:15:33 +1000 Subject: [PATCH 13/28] Normalise CHANGES.md title, bullets, and drop T.B.C. stub --- CHANGES.md | 82 ++++++++++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 48 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 85e6e2c..b1b5595 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# libCLImate.Ruby Changes +# libCLImate.Ruby - Changes ## 0.17.1 - 30th July 2026 @@ -8,91 +8,77 @@ ## 0.17.0.2 - 30th July 2026 -* + added `TODO.md` and updated existing boilerplate files to use the end-of-file marker; -* ~ updated boilerplate: - * ~ `README.md`: updated tagline placement, added license and other badges, and enhanced dependencies section with Efferent/Afferent coupling information; - * ~ `LICENSE`: updated copyright years and format; - * ~ `libCLImate.gemspec`: updated comment header and date; - * ~ `.vscode/settings.json`: updated various language settings for indentation, rulers, and file associations; - * ~ `build_gem.sh`, `generate_rdoc.sh`, `test/scratch/blankzeroes.rb`: updated dates; -* ~ updated dependencies; -* ~ tidying; +* added **TODO.md** and updated existing boilerplate files to use the end-of-file marker; +* updated boilerplate (**README.md**, **LICENSE**, **libCLImate.gemspec**, **.vscode/settings.json**, helper scripts); +* updated **README.md** tagline placement, badges, and Efferent/Afferent dependencies section; +* updated dependencies; +* tidying; * added **.vimrc**; ## 0.17.0.1 - 5th March 2025 -* **Documentation**: - * Improved `README.md` tagline placement, expanded dependencies section with Efferent/Afferent coupling details, and added license badge; - * Updated `CHANGES.md` with a summary of these changes; - * Added `TODO.md` for project task tracking; - * Updated `EXAMPLES.md` to use end-of-file marker; -* **IDE Settings (`.vscode/settings.json`)**: - * Expanded language-specific settings for indentation, rulers, and formatting for C, C++, C#, Go, JSON, Markdown, Python, Ruby, Rust, Shellscript, and TypeScript; - * Configured Go formatting and linting; - * Updated file associations and search exclusions; - * Set `git.mergeEditor` to `false`; -* **Code Formatting**: Applied consistent indentation (spaces over tabs, 2-space where applicable) in various Ruby example and test files (`examples/*.rb`, `test/unit/*.rb`, `test/scratch/*.rb`) to adhere to `.cursor/rules/ruby-standards.mdc`; +* improved **README.md** tagline placement, dependencies section, and license badge; +* updated **CHANGES.md**; +* added **TODO.md**; +* updated **EXAMPLES.md** to use end-of-file marker; +* expanded **.vscode/settings.json** language and formatting settings; +* applied consistent indentation in examples and tests; ## 0.17.0 - 10th August 2024 -* + added option `:value_attributes` to cause any possible value-names, as described by `#value_names`, to be applied as attributes with the given value, if any, on the command-line; -* ~ updated dependencies; -* ~ updated **CHANGES.md**; -* ~ preparatory work; -* ~ updated dependencies; -* ~ settings; -* ~ updated **run_all_unit_tests.sh** from **synesissoftware/misc-dev-scripts**; +* added option `:value_attributes` so value-names from `#value_names` are applied as attributes when present on the command-line; +* updated dependencies; +* updated **CHANGES.md**; +* preparatory work; +* settings; +* updated **run_all_unit_tests.sh** (from **synesissoftware/misc-dev-scripts**); ## 0.16.0 - 1st December 2023 -* + added attribute `libCLImate::Climate#double_slash_index` / `libCLImate::Climate::ParseResults#double_slash_index`; -* ~ updating dependency versions; -* ~ tidying; +* added `libCLImate::Climate#double_slash_index` / `libCLImate::Climate::ParseResults#double_slash_index`; +* updated dependency versions; +* tidying; ## 0.15.2 - 26th June 2022 -* ~ forced version update; +* forced version update; ## 0.15.1 - 26th June 2022 -* ~ updated **README.md** and Gemspec; -* ~ fix to examples; +* updated **README.md** and gemspec; +* fix to examples; ## 0.15.0 - 29th April 2019 -* + added ``Climate#parse()`` and ``Climate#parse_and_verify()`` methods; -* + added ``Climate::ParseResults()`` class, which is returned from the ``#parse()`` and ``#parse_and_verify()`` methods; -* ~ various changes to examples and improvements to documentation; +* added `Climate#parse()` and `Climate#parse_and_verify()`; +* added `Climate::ParseResults`, returned from `#parse()` and `#parse_and_verify()`; +* various example and documentation improvements; ## 0.14.1 - 29th April 2019 -* + added **Gemfile** +* added **Gemfile**; ## 0.14.0 - 15th April 2019 -* + ``Climate#constrain_values`` now supports ``Array`` type (as well as ``Integer`` and ``Range``); -* + added ``Climate#usage_help_suffix``, which defaults to "use --help for usage"; +* `Climate#constrain_values` now supports `Array` (as well as `Integer` and `Range`); +* added `Climate#usage_help_suffix`, defaulting to "use --help for usage"; ## 0.13.0 - 13th April 2019 -* + added ``CLASP::Arguments.load()``, which allows to load argument-specifications from ``Hash`` or from YAML; -* + added examples/flag_and_option_specifications.from_DATA.rb, which illustrates use of ``__END__`` / ``DATA`` containing climate specification in YAML form; -* + added ``Climate#on_flag()`` and ``Climate#on_option()`` methods, which allow a block to be attached to an existing flag or option specification; -* ~ corrected defect whereby ``exit_on_unknown`` was used instead of ``exit_on_missing`` when checking required values; +* added `CLASP::Arguments.load()` for loading argument-specifications from `Hash` or YAML; +* added **examples/flag_and_option_specifications.from_DATA.rb** illustrating `__END__` / `DATA` YAML climate specification; +* added `Climate#on_flag()` and `Climate#on_option()` to attach blocks to existing specifications; +* corrected defect whereby `exit_on_unknown` was used instead of `exit_on_missing` when checking required values; -## previous versions - -T.B.C. - From 054a610465229c9b62aaf2d00110055ccefc734d Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Fri, 14 Aug 2026 16:28:27 +1000 Subject: [PATCH 14/28] Add ruby.yml CI badge and switch Gemfile to gemspec --- Gemfile | 11 +---------- README.md | 1 + 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 5586105..be173b2 100644 --- a/Gemfile +++ b/Gemfile @@ -2,13 +2,4 @@ source "https://rubygems.org" -gem 'clasp-ruby', [ '~> 0.23', '>= 0.23.1' ] - -if RUBY_VERSION >= '2' - - gem "xqsr3", [ '~> 0.39', '>= 0.39.4' ] -else - - gem 'xqsr3', '~> 0.21.3' -end - +gemspec diff --git a/README.md b/README.md index 97d462a..1372621 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ libCLImate, for 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) ## Table of Contents From 8daee18865247cb9dbf4b47c9219108984030ec8 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 05:29:56 +1000 Subject: [PATCH 15/28] chore: dependencies --- .gitattributes | 2 +- Gemfile.lock | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitattributes b/.gitattributes index 702382f..2c70232 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,7 +21,7 @@ Guardfile text eol=lf diff=ruby *.slim text # --- Lock / config --- -Gemfile.lock text -diff +Gemfile.lock text *.gemspec.lock text -diff *.yml text *.yaml text diff --git a/Gemfile.lock b/Gemfile.lock index 9e16380..5574c30 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,16 +1,22 @@ +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.4.1) + xqsr3 (0.39.5) PLATFORMS arm64-darwin-25 ruby DEPENDENCIES - clasp-ruby (~> 0.23, >= 0.23.1) - xqsr3 (~> 0.39, >= 0.39.4) + libclimate-ruby! BUNDLED WITH 2.6.9 From 1692630e1107160bff64b27a15a1c92fd4c8eefa Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 06:44:52 +1000 Subject: [PATCH 16/28] gemspec updates --- CHANGES.md | 5 +++++ lib/libclimate/version.rb | 4 ++-- libCLImate.gemspec | 24 +++++++++++++++--------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b1b5595..0c968d6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ # libCLImate.Ruby - Changes +## 0.17.2 - 15th August 2026 + +T.B.C. + + ## 0.17.1 - 30th July 2026 * fixed unrecognised flag/option reporting defect; diff --git a/lib/libclimate/version.rb b/lib/libclimate/version.rb index 2bd746d..93eb7f0 100644 --- a/lib/libclimate/version.rb +++ b/lib/libclimate/version.rb @@ -4,7 +4,7 @@ # Purpose: Version for libclimate.Ruby library # # Created: 13th July 2015 -# Updated: 30th July 2026 +# Updated: 15th August 2026 # # Home: http://github.com/synesissoftware/libCLImate.Ruby # @@ -44,7 +44,7 @@ module LibCLImate # Current version of the libCLImate.Ruby library - VERSION = '0.17.1' + VERSION = '0.17.2' private VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc: diff --git a/libCLImate.gemspec b/libCLImate.gemspec index dd30df0..1f06e34 100644 --- a/libCLImate.gemspec +++ b/libCLImate.gemspec @@ -4,21 +4,19 @@ # Purpose: Gemspec for libCLImate.Ruby library # # Created: 1st March 2019 -# Updated: 30th July 2026 +# Updated: 15th August 2026 # # ######################################################################### # $:.unshift File.join(File.dirname(__FILE__), 'lib') -require 'libclimate' +require 'libclimate/version' -require 'date' Gem::Specification.new do |spec| spec.name = 'libclimate-ruby' spec.version = LibCLImate::VERSION - spec.date = Date.today.to_s spec.summary = 'libCLImate.Ruby' spec.description = <= 2.0', '< 4' ] - spec.add_runtime_dependency 'clasp-ruby', [ '~> 0.23', '>= 0.23.0.2' ] - spec.add_runtime_dependency 'xqsr3', [ '~> 0.39' ] + 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}/**/*', 'README*', 'LICENSE*' ] & `git ls-files -z`.split("\0") end + + +# ############################## end of file ############################# # From d02046e84df481152b05e02a387af00dcfa73e71 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 06:46:42 +1000 Subject: [PATCH 17/28] chore: AUTHORS.md --- AUTHORS.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 4db17e5..6af465a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,17 +1,21 @@ # libCLImate.Ruby - Authors -## Major Contributors: +## Major Contributors -* Matt Wilson ([mwsis](https://github.com/mwsis)) +| Name | GitHub | +| ----------- | --------------------------------- | +| Matt Wilson | [mwsis](https://github.com/mwsis) | -## Defect reports, fixes and suggestions (for which we are very grateful): +## Defect reports, fixes and suggestions (for which we are very grateful) -* \ +| Name | GitHub | +| ----------- | --------------------------------- | +| \ | | -Contributions are welcomed. +Contributions are welcomed. From 98f153434ad4b22e63b21058d9ae252fec4d67ef Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 06:50:09 +1000 Subject: [PATCH 18/28] fix: gemspec metadata --- libCLImate.gemspec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libCLImate.gemspec b/libCLImate.gemspec index 1f06e34..0a476ee 100644 --- a/libCLImate.gemspec +++ b/libCLImate.gemspec @@ -40,6 +40,13 @@ END_DESC spec.required_ruby_version = [ '>= 2.0', '< 4' ] + spec.metadata = { + 'bug_tracker_uri' => 'https://github.com/synesissoftware/libCLImate.Ruby/issues', + 'changelog_uri' => 'https://github.com/synesissoftware/libCLImate.Ruby/blob/master/CHANGES.md', + 'homepage_uri' => 'https://github.com/synesissoftware/libCLImate.Ruby', + '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' ] From 6ba6c14e9a34882d74ff42605103db5883a96bc2 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 07:55:50 +1000 Subject: [PATCH 19/28] added/updated Rakefile --- Rakefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Rakefile diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..d05668d --- /dev/null +++ b/Rakefile @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Rakefile for libCLImate.Ruby + +require 'rake/testtask' + + +Rake::TestTask.new do |tt| + + tt.libs << 'lib' + tt.libs << 'test' + tt.name = 'test' + tt.test_files = FileList['test/**/tc_*.rb'] + tt.verbose = true +end + + +task :default => :test + + +# ############################## end of file ############################# # From 396503604c7370383c1e08a7acefcd8fef3822d0 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 08:11:09 +1000 Subject: [PATCH 20/28] chore: CONTRIBUTING.md, INSTALL.md, SECURITY.md --- CONTRIBUTING.md | 36 ++++++++++++++++++++++++++++++++++++ INSTALL.md | 41 +++++++++++++++++++++++++++++++++++++++++ SECURITY.md | 23 +++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 INSTALL.md create mode 100644 SECURITY.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fee7b0f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,36 @@ +# libCLImate.Ruby - Contributing + + +## Table of Contents + +- [Defects and features](#defects-and-features) +- [Pull requests](#pull-requests) +- [Tests](#tests) +- [License](#license) + + +## Defects and features + +Open an issue on https://github.com/synesissoftware/libCLImate.Ruby/issues. + + +## Pull requests + +Pull requests are welcome on https://github.com/synesissoftware/libCLImate.Ruby. Keep diffs local to the change; match existing indentation (2 spaces in Ruby) and the Synesis markdown set (**README.md**, **CHANGES.md**, **NEWS.md**, **TODO.md**, **INSTALL.md**, **CONTRIBUTING.md**, **SECURITY.md**). + + +## Tests + +``` +bundle exec rake test +``` + +or `./run_all_unit_tests.sh`. + + +## License + +Contributions are accepted under the 3-clause BSD license. See [LICENSE](./LICENSE). + + + diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..95ebdd6 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,41 @@ +# libCLImate.Ruby - Installation and Use + + +## Table of Contents + +- [Install the gem](#install-the-gem) +- [From a source checkout](#from-a-source-checkout) +- [Using the library](#using-the-library) + + +## Install the gem + +``` +gem install libclimate-ruby +``` + +or add to a **Gemfile**: + +```Ruby +gem 'libclimate-ruby' +``` + +then `bundle install`. + + +## From a source checkout + +``` +bundle install +bundle exec rake test +``` + + +## Using the library + +```Ruby +require 'libclimate' +``` + + + diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..7574698 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,23 @@ +# libCLImate.Ruby - Security + + +## Table of Contents + +- [Reporting a vulnerability](#reporting-a-vulnerability) +- [Supported versions](#supported-versions) + + +## Reporting a vulnerability + +Please report security issues privately via GitHub Security Advisories on https://github.com/synesissoftware/libCLImate.Ruby/security, or by opening an issue if an advisory cannot be filed. Do not attach exploit proofs of concept against third-party systems. + + +## Supported versions + +| Version | Supported | +| ------- | --------- | +| 0.17.x | ✅ | +| < 0.17 | ❌ | + + + From 3b40fb7816580cdf9e68eb9b0c6d0ec164d9834e Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 08:15:02 +1000 Subject: [PATCH 21/28] chore: rake in Gemfile --- Gemfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Gemfile b/Gemfile index be173b2..29f6d2e 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,14 @@ source "https://rubygems.org" gemspec + +# rake 13 requires Ruby >= 2.3 +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.3") + + gem "rake", '~> 13.0' +else + + gem "rake", '~> 12.3' +end + +gem "test-unit", '~> 3.0' From bec396604b099bb2331652c5f570b5dc639e329e Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 08:41:42 +1000 Subject: [PATCH 22/28] fix: Add frozen lib/ strings and standardise Ruby gem boilerplate --- CHANGES.md | 2 +- lib/libclimate.rb | 3 ++- lib/libclimate/climate.rb | 4 ++-- lib/libclimate/libclimate.rb | 3 ++- lib/libclimate/version.rb | 1 + 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0c968d6..d1852b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,7 @@ ## 0.17.2 - 15th August 2026 -T.B.C. +* added `# frozen_string_literal: true` to all **lib/** sources; ## 0.17.1 - 30th July 2026 diff --git a/lib/libclimate.rb b/lib/libclimate.rb index 7bdfd02..7e25b75 100644 --- a/lib/libclimate.rb +++ b/lib/libclimate.rb @@ -1,10 +1,11 @@ +# frozen_string_literal: true # ######################################################################## # # File: libclimate.rb # # Purpose: Top-level include for libclimate.Ruby library # # Created: 13th July 2015 -# Updated: 14th May 2016 +# Updated: 15th August 2026 # # Home: http://github.com/synesissoftware/libCLImate.Ruby # diff --git a/lib/libclimate/climate.rb b/lib/libclimate/climate.rb index 987c2c5..74b2710 100644 --- a/lib/libclimate/climate.rb +++ b/lib/libclimate/climate.rb @@ -1,11 +1,11 @@ - +# frozen_string_literal: true # ######################################################################## # # File: lib/libclimate/climate.rb # # Purpose: Definition of the ::LibCLImate::Climate class # # Created: 13th July 2015 -# Updated: 30th July 2026 +# Updated: 15th August 2026 # # Home: http://github.com/synesissoftware/libCLImate.Ruby # diff --git a/lib/libclimate/libclimate.rb b/lib/libclimate/libclimate.rb index 852fe0c..cf7fb8d 100644 --- a/lib/libclimate/libclimate.rb +++ b/lib/libclimate/libclimate.rb @@ -1,10 +1,11 @@ +# frozen_string_literal: true # ######################################################################## # # File: libclimate/libclimate.rb # # Purpose: Main file for libclimate.Ruby library # # Created: 13th July 2015 -# Updated: 10th August 2024 +# Updated: 15th August 2026 # # Home: http://github.com/synesissoftware/libCLImate.Ruby # diff --git a/lib/libclimate/version.rb b/lib/libclimate/version.rb index 93eb7f0..f67c576 100644 --- a/lib/libclimate/version.rb +++ b/lib/libclimate/version.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # ######################################################################## # # File: libclimate/version.rb # From a6cf0392448948ba3770364b7e47ac5b0b453a2d Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 08:48:40 +1000 Subject: [PATCH 23/28] standard CI for all projects --- .github/workflows/ruby.yml | 117 +++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .github/workflows/ruby.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..ff21ec7 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,117 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake +# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby + +# +# Created: 15th August 2026 +# Updated: 15th August 2026 +# + +name: Ruby + +on: + push: + branches: + - master + - dev + - boilerplate + - idiomatic + - rc1 + - rc2 + - rc3 + pull_request: + +permissions: + contents: read + +defaults: + run: + shell: bash + +jobs: + test: + + strategy: + fail-fast: false + + matrix: + os: + - macos-latest + - ubuntu-latest + - windows-latest + + ruby-version: + # - head + - '3.4' + - '3.3' + - '3.2' + - '3.1' + - '3.0' + - '2.7' + - '2.6' + + include: + - os: ubuntu-latest + ruby-version: '2.5' + - os: ubuntu-latest + ruby-version: '2.4' + - os: ubuntu-latest + ruby-version: '2.0' + - os: windows-latest + ruby-version: mingw + + runs-on: ${{ matrix.os }} + + steps: + - name: Checking out code + uses: actions/checkout@v4 + + - name: Remove Gemfile.lock + 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 + + - name: Show Ruby version + run: ruby -v + + - name: Run tests + run: bundle exec rake test + + - name: Gem build and install smoke + shell: bash + run: | + gem build libCLImate.gemspec + gem install --local libclimate-ruby-*.gem + ruby -e "require 'libclimate/version'; abort('VERSION missing') unless defined?(LibCLImate::VERSION); puts LibCLImate::VERSION" + + warnings: + + name: Warnings + + runs-on: ubuntu-latest + + steps: + - name: Checking out code + uses: actions/checkout@v4 + + - name: Remove Gemfile.lock + run: rm -f Gemfile.lock + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + + - name: Show Ruby version + run: ruby -v + + - name: Run unit tests with warnings + run: ./run_all_unit_tests.sh --lib --warnings From 3ab517fa41aa53a0b60b60fc9f5277a0f67bd368 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 08:56:55 +1000 Subject: [PATCH 24/28] standard .editorconfig and dependabot for all projects --- .editorconfig | 64 ++++++++++++++++++++++++++++++++++++++++++ .github/dependabot.yml | 10 +++++++ 2 files changed, 74 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/dependabot.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8d78c5d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,64 @@ +root = true + +# Language indent/EOL/charset overlap with .vscode/settings.json. +# Rulers, renderWhitespace, detectIndentation, mergeEditor, and +# cmake.configureOnOpen cannot be expressed here — they stay in settings.json. + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +# [bat] +[*.{bat,cmd}] +end_of_line = crlf +indent_size = 4 +indent_style = space + +# [c] +[*.{c,h}] +indent_size = 4 +indent_style = space + +# [cmake] +[{CMakeLists.txt,*.cmake}] +indent_size = 4 +indent_style = tab + +# [cpp] +[*.{cpp,cxx,hpp,hxx}] +indent_size = 4 +indent_style = space + +# [json] +[*.json] +indent_size = 2 +indent_style = space + +# [markdown] +[*.md] +indent_size = 2 +indent_style = space +trim_trailing_whitespace = false + +# [ruby] +[*.{gemspec,rb}] +indent_size = 2 +indent_style = space + +[{Gemfile,Rakefile}] +indent_size = 2 +indent_style = space + +# [shellscript] +[*.{bash,sh,zsh}] +indent_size = 2 +indent_style = space + +# [yaml] +[*.{yaml,yml}] +indent_size = 2 +indent_style = space diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..3189593 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - directory: / + package-ecosystem: bundler + schedule: + interval: weekly + - directory: / + package-ecosystem: github-actions + schedule: + interval: weekly From 304b04af1ad83d0c0e030bf6bb3ded02f7e8f6a4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 09:01:51 +1000 Subject: [PATCH 25/28] TODO.md --- TODO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO.md b/TODO.md index 92afe39..5c15580 100644 --- a/TODO.md +++ b/TODO.md @@ -21,6 +21,7 @@ ## Packaging improvements * [ ] GitHub Actions; +* [ ] Rename gemspec so the filename stem matches `spec.name` (`libCLImate.gemspec` → **libclimate-ruby.gemspec**); From 4d8c09298fc37cd6b9875c8ac274288f50a28a44 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 09:16:12 +1000 Subject: [PATCH 26/28] CHANGES.md --- CHANGES.md | 209 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d1852b6..42b14ea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -41,6 +41,11 @@ * updated **run_all_unit_tests.sh** (from **synesissoftware/misc-dev-scripts**); +## 0.16.0.1 - 1st December 2023 + +* Merged branch double_slash_index; + + ## 0.16.0 - 1st December 2023 * added `libCLImate::Climate#double_slash_index` / `libCLImate::Climate::ParseResults#double_slash_index`; @@ -71,6 +76,11 @@ * added **Gemfile**; +## 0.14.0.1 - 29th April 2019 + +* merge; + + ## 0.14.0 - 15th April 2019 * `Climate#constrain_values` now supports `Array` (as well as `Integer` and `Range`); @@ -85,5 +95,204 @@ * corrected defect whereby `exit_on_unknown` was used instead of `exit_on_missing` when checking required values; +## 0.12.2 - 13th April 2019 + +* much improved documentation; + + +## 0.12.1 - 12th April 2019 + +* minor documentation fixes; + + +## 0.12.0 - 12th April 2019 + +* updated in light of CLASP's changed terminology from *[aA]lias => *[sS]pecification; + + +## 0.11.2 - 8th January 2018 + +* SimpleConsoleLogService : ~ corrected handling of symbol as severity; + + +## 0.11.1 - 6th January 2018 + +* renamed SimpleConsoleService => SimpleConsoleLogService; + added NullLogService class; + added log service class tests; + + +## 0.11.0 - 19th March 2019 + +* Climate methods #add_alias(), #add_flag(), #add_option() now take FlagAlias and OptionAlias class instances in addition to names; + + +## 0.10.1.1 - 19th October 2018 + +* dependencies; + + +## 0.10.1 - 6th January 2018 + +* added :benchmark severity level; + + +## 0.9.4 - 6th January 2018 + +* added unit-tests for stock severity levels; + + +## 0.9.3 - 6th January 2018 + +* tagged release; + + +## 0.9.2 - 2nd January 2018 + +* prefix now in [ ]; + + +## 0.9.1 - 24th December 2017 + +* fixing; + + +## 0.8.4 - 8th January 2019 + +* tagged release; + + +## 0.8.3 - 6th September 2018 + +* minor changes to documentation markup; + + +## 0.8.2 - 13th July 2018 + +* merge version update; + + +## 0.8.1 - 18th June 2018 + +* now recognised PROGRAM_VER_PATCH (in the stead of PROGRAM_VER_REVISION); + + +## 0.8.0 - 23rd December 2017 + +* starting to break out impl. into Pantheios::Core; + + +## 0.7.4 - 7th February 2018 + +* merge; + + +## 0.7.3 - 5th February 2018 + +* LibCLImate::Climate::set_program_name(), which uses Colcon if available; + + +## 0.7.2 - 3rd January 2018 + +* merge version update; + + +## 0.7.1 - 1st January 2018 + +* added support for required options (based on CLASP.Ruby 0.12; + + +## 0.6.5 - 1st January 2018 + +* preparatory mods; + + +## 0.6.4 - 1st January 2018 + +* fixed the version inference; + + +## 0.6.3 - 22nd June 2017 + +* tagged release; + + +## 0.6.2 - 16th March 2017 + +* fix; + + +## 0.6.1 - 16th March 2017 + +* added inference of version; + + +## 0.5.8 - 17th October 2016 + +* tidying up contract enforcements; + + +## 0.5.7 - 17th October 2016 + +* simplified unit test; + + +## 0.5.6 - 17th October 2016 + +* updated documentation; + + +## 0.5.5 - 26th June 2016 + +* changed hash-bangs; + + +## 0.5.4 - 18th June 2016 + +* fixed lacking blocks in new add_*() methods; + + +## 0.5.3 - 17th June 2016 + +* fix; + + +## 0.4.1 - 14th June 2016 + +* tidying; + + +## 0.3.1 - 13th June 2016 + +* merge; + + +## 0.2.4 - 13th June 2016 + +* 0.2.4 changes; + + +## 0.2.3 - 12th June 2016 + +* fixed extras handling for flags; + + +## 0.2.2 - 11th June 2016 + +* merge; + + +## 0.2.1 - 6th June 2016 + +* specified ranges for dependent libraries; + + +## 0.1.2 - 14th May 2016 + +* added Climate class, and basics of API; + + +## 0.1.1 - 14th July 2015 + +* added basic skeleton (0.1.1); + From d84cada12639ba2269bb58366552986b71b0e8f8 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sat, 15 Aug 2026 09:24:03 +1000 Subject: [PATCH 27/28] NEWS.md --- NEWS.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index d03662d..4494425 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,61 @@ # libCLImate.Ruby - News -| Date | News Item | -| ------------- | --------- | - +| Date | News Item | +| ------------------ | ----------------------------------------------------------------------------------------------- | +| 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 | +| 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 | +| 26th June 2022 | **libCLImate.Ruby** 0.15.2 released | +| 26th June 2022 | **libCLImate.Ruby** 0.15.1 released | +| 29th April 2019 | **libCLImate.Ruby** 0.15.0 released | +| 29th April 2019 | **libCLImate.Ruby** 0.14.1 released | +| 29th April 2019 | **libCLImate.Ruby** 0.14.0.1 released | +| 15th April 2019 | **libCLImate.Ruby** 0.14.0 released | +| 13th April 2019 | **libCLImate.Ruby** 0.13.0 released | +| 13th April 2019 | **libCLImate.Ruby** 0.12.2 released | +| 12th April 2019 | **libCLImate.Ruby** 0.12.1 released | +| 12th April 2019 | **libCLImate.Ruby** 0.12.0 released | +| 19th March 2019 | **libCLImate.Ruby** 0.11.0 released | +| 8th January 2019 | **libCLImate.Ruby** 0.8.4 released | +| 19th October 2018 | **libCLImate.Ruby** 0.10.1.1 released | +| 6th September 2018 | **libCLImate.Ruby** 0.8.3 released | +| 13th July 2018 | **libCLImate.Ruby** 0.8.2 released | +| 18th June 2018 | **libCLImate.Ruby** 0.8.1 released | +| 7th February 2018 | **libCLImate.Ruby** 0.7.4 released | +| 5th February 2018 | **libCLImate.Ruby** 0.7.3 released | +| 8th January 2018 | **libCLImate.Ruby** 0.11.2 released | +| 6th January 2018 | **libCLImate.Ruby** 0.11.1 released | +| 6th January 2018 | **libCLImate.Ruby** 0.10.1 released | +| 6th January 2018 | **libCLImate.Ruby** 0.9.4 released | +| 6th January 2018 | **libCLImate.Ruby** 0.9.3 released | +| 3rd January 2018 | **libCLImate.Ruby** 0.7.2 released | +| 2nd January 2018 | **libCLImate.Ruby** 0.9.2 released | +| 1st January 2018 | **libCLImate.Ruby** 0.7.1 released | +| 1st January 2018 | **libCLImate.Ruby** 0.6.5 released | +| 1st January 2018 | **libCLImate.Ruby** 0.6.4 released | +| 24th December 2017 | **libCLImate.Ruby** 0.9.1 released | +| 23rd December 2017 | **libCLImate.Ruby** 0.8.0 released | +| 22nd June 2017 | **libCLImate.Ruby** 0.6.3 released | +| 16th March 2017 | **libCLImate.Ruby** 0.6.2 released | +| 16th March 2017 | **libCLImate.Ruby** 0.6.1 released | +| 17th October 2016 | **libCLImate.Ruby** 0.5.8 released | +| 17th October 2016 | **libCLImate.Ruby** 0.5.7 released | +| 17th October 2016 | **libCLImate.Ruby** 0.5.6 released | +| 26th June 2016 | **libCLImate.Ruby** 0.5.5 released | +| 18th June 2016 | **libCLImate.Ruby** 0.5.4 released | +| 17th June 2016 | **libCLImate.Ruby** 0.5.3 released | +| 14th June 2016 | **libCLImate.Ruby** 0.4.1 released | +| 13th June 2016 | **libCLImate.Ruby** 0.3.1 released | +| 13th June 2016 | **libCLImate.Ruby** 0.2.4 released | +| 12th June 2016 | **libCLImate.Ruby** 0.2.3 released | +| 11th June 2016 | **libCLImate.Ruby** 0.2.2 released | +| 6th June 2016 | **libCLImate.Ruby** 0.2.1 released | +| 14th May 2016 | **libCLImate.Ruby** 0.1.2 released | +| 14th July 2015 | **libCLImate.Ruby** 0.1.1 released | From 416d425a4d94b67ce8dac1bee15d574e207f794c Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 11:06:27 +1000 Subject: [PATCH 28/28] 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