From d9042f21379b346e81bb649d5267fa91d6e6b825 Mon Sep 17 00:00:00 2001 From: Mark Cooper <551470+mark-cooper@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:30:27 -0800 Subject: [PATCH 1/2] Support Ruby 4 --- .github/workflows/ci.yml | 2 +- .gitignore | 1 + .rubocop.yml | 2 + .ruby-version | 2 +- .standard.yml | 2 +- Gemfile.lock | 126 ------------------------ README.md | 11 +-- collectionspace-client.gemspec | 2 + spec/collectionspace/ui_version_spec.rb | 2 +- 9 files changed, 10 insertions(+), 140 deletions(-) create mode 100644 .rubocop.yml delete mode 100644 Gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e80f7b..7d01bd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['3.3', '3.2', '3.1', '3.0'] + ruby-version: ["4.0", "3.3", "3.2", "3.1", "3.0"] steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index 0af7d86..ecaa0fc 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /tmp/ collectionobject.rb coverage +Gemfile.lock diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..6a02b2a --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,2 @@ +inherit_gem: + standard: config/base.yml diff --git a/.ruby-version b/.ruby-version index 818bd47..1454f6e 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.6 +4.0.1 diff --git a/.standard.yml b/.standard.yml index 6b30e78..323fdc2 100644 --- a/.standard.yml +++ b/.standard.yml @@ -1 +1 @@ -ruby_version: 3.0 +ruby_version: 4.0 diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index b3c7ab7..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,126 +0,0 @@ -PATH - remote: . - specs: - collectionspace-client (1.1.0) - httparty - json - nokogiri - -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - ast (2.4.2) - awesome_print (1.9.2) - base64 (0.2.0) - bigdecimal (3.1.9) - coderay (1.1.3) - crack (1.0.0) - bigdecimal - rexml - csv (3.3.2) - diff-lcs (1.5.1) - docile (1.4.1) - hashdiff (1.1.2) - httparty (0.22.0) - csv - mini_mime (>= 1.0.0) - multi_xml (>= 0.5.2) - json (2.9.1) - language_server-protocol (3.17.0.3) - lint_roller (1.1.0) - method_source (1.1.0) - mini_mime (1.1.5) - mini_portile2 (2.8.8) - multi_xml (0.6.0) - nokogiri (1.17.2) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) - parallel (1.26.3) - parser (3.3.7.0) - ast (~> 2.4.1) - racc - pry (0.15.2) - coderay (~> 1.1) - method_source (~> 1.0) - public_suffix (6.0.1) - racc (1.8.1) - rainbow (3.1.1) - rake (13.2.1) - regexp_parser (2.10.0) - rexml (3.4.0) - rspec (3.13.0) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.2) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-mocks (3.13.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-support (3.13.2) - rubocop (1.70.0) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.3.0.2) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.36.2, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.37.0) - parser (>= 3.3.1.0) - rubocop-performance (1.23.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - ruby-progressbar (1.13.0) - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.1) - simplecov_json_formatter (0.1.4) - standard (1.44.0) - language_server-protocol (~> 3.17.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.70.0) - standard-custom (~> 1.0.0) - standard-performance (~> 1.6) - standard-custom (1.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.50) - standard-performance (1.6.0) - lint_roller (~> 1.1) - rubocop-performance (~> 1.23.0) - unicode-display_width (3.1.4) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) - vcr (6.3.1) - base64 - webmock (3.24.0) - addressable (>= 2.8.0) - crack (>= 0.3.2) - hashdiff (>= 0.4.0, < 2.0.0) - -PLATFORMS - ruby - -DEPENDENCIES - awesome_print - bundler - collectionspace-client! - pry - rake - rspec - simplecov - standard - vcr - webmock - -BUNDLED WITH - 2.4.1 diff --git a/README.md b/README.md index 00e5d02..6ebca00 100644 --- a/README.md +++ b/README.md @@ -34,16 +34,7 @@ bundle exec rake ## Releasing -```bash -gem install gem-release -# https://github.com/svenfuchs/gem-release#gem-bump -gem bump --version $VERSION -# i.e. -gem bump --version minor --pretend # dryrun -gem bump --version minor # do it for real -bundle # update gem version in Gemfile.lock -# PR and merge will publish new version -``` +Create a pull request that updates `./lib/collectionspace/client/version.rb`. After it is merged a release will be built and published in RubyGems and a tag will be created and pushed to GitHub. ## Contributing diff --git a/collectionspace-client.gemspec b/collectionspace-client.gemspec index 20e6101..17360c7 100644 --- a/collectionspace-client.gemspec +++ b/collectionspace-client.gemspec @@ -19,9 +19,11 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] + spec.add_dependency "base64" spec.add_dependency "httparty" spec.add_dependency "json" spec.add_dependency "nokogiri" + spec.add_dependency "ostruct" spec.add_development_dependency "awesome_print" spec.add_development_dependency "bundler" diff --git a/spec/collectionspace/ui_version_spec.rb b/spec/collectionspace/ui_version_spec.rb index c31bf01..f4d745b 100644 --- a/spec/collectionspace/ui_version_spec.rb +++ b/spec/collectionspace/ui_version_spec.rb @@ -76,7 +76,7 @@ expect(result.failure?).to be true expect(result.message).to start_with( "Failed to open TCP connection to " \ - "anthor.collectionspace.org:443 (getaddrinfo: " + "anthor.collectionspace.org:443 (getaddrinfo" ) expect(result.joined).to be_nil end From f4df49942f2a3b300851596af7b87d8583e67575 Mon Sep 17 00:00:00 2001 From: Mark Cooper <551470+mark-cooper@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:36:34 -0800 Subject: [PATCH 2/2] Lint --- lib/collectionspace/client/client.rb | 1 + lib/collectionspace/client/request.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/collectionspace/client/client.rb b/lib/collectionspace/client/client.rb index fb0bf8f..5224112 100644 --- a/lib/collectionspace/client/client.rb +++ b/lib/collectionspace/client/client.rb @@ -4,6 +4,7 @@ module CollectionSpace # CollectionSpace client class Client include Helpers + attr_reader :config def initialize(config = Configuration.new) diff --git a/lib/collectionspace/client/request.rb b/lib/collectionspace/client/request.rb index 9e138c3..17e0ece 100644 --- a/lib/collectionspace/client/request.rb +++ b/lib/collectionspace/client/request.rb @@ -4,6 +4,7 @@ module CollectionSpace # CollectionSpace request class Request include HTTParty + attr_reader :config, :headers, :method, :path, :options def default_headers(method = :get)