From 88804ec360e9c1e88e29c87f59f34c5eb7f3f013 Mon Sep 17 00:00:00 2001 From: Rob Smith Date: Sun, 28 Dec 2025 23:26:55 -0500 Subject: [PATCH 1/4] Update RuboCop dependency. --- .github/workflows/ci.yml | 3 +++ .github/workflows/deploy-pages.yml | 2 +- Gemfile | 6 +++--- lib/cuprum/result.rb | 2 +- lib/cuprum/rspec/be_a_result_matcher.rb | 4 ++-- spec/cuprum/result/with_custom_status_spec.rb | 8 ++++---- spec/cuprum/result_spec.rb | 8 ++++---- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03b2cce..858bdc7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ on: jobs: rspec: runs-on: ubuntu-latest + if: ${{ !contains(github.event.head_commit.message, 'skip-ci') }} strategy: fail-fast: false matrix: @@ -35,6 +36,7 @@ jobs: rspec_each: runs-on: ubuntu-latest + if: ${{ !contains(github.event.head_commit.message, 'skip-ci') }} steps: - uses: actions/checkout@v4 @@ -52,6 +54,7 @@ jobs: rubocop: runs-on: ubuntu-latest + if: ${{ !contains(github.event.head_commit.message, 'skip-ci') }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 85127b0..f8cc49c 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -27,7 +27,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3' + ruby-version: '3.4' bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Setup Pages diff --git a/Gemfile b/Gemfile index 9cee559..6333143 100644 --- a/Gemfile +++ b/Gemfile @@ -12,8 +12,8 @@ group :development, :test do gem 'rspec', '~> 3.13' gem 'rspec-sleeping_king_studios', '~> 2.8.0' - gem 'rubocop', '~> 1.75' - gem 'rubocop-rspec', '~> 3.6' + gem 'rubocop', '~> 1.82' + gem 'rubocop-rspec', '~> 3.8' gem 'simplecov', '~> 0.22' end @@ -25,7 +25,7 @@ group :docs do # Use Kramdown to parse GFM-dialect Markdown. gem 'kramdown-parser-gfm', '~> 1.1' - gem 'sleeping_king_studios-docs', '~> 0.1' + gem 'sleeping_king_studios-docs', '~> 0.2' # Use Webrick as local content server. gem 'webrick', '~> 1.8' diff --git a/lib/cuprum/result.rb b/lib/cuprum/result.rb index 5c9d59f..b7a3376 100644 --- a/lib/cuprum/result.rb +++ b/lib/cuprum/result.rb @@ -77,7 +77,7 @@ def defined_statuses self.class::STATUSES end - def deprecated_compare(other) + def deprecated_compare(other) # rubocop:disable Naming/PredicateMethod unless %i[value status error].all? { |sym| other.respond_to?(sym) } return false end diff --git a/lib/cuprum/rspec/be_a_result_matcher.rb b/lib/cuprum/rspec/be_a_result_matcher.rb index 3cc4d9b..730d15f 100644 --- a/lib/cuprum/rspec/be_a_result_matcher.rb +++ b/lib/cuprum/rspec/be_a_result_matcher.rb @@ -104,7 +104,7 @@ def description # @param actual [Object] the actual object to match. # # @return [Boolean] false if the actual object is a result; otherwise true. - def does_not_match?(actual) # rubocop:disable Naming/PredicateName + def does_not_match?(actual) # rubocop:disable Naming/PredicatePrefix @actual = actual raise ArgumentError, negated_matcher_warning if expected_properties? @@ -210,7 +210,7 @@ def actual_is_uncalled_operation? result.error.is_a?(Cuprum::Errors::OperationNotCalled) end - def compare_items(expected, actual) + def compare_items(expected, actual) # rubocop:disable Naming/PredicateMethod return expected.matches?(actual) if expected.respond_to?(:matches?) expected == actual diff --git a/spec/cuprum/result/with_custom_status_spec.rb b/spec/cuprum/result/with_custom_status_spec.rb index aaf3780..bd43eba 100644 --- a/spec/cuprum/result/with_custom_status_spec.rb +++ b/spec/cuprum/result/with_custom_status_spec.rb @@ -105,7 +105,7 @@ 'status: :halted' => :halted, 'status: :success' => :success } - default_scenarios = { + default_scenarios = { # rubocop:disable RSpec/LeakyLocalVariable value: value_scenarios, error: error_scenarios, status: status_scenarios @@ -121,7 +121,7 @@ default_scenarios wrap_context 'when the result has a value' do - all_scenarios = { + all_scenarios = { # rubocop:disable RSpec/LeakyLocalVariable value: value_scenarios.merge('a matching value' => 'returned value'), error: error_scenarios, status: status_scenarios.merge('status: :halted' => :halted) @@ -149,7 +149,7 @@ end wrap_context 'when the result has an error' do - all_scenarios = { + all_scenarios = { # rubocop:disable RSpec/LeakyLocalVariable value: value_scenarios, error: error_scenarios.merge( 'a matching error' => Cuprum::Error.new( @@ -184,7 +184,7 @@ include_context 'when the result has a value' include_context 'when the result has an error' - all_scenarios = { + all_scenarios = { # rubocop:disable RSpec/LeakyLocalVariable value: value_scenarios.merge('a matching value' => 'returned value'), error: error_scenarios.merge( 'a matching error' => Cuprum::Error.new( diff --git a/spec/cuprum/result_spec.rb b/spec/cuprum/result_spec.rb index 53f46ec..b19bf25 100644 --- a/spec/cuprum/result_spec.rb +++ b/spec/cuprum/result_spec.rb @@ -83,7 +83,7 @@ 'status: :failure' => :failure, 'status: :success' => :success } - default_scenarios = { + default_scenarios = { # rubocop:disable RSpec/LeakyLocalVariable value: value_scenarios, error: error_scenarios, status: status_scenarios @@ -99,7 +99,7 @@ default_scenarios wrap_context 'when the result has a value' do - all_scenarios = { + all_scenarios = { # rubocop:disable RSpec/LeakyLocalVariable value: value_scenarios.merge('a matching value' => 'returned value'), error: error_scenarios, status: status_scenarios @@ -122,7 +122,7 @@ end wrap_context 'when the result has an error' do - all_scenarios = { + all_scenarios = { # rubocop:disable RSpec/LeakyLocalVariable value: value_scenarios, error: error_scenarios.merge( 'a matching error' => Cuprum::Error.new( @@ -152,7 +152,7 @@ include_context 'when the result has a value' include_context 'when the result has an error' - all_scenarios = { + all_scenarios = { # rubocop:disable RSpec/LeakyLocalVariable value: value_scenarios.merge('a matching value' => 'returned value'), error: error_scenarios.merge( 'a matching error' => Cuprum::Error.new( From c2320c50e1c1326f02fcbb4e07b46b068ec765ad Mon Sep 17 00:00:00 2001 From: Rob Smith Date: Sun, 28 Dec 2025 23:28:58 -0500 Subject: [PATCH 2/4] Update documentation. --- .travis.yml | 16 ---------------- docs/versions/1.1/index.md | 2 ++ docs/versions/1.1/reference/index.md | 18 ++++++++++++++++++ docs/versions/1.2/index.md | 2 ++ docs/versions/1.2/reference/index.md | 18 ++++++++++++++++++ docs/versions/1.3/index.md | 2 ++ docs/versions/1.3/reference/index.md | 18 ++++++++++++++++++ 7 files changed, 60 insertions(+), 16 deletions(-) delete mode 100644 .travis.yml create mode 100644 docs/versions/1.1/reference/index.md create mode 100644 docs/versions/1.2/reference/index.md create mode 100644 docs/versions/1.3/reference/index.md diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d44722d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Build Options -language: ruby -rvm: - - 2.6.8 - - 2.7.4 - - 3.0.2 -before_install: - - sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates -y && sudo update-ca-certificates -before_script: - - cp .rspec.example .rspec -script: - - bundle exec thor ci:steps - -# Travis-CI Configuration -cache: bundler -dist: focal diff --git a/docs/versions/1.1/index.md b/docs/versions/1.1/index.md index 261b310..35f976c 100644 --- a/docs/versions/1.1/index.md +++ b/docs/versions/1.1/index.md @@ -38,3 +38,5 @@ Cuprum defines the following core components: Define handling for results based on `#status`, `#error`, and `#value`. For a full list of defined classes and objects, see [Reference](./reference). + +{% include breadcrumbs.md %} diff --git a/docs/versions/1.1/reference/index.md b/docs/versions/1.1/reference/index.md new file mode 100644 index 0000000..cb3d6a2 --- /dev/null +++ b/docs/versions/1.1/reference/index.md @@ -0,0 +1,18 @@ +--- +breadcrumbs: + - name: Documentation + path: '../../../' + - name: Versions + path: '../../' + - name: '1.1' + path: '../' +version: '1.1' +--- + +{% assign root_namespace = site.namespaces | where: "version", page.version | first %} + +# Cuprum Reference + +{% include reference/namespace.md label=false namespace=root_namespace %} + +{% include breadcrumbs.md %} diff --git a/docs/versions/1.2/index.md b/docs/versions/1.2/index.md index 419d070..40ccddf 100644 --- a/docs/versions/1.2/index.md +++ b/docs/versions/1.2/index.md @@ -38,3 +38,5 @@ Cuprum defines the following core components: Define handling for results based on `#status`, `#error`, and `#value`. For a full list of defined classes and objects, see [Reference](./reference). + +{% include breadcrumbs.md %} diff --git a/docs/versions/1.2/reference/index.md b/docs/versions/1.2/reference/index.md new file mode 100644 index 0000000..7289e88 --- /dev/null +++ b/docs/versions/1.2/reference/index.md @@ -0,0 +1,18 @@ +--- +breadcrumbs: + - name: Documentation + path: '../../../' + - name: Versions + path: '../../' + - name: '1.2' + path: '../' +version: '1.2' +--- + +{% assign root_namespace = site.namespaces | where: "version", page.version | first %} + +# Cuprum Reference + +{% include reference/namespace.md label=false namespace=root_namespace %} + +{% include breadcrumbs.md %} diff --git a/docs/versions/1.3/index.md b/docs/versions/1.3/index.md index 0a86d1a..5ce8d4a 100644 --- a/docs/versions/1.3/index.md +++ b/docs/versions/1.3/index.md @@ -38,3 +38,5 @@ Cuprum defines the following core components: Define handling for results based on `#status`, `#error`, and `#value`. For a full list of defined classes and objects, see [Reference](./reference). + +{% include breadcrumbs.md %} diff --git a/docs/versions/1.3/reference/index.md b/docs/versions/1.3/reference/index.md new file mode 100644 index 0000000..b1ea37f --- /dev/null +++ b/docs/versions/1.3/reference/index.md @@ -0,0 +1,18 @@ +--- +breadcrumbs: + - name: Documentation + path: '../../../' + - name: Versions + path: '../../' + - name: '1.3' + path: '../' +version: '1.3' +--- + +{% assign root_namespace = site.namespaces | where: "version", page.version | first %} + +# Cuprum Reference + +{% include reference/namespace.md label=false namespace=root_namespace %} + +{% include breadcrumbs.md %} From 0f4040f0b642d37282760c6fbc3d2c71e4b7e049 Mon Sep 17 00:00:00 2001 From: Rob Smith Date: Sun, 28 Dec 2025 23:31:58 -0500 Subject: [PATCH 3/4] Add Ruby 4.0 to CI matrix. --- .github/workflows/ci.yml | 2 +- Gemfile | 12 ++++++++++-- cuprum.gemspec | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 858bdc7..4a7f98d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['3.1', '3.2', '3.3', '3.4'] + ruby-version: ['3.1', '3.2', '3.3', '3.4', '4.0'] steps: - uses: actions/checkout@v4 diff --git a/Gemfile b/Gemfile index 6333143..7ae2fc2 100644 --- a/Gemfile +++ b/Gemfile @@ -6,11 +6,17 @@ gemspec gem 'sleeping_king_studios-tasks', '~> 0.4', '>= 0.4.1' +gem 'sleeping_king_studios-tools', + branch: 'chore/ruby-4-0', + git: 'https://github.com/sleepingkingstudios/sleeping_king_studios-tools' + group :development, :test do gem 'byebug', '~> 11.1' gem 'rspec', '~> 3.13' - gem 'rspec-sleeping_king_studios', '~> 2.8.0' + gem 'rspec-sleeping_king_studios', + branch: 'chore/ruby-4-0', + git: 'https://github.com/sleepingkingstudios/rspec-sleeping_king_studios' gem 'rubocop', '~> 1.82' gem 'rubocop-rspec', '~> 3.8' @@ -25,7 +31,9 @@ group :docs do # Use Kramdown to parse GFM-dialect Markdown. gem 'kramdown-parser-gfm', '~> 1.1' - gem 'sleeping_king_studios-docs', '~> 0.2' + gem 'sleeping_king_studios-docs', + branch: 'chore/ruby-4-0', + git: 'https://github.com/sleepingkingstudios/sleeping_king_studios-docs' # Use Webrick as local content server. gem 'webrick', '~> 1.8' diff --git a/cuprum.gemspec b/cuprum.gemspec index 8003d93..aa77a19 100644 --- a/cuprum.gemspec +++ b/cuprum.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |gem| 'rubygems_mfa_required' => 'true' } - gem.required_ruby_version = '~> 3.1' + gem.required_ruby_version = ['>= 3.1', '< 5'] gem.require_path = 'lib' gem.files = Dir['lib/**/*.rb', 'LICENSE', '*.md'] From afd05c5127cce53b2203aa74b4595647f1d083b7 Mon Sep 17 00:00:00 2001 From: Rob Smith Date: Mon, 29 Dec 2025 12:04:54 -0500 Subject: [PATCH 4/4] Update SleepingKingStudios::Tools dependency. --- Gemfile | 8 +------- cuprum.gemspec | 6 ++---- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 7ae2fc2..deac34a 100644 --- a/Gemfile +++ b/Gemfile @@ -6,17 +6,11 @@ gemspec gem 'sleeping_king_studios-tasks', '~> 0.4', '>= 0.4.1' -gem 'sleeping_king_studios-tools', - branch: 'chore/ruby-4-0', - git: 'https://github.com/sleepingkingstudios/sleeping_king_studios-tools' - group :development, :test do gem 'byebug', '~> 11.1' gem 'rspec', '~> 3.13' - gem 'rspec-sleeping_king_studios', - branch: 'chore/ruby-4-0', - git: 'https://github.com/sleepingkingstudios/rspec-sleeping_king_studios' + gem 'rspec-sleeping_king_studios', '~> 2.8', '>= 2.8.3' gem 'rubocop', '~> 1.82' gem 'rubocop-rspec', '~> 3.8' diff --git a/cuprum.gemspec b/cuprum.gemspec index aa77a19..176994f 100644 --- a/cuprum.gemspec +++ b/cuprum.gemspec @@ -1,8 +1,6 @@ # frozen_string_literal: true -$LOAD_PATH << './lib' - -require 'cuprum/version' +require_relative 'lib/cuprum/version' Gem::Specification.new do |gem| gem.name = 'cuprum' @@ -31,5 +29,5 @@ Gem::Specification.new do |gem| gem.require_path = 'lib' gem.files = Dir['lib/**/*.rb', 'LICENSE', '*.md'] - gem.add_runtime_dependency 'sleeping_king_studios-tools', '~> 1.2' + gem.add_runtime_dependency 'sleeping_king_studios-tools', '~> 1.2', '>= 1.2.1' end