From 5e4b85bc3f9cab94dae563523fac5342047738ef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:30:29 +0000 Subject: [PATCH 01/14] Initial plan From 5c83d83b6615775af8cd716ae1f94dbab4e5d956 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:31:28 +0000 Subject: [PATCH 02/14] Fix %w() commas creating wrong method names in logger Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- lib/rbcli/components/logger/logger.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/rbcli/components/logger/logger.rb b/lib/rbcli/components/logger/logger.rb index be34298..544348c 100644 --- a/lib/rbcli/components/logger/logger.rb +++ b/lib/rbcli/components/logger/logger.rb @@ -98,12 +98,6 @@ def unknown message, progname = nil, &block self.add(Logger::UNKNOWN, message, progname, &block) end - %w(debug, info, warn, error, fatal, unknown).each do |l| - self.define_method(l.to_sym) do |message, progname = nil, &block| - self.send(:add, l.to_sym, message, progname, &block) - end - end - private def self.colorlevel level From ee0438b86b5b6383995aa4824945710cc74ffc4b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:31:36 +0000 Subject: [PATCH 03/14] Fix != (comparison) to += (concatenation) in parser prompt Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- lib/rbcli/components/parser/parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbcli/components/parser/parser.rb b/lib/rbcli/components/parser/parser.rb index 7a9f0f6..8e3c939 100644 --- a/lib/rbcli/components/parser/parser.rb +++ b/lib/rbcli/components/parser/parser.rb @@ -148,7 +148,7 @@ def self.prompt_for_missing prompt_string += ' (' + (param_value ? 'Y' : 'y') + '/' + (param_value ? 'n' : 'N') + ')' opt[:default] = param_value if opt[:default].nil? elsif !opt[:default].nil? - prompt_string != " (default: #{opt[:default]})" + prompt_string += " (default: #{opt[:default]})" end prompt_string += ':' unless %w(. ? ! :).include?(opt[:prompt][-1]) prompt_string += ' ' From 0b527f23b3ace3a5b22e941bf35e5b71e14698c1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:31:45 +0000 Subject: [PATCH 04/14] Anchor regex for command name validation Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- lib/rbcli/components/commands/command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbcli/components/commands/command.rb b/lib/rbcli/components/commands/command.rb index fac43d0..5eaf449 100644 --- a/lib/rbcli/components/commands/command.rb +++ b/lib/rbcli/components/commands/command.rb @@ -5,7 +5,7 @@ ################################################################################## class Rbcli::Command def initialize name - raise Rbcli::CommandError.new "Command name can only contain the characters [A-Za-z0-9_]+" unless /[A-Za-z0-9_]+/.match?(name) + raise Rbcli::CommandError.new "Command name can only contain the characters [A-Za-z0-9_]+" unless /\A[A-Za-z0-9_]+\z/.match?(name.to_s) @name = name.to_s.downcase @default = false @description = nil From b88e3bf69d573eaa7c60e9c4f86f9e02b795624a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:31:53 +0000 Subject: [PATCH 05/14] Fix test assertion in gem_spec.rb Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- spec/gem_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/gem_spec.rb b/spec/gem_spec.rb index 23b1359..fca792b 100644 --- a/spec/gem_spec.rb +++ b/spec/gem_spec.rb @@ -13,6 +13,6 @@ it "pulls the version number from a file" do version = File.read("VERSION") - expect(Rbcli::VERSION).equal? version + expect(Rbcli::VERSION).to eq(version.chomp.strip) end end \ No newline at end of file From 1ad8b01891c185bbd6b0f8d64048a35087c4fb2d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:32:01 +0000 Subject: [PATCH 06/14] Fix typo Compatiblity -> Compatibility in parser.rb Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- lib/rbcli/components/parser/parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbcli/components/parser/parser.rb b/lib/rbcli/components/parser/parser.rb index 8e3c939..809af27 100644 --- a/lib/rbcli/components/parser/parser.rb +++ b/lib/rbcli/components/parser/parser.rb @@ -24,7 +24,7 @@ def self.parse bannerstr += "\n" end unless appinfo[:compatibility].nil? || appinfo[:compatibility].empty? - bannerstr += "Compatiblity: " + bannerstr += "Compatibility: " if appinfo[:compatibility].length == 2 bannerstr += appinfo[:compatibility].join(' and ') + "\n" else From afb7300997b12172653e15371c4b18148e76a147 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:32:10 +0000 Subject: [PATCH 07/14] Remove redundant .select filter on already-filtered collection in parser.rb Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- lib/rbcli/components/parser/parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbcli/components/parser/parser.rb b/lib/rbcli/components/parser/parser.rb index 809af27..6794a0f 100644 --- a/lib/rbcli/components/parser/parser.rb +++ b/lib/rbcli/components/parser/parser.rb @@ -46,7 +46,7 @@ def self.parse @parser.synopsis bannerstr (Rbcli::Warehouse.get(:opts, :unparsedopts) || []).each { |args| @parser.opt *args } - @parser.stop_on(non_default_commands.select { |_name, cmd| !cmd.default? }.keys) + @parser.stop_on(non_default_commands.keys) begin opts = @parser.parse From 07935bafcd089e7f8f40d0bb4df698229067fce4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:32:21 +0000 Subject: [PATCH 08/14] Avoid duplicate select in engine priority check Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- lib/rbcli/components/core/engine.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/rbcli/components/core/engine.rb b/lib/rbcli/components/core/engine.rb index 2dc2815..8bb3116 100644 --- a/lib/rbcli/components/core/engine.rb +++ b/lib/rbcli/components/core/engine.rb @@ -7,8 +7,9 @@ module Rbcli::Engine @operations = [] def self.register_operation operation, name: nil, priority: nil - if @operations.select { |op| op[:priority] == priority }.count != 0 - raise Rbcli::Error.new "The Rbcli engine can not have two operations defined with the same priority: #{name}, #{@operations.select { |op| op[:priority] == priority }.join(", ")}" + conflicts = @operations.select { |op| op[:priority] == priority } + unless conflicts.empty? + raise Rbcli::Error, "The Rbcli engine can not have two operations defined with the same priority: #{name}, #{conflicts.join(", ")}" end @operations << { operation: operation, name: name, priority: priority } end From 33570d425404d6866b7dce3bbb9dca8fc22b6d21 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:32:34 +0000 Subject: [PATCH 09/14] Add frozen_string_literal comment to parser.rb Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- lib/rbcli/components/parser/parser.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rbcli/components/parser/parser.rb b/lib/rbcli/components/parser/parser.rb index 6794a0f..0c0fb08 100644 --- a/lib/rbcli/components/parser/parser.rb +++ b/lib/rbcli/components/parser/parser.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true ################################################################################## # Rbcli -- A framework for developing command line applications in Ruby # # Copyright (C) 2024 Andrew Khoury # From c4bb3f4069f87423e933da58686f05717c1522e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:32:42 +0000 Subject: [PATCH 10/14] Simplify File.expand_path(File.dirname(__FILE__)) to __dir__ in rbcli.rb Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- lib/rbcli.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rbcli.rb b/lib/rbcli.rb index 64a42b8..14ee87c 100644 --- a/lib/rbcli.rb +++ b/lib/rbcli.rb @@ -3,8 +3,8 @@ # Rbcli -- A framework for developing command line applications in Ruby # # Copyright (C) 2024 Andrew Khoury # ################################################################################## -RBCLI_LIBDIR = File.join(File.expand_path(File.dirname(__FILE__)), 'rbcli') -RBCLI_TOOLDIR = File.join(File.expand_path(File.dirname(__FILE__)), 'rbcli-tool') +RBCLI_LIBDIR = File.join(__dir__, 'rbcli') +RBCLI_TOOLDIR = File.join(__dir__, 'rbcli-tool') EXECUTABLE = File.basename($0).gsub(/\.[^.]+$/, '') # Prerequisites for anything else to run From dd5956b177febae1d84ac9f15823758efaeb1aec Mon Sep 17 00:00:00 2001 From: Andrew Khoury Date: Thu, 19 Mar 2026 13:05:05 +0300 Subject: [PATCH 11/14] Update ruby version and use open-ended versioning for dependencies. --- rbcli.gemspec | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/rbcli.gemspec b/rbcli.gemspec index 33d31d7..3c17fec 100644 --- a/rbcli.gemspec +++ b/rbcli.gemspec @@ -34,23 +34,24 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.6.10" - - spec.add_development_dependency "rake", "~> 13.0" - spec.add_development_dependency "rspec", "~> 3.0" - - spec.add_dependency "colorize", "~> 1.1" - spec.add_dependency "octokit", "~> 8.1" - spec.add_dependency "faraday-retry", "~> 2.2" # Required for octokit - spec.add_dependency "json-schema", "~> 4.3" - spec.add_dependency "bigdecimal", "~> 3.1" # Required for json-schema - spec.add_dependency "erb", "~> 4.0" - spec.add_dependency "deep_merge", "~> 1.2" - spec.add_dependency "paint", "~> 2.3" - spec.add_dependency "erubis", "~> 2.7" - spec.add_dependency "rest-client", "~> 2.1" - spec.add_dependency "toml", "~> 0.3" + spec.required_ruby_version = ">= 3.4.0" + + spec.add_development_dependency "rake", '~> 13.3' + spec.add_development_dependency "rspec", '~> 3.13' + + spec.add_dependency "colorize", '>= 1.1' + spec.add_dependency "octokit", '>= 8.1' + spec.add_dependency "faraday-retry", '>= 2.4' # Required for octokit + spec.add_dependency "json-schema", '>= 4.3' + spec.add_dependency "bigdecimal", '>= 3.3' # Required for json-schema + spec.add_dependency "erb", '>= 4.0' + spec.add_dependency "deep_merge", '>= 1.2' + spec.add_dependency "paint", '>= 2.3' + spec.add_dependency "erubis", '>= 2.7' + spec.add_dependency "rest-client", '>= 2.1' + spec.add_dependency "toml", '>= 0.3' + spec.add_dependency "base64", '>= 0.3' # For more information and examples about making a new gem, check out our # guide at: https://bundler.io/guides/creating_gem.html -end \ No newline at end of file +end From 5bc504fbdc6ef760e12770bd3a58b7716ee5bb77 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:08:06 +0000 Subject: [PATCH 12/14] Add 0.4.4 changelog entry Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 211f2ce..eef4294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Rbcli Changelog +## 0.4.4 (Mar 19, 2026) + +### Improvements + +* Updated minimum required Ruby version to 3.4.0 +* Switched all dependency version constraints to open-ended (`>=`) and updated minimum versions +* Added `base64` as an explicit dependency +* Removed redundant `.select` filter in parser on a collection that was already filtered +* Refactored engine priority check to avoid running the same `select` query twice +* Simplified `File.expand_path(File.dirname(__FILE__))` to `__dir__` in `rbcli.rb` +* Added missing `# frozen_string_literal: true` magic comment to `parser.rb` +* Fixed typo "Compatiblity" → "Compatibility" in helptext banner + +### Bugfixes + +* Fixed logger method definitions generated by a `%w()` list with commas, which produced invalid method names like `:"debug,"` instead of `:debug` +* Fixed `!=` comparison being used instead of `+=` concatenation in the parser's interactive prompt, causing the default value hint never to be displayed +* Fixed command name validation regex not being anchored, which allowed invalid names containing special characters to pass validation +* Fixed test assertion in `gem_spec.rb` using `.equal?` as a bare method call (a no-op) instead of a proper RSpec `eq` matcher + ## 0.4.3 (Oct 22, 2025) ### Improvements From 62b64a26cd4764ca4d96b7a3c6dfecf3b43ad654 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:24:57 +0000 Subject: [PATCH 13/14] Update GitHub workflow to use Ruby 4.0.1 Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2dcbef..3b4c233 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: ruby: - - '3.3.0' + - '4.0.1' steps: - uses: actions/checkout@v4 From 52ac6b45adddcf71d806b00db17c731f674c6ff1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:39:06 +0000 Subject: [PATCH 14/14] Fix: use bundle exec rspec in workflow to fix command not found error Co-authored-by: akhoury6 <6639593+akhoury6@users.noreply.github.com> --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b4c233..bfcb268 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,4 +28,4 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run the tests - run: rspec \ No newline at end of file + run: bundle exec rspec \ No newline at end of file