Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ on:
jobs:
rspec:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'skip-ci') }}
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
Expand All @@ -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
Expand All @@ -52,6 +54,7 @@ jobs:

rubocop:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'skip-ci') }}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ 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', '~> 2.8', '>= 2.8.3'

gem 'rubocop', '~> 1.75'
gem 'rubocop-rspec', '~> 3.6'
gem 'rubocop', '~> 1.82'
gem 'rubocop-rspec', '~> 3.8'

gem 'simplecov', '~> 0.22'
end
Expand All @@ -25,7 +25,9 @@ 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',
branch: 'chore/ruby-4-0',
git: 'https://github.com/sleepingkingstudios/sleeping_king_studios-docs'

# Use Webrick as local content server.
gem 'webrick', '~> 1.8'
Expand Down
8 changes: 3 additions & 5 deletions cuprum.gemspec
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -27,9 +25,9 @@ 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']

gem.add_runtime_dependency 'sleeping_king_studios-tools', '~> 1.2'
gem.add_runtime_dependency 'sleeping_king_studios-tools', '~> 1.2', '>= 1.2.1'
end
2 changes: 2 additions & 0 deletions docs/versions/1.1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
18 changes: 18 additions & 0 deletions docs/versions/1.1/reference/index.md
Original file line number Diff line number Diff line change
@@ -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 %}
2 changes: 2 additions & 0 deletions docs/versions/1.2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
18 changes: 18 additions & 0 deletions docs/versions/1.2/reference/index.md
Original file line number Diff line number Diff line change
@@ -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 %}
2 changes: 2 additions & 0 deletions docs/versions/1.3/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
18 changes: 18 additions & 0 deletions docs/versions/1.3/reference/index.md
Original file line number Diff line number Diff line change
@@ -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 %}
2 changes: 1 addition & 1 deletion lib/cuprum/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/cuprum/rspec/be_a_result_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spec/cuprum/result/with_custom_status_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions spec/cuprum/result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down