From 33e1d2ca0b2cf5ff43a7796e0721eac7a2f2aa63 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 16 Feb 2023 09:27:02 -0500 Subject: [PATCH 01/20] Replace Travis-CI with GHA. Signed-off-by: Daniel (dB.) Doubrovkine --- .github/workflows/danger.yml | 22 ++++++++++++++++++++++ .github/workflows/lint.yml | 16 ++++++++++++++++ .github/workflows/test.yml | 25 +++++++++++++++++++++++++ .travis.yml | 24 ------------------------ CHANGELOG.md | 1 + CONTRIBUTING.md | 2 +- Gemfile | 3 --- README.md | 4 +++- RELEASING.md | 2 +- 9 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/danger.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 0000000..c643c4b --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,22 @@ +--- +name: danger +on: + pull_request: + types: [opened, reopened, edited, synchronize] +jobs: + danger: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - name: Run Danger + run: | + # the personal token is public, this is ok, base64 encode to avoid tripping Github + TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode) + DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7c6d5b3 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,16 @@ +name: lint +on: [push, pull_request] +jobs: + rubocop: + name: RuboCop + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + - run: bundle exec rubocop + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ff43635 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +--- +name: test +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + entry: + - { ruby: '2.7', faraday: '0.9.0' } + - { ruby: '2.7', faraday: '0.17.0' } + - { ruby: '2.7', faraday: '~> 1.0' } + - { ruby: 'jruby-9.2.21.0' } + - { ruby: 'ruby-head', allowed-failure: true } + - { ruby: 'jruby-head', allowed-failure: true } + name: test (${{ matrix.entry.ruby }}, ${{ matrix.entry.faraday || 'default' }}) + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.entry.ruby }} + bundler-cache: true + - run: bundle exec rake test + continue-on-error: ${{ matrix.entry.allowed-failure || false }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 08402d5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: ruby - -sudo: false - -matrix: - include: - - rvm: 2.6.6 - env: FARADAY_VERSION=0.9.0 - - rvm: 2.6.6 - env: FARADAY_VERSION=0.17.0 - - rvm: 2.6.6 - env: FARADAY_VERSION="~> 1.0" - - rvm: 2.6.6 - script: - - bundle exec danger - - rvm: 2.3.8 - - rvm: jruby-9.2.7.0 - - rvm: jruby-head - - rvm: ruby-head - allow_failures: - - rvm: ruby-head - - rvm: jruby-head - -bundler_args: --without development diff --git a/CHANGELOG.md b/CHANGELOG.md index 5071185..533de78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 1.0.2 (Next) +* [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). * Your contribution here. ### 1.0.1 (2021/01/02) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7358624..a4b627b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,7 +106,7 @@ git push origin my-feature-branch -f #### Check on Your Pull Request -Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above. +Go back to your pull request after a few minutes and see whether it passed muster with CI. Everything should look green, otherwise fix issues and amend your commit as described above. #### Be Patient diff --git a/Gemfile b/Gemfile index 23992ca..2b30dc4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,3 @@ -# NOTE: this is temporary until Bundler 2.0 changes how github: references work. -git_source(:github) { |repo| "https://github.com/#{repo['/'] ? repo : "#{repo}/#{repo}"}.git" } - source 'https://rubygems.org/' gem 'faraday', ENV['FARADAY_VERSION'] if ENV.key?('FARADAY_VERSION') diff --git a/README.md b/README.md index 085e49d..69dfe6b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Hyperclient [![Gem Version](http://img.shields.io/gem/v/hyperclient.svg)](http://badge.fury.io/rb/hyperclient) -[![Build Status](http://img.shields.io/travis/codegram/hyperclient.svg)](https://travis-ci.org/codegram/hyperclient) +[![Build Status](https://github.com/codegram/hyperclient/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/codegram/hyperclient/actions/workflows/test.yml) [![Code Climate](https://codeclimate.com/github/codegram/hyperclient.svg)](https://codeclimate.com/github/codegram/hyperclient) [![Coverage Status](https://img.shields.io/coveralls/codegram/hyperclient.svg)](https://coveralls.io/r/codegram/hyperclient?branch=master) @@ -9,6 +9,8 @@ Hyperclient is a Hypermedia API client written in Ruby. It fully supports [JSON # Table of Contents +- [Hyperclient](#hyperclient) +- [Table of Contents](#table-of-contents) - [Usage](#usage) - [API Client](#api-client) - [Resources and Attributes](#resources-and-attributes) diff --git a/RELEASING.md b/RELEASING.md index 4e16d1b..df10632 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -12,7 +12,7 @@ bundle install rake ``` -Check that the last build succeeded in [Travis CI](https://travis-ci.org/codegram/hyperclient) for all supported platforms. +Check that the last build succeeded in CI for all supported platforms. Increment the version, modify [lib/hyperclient/version.rb](lib/hyperclient/version.rb). From 803ded00b7a57de33c320c33f0e300c6523e2b7e Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 16 Feb 2023 09:46:45 -0500 Subject: [PATCH 02/20] Re-add code coverage. --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/coverage.yml | 24 ++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- CHANGELOG.md | 1 + Gemfile | 1 + README.md | 2 -- Rakefile | 8 -------- test/test_helper.rb | 15 +++++++++++++++ 8 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 .DS_Store create mode 100644 .github/workflows/coverage.yml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1ad899dbcdc748036dd701eacb0ec11e243703d4 GIT binary patch literal 6148 zcmeHKyJ`bL3>+mc4$`I(2Sbbi#2M3J zT*oXyY@Q(Y!ZDE|1kgGlC+ZoQs7@HV6)|Fx!@~RZ=JlH_u58Z)4k@C?#6Xc7@{2$qaAbO f?f5y0vab1>=e=-D3_9~cC+cUwb&*MdzgFN1-fR_w literal 0 HcmV?d00001 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..d501940 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,24 @@ +--- +name: coverage +on: [push, pull_request] + +env: + COVERAGE: 1 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Ruby (2.7) + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - name: Build and test with RSpec + run: | + bundle exec rake test + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff43635..792103e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,5 +21,5 @@ jobs: with: ruby-version: ${{ matrix.entry.ruby }} bundler-cache: true - - run: bundle exec rake test + - run: bundle exec rake test spinach continue-on-error: ${{ matrix.entry.allowed-failure || false }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 533de78..e75e91a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### 1.0.2 (Next) * [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). +* [#269](https://github.com/codegram/hyperclient/pull/269): Re-add code coverage - [@dblock](https://github.com/dblock). * Your contribution here. ### 1.0.1 (2021/01/02) diff --git a/Gemfile b/Gemfile index 2b30dc4..6f38768 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,7 @@ group :development, :test do gem 'rake' gem 'rubocop', '0.81.0', require: false gem 'simplecov', require: false + gem 'simplecov-lcov', require: false end group :test do diff --git a/README.md b/README.md index 69dfe6b..8ab765f 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,6 @@ Hyperclient is a Hypermedia API client written in Ruby. It fully supports [JSON # Table of Contents -- [Hyperclient](#hyperclient) -- [Table of Contents](#table-of-contents) - [Usage](#usage) - [API Client](#api-client) - [Resources and Attributes](#resources-and-attributes) diff --git a/Rakefile b/Rakefile index 0c01671..fd517a6 100755 --- a/Rakefile +++ b/Rakefile @@ -6,14 +6,6 @@ Bundler.setup :default, :test, :development Bundler::GemHelper.install_tasks -if ENV['COVERAGE'] - require 'simplecov' - SimpleCov.start do - add_filter '/test/' - add_filter '/features/' - end -end - require 'rake/testtask' Rake::TestTask.new(:test) do |t| diff --git a/test/test_helper.rb b/test/test_helper.rb index 80bd6f7..c9f1875 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,5 +1,20 @@ $LOAD_PATH << 'lib' +if ENV['COVERAGE'] + require 'simplecov' + require 'simplecov-lcov' + SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter + SimpleCov::Formatter::LcovFormatter.config do |c| + c.report_with_single_file = true + c.lcov_file_name = 'lcov.info' + c.single_report_path = 'coverage/lcov.info' + end + SimpleCov.start do + add_filter '/test/' + add_filter '/features/' + end +end + require 'minitest/autorun' require 'minitest/pride' require 'mocha/minitest' From c10e392c66aeed380c9145d40580c52272cc77ed Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 16 Feb 2023 10:26:29 -0500 Subject: [PATCH 03/20] Upgrade Rubocop to 1.45. --- .github/workflows/test.yml | 2 +- .rubocop.yml | 5 +++ .rubocop_todo.yml | 62 ++++++++++++++------------ CHANGELOG.md | 1 + Gemfile | 4 +- features/support/api.rb | 33 +++++++++----- hyperclient.gemspec | 2 +- lib/hyperclient/resource.rb | 4 +- lib/hyperclient/resource_collection.rb | 4 +- test/hyperclient/resource_test.rb | 3 +- 10 files changed, 70 insertions(+), 50 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 792103e..930e7f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: - { ruby: '2.7', faraday: '0.9.0' } - { ruby: '2.7', faraday: '0.17.0' } - { ruby: '2.7', faraday: '~> 1.0' } - - { ruby: 'jruby-9.2.21.0' } + - { ruby: 'jruby-9.3' } - { ruby: 'ruby-head', allowed-failure: true } - { ruby: 'jruby-head', allowed-failure: true } name: test (${{ matrix.entry.ruby }}, ${{ matrix.entry.faraday || 'default' }}) diff --git a/.rubocop.yml b/.rubocop.yml index 40899e1..6405b60 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,11 @@ inherit_from: .rubocop_todo.yml +require: + - rubocop-rake + - rubocop-minitest + AllCops: + NewCops: enable TargetRubyVersion: 2.3 Metrics: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 61a9d4b..a77901a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,14 +1,43 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2020-12-03 14:08:14 -0500 using RuboCop version 0.81.0. +# on 2023-02-16 15:23:43 UTC using RuboCop version 1.45.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. +# Offense count: 1 +# Configuration parameters: Severity, Include. +# Include: **/*.gemspec +Gemspec/RequiredRubyVersion: + Exclude: + - 'hyperclient.gemspec' + +# Offense count: 1 +# Configuration parameters: AllowComments, AllowEmptyLambdas. +Lint/EmptyBlock: + Exclude: + - 'test/hyperclient/entry_point_test.rb' + +# Offense count: 4 +Lint/MissingSuper: + Exclude: + - 'lib/hyperclient/attributes.rb' + - 'lib/hyperclient/entry_point.rb' + - 'lib/hyperclient/link_collection.rb' + - 'lib/hyperclient/resource_collection.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedMethods. +# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal? +Lint/RedundantSafeNavigation: + Exclude: + - 'lib/hyperclient/link.rb' + # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Exclude: @@ -16,6 +45,7 @@ Style/ClassAndModuleChildren: - 'features/steps/default_config.rb' # Offense count: 4 +# Configuration parameters: AllowedConstants. Style/Documentation: Exclude: - 'spec/**/*' @@ -24,29 +54,3 @@ Style/Documentation: - 'features/steps/default_config.rb' - 'features/support/api.rb' - 'features/support/fixtures.rb' - -# Offense count: 2 -Style/DoubleNegation: - Exclude: - - 'lib/hyperclient/curie.rb' - - 'lib/hyperclient/link.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Style/IfUnlessModifier: - Exclude: - - 'lib/hyperclient/link_collection.rb' - - 'lib/hyperclient/resource.rb' - - 'lib/hyperclient/resource_collection.rb' - -# Offense count: 1 -Style/MethodMissingSuper: - Exclude: - - 'lib/hyperclient/collection.rb' - -# Offense count: 101 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Layout/LineLength: - Max: 147 diff --git a/CHANGELOG.md b/CHANGELOG.md index e75e91a..ca43a11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). * [#269](https://github.com/codegram/hyperclient/pull/269): Re-add code coverage - [@dblock](https://github.com/dblock). +* [#270](https://github.com/codegram/hyperclient/pull/270): Upgrade Rubocop to 1.45 - [@dblock](https://github.com/dblock). * Your contribution here. ### 1.0.1 (2021/01/02) diff --git a/Gemfile b/Gemfile index 6f38768..a9c1e94 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,9 @@ end group :development, :test do gem 'rake' - gem 'rubocop', '0.81.0', require: false + gem 'rubocop', '~> 1.45.1', require: false + gem 'rubocop-minitest', require: false + gem 'rubocop-rake', require: false gem 'simplecov', require: false gem 'simplecov-lcov', require: false end diff --git a/features/support/api.rb b/features/support/api.rb index f6c912d..61287c9 100644 --- a/features/support/api.rb +++ b/features/support/api.rb @@ -7,17 +7,28 @@ module API before do WebMock::Config.instance.query_values_notation = :flat_array - stub_request(:any, /api.example.org*/).to_return(body: root_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org').to_return(body: root_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/authors').to_return(body: authors_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/posts').to_return(body: posts_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/posts?page=2').to_return(body: posts_page2_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/posts?page=3').to_return(body: posts_page3_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/posts/1').to_return(body: post1_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/posts/2').to_return(body: post2_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/posts/3').to_return(body: post3_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/page2').to_return(body: page2_response, headers: { 'Content-Type' => 'application/hal+json' }) - stub_request(:get, 'api.example.org/page3').to_return(body: page3_response, headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:any, /api.example.org*/).to_return(body: root_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org').to_return(body: root_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/authors').to_return(body: authors_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/posts').to_return(body: posts_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/posts?page=2').to_return(body: posts_page2_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/posts?page=3').to_return(body: posts_page3_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/posts/1').to_return(body: post1_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/posts/2').to_return(body: post2_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/posts/3').to_return(body: post3_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/page2').to_return(body: page2_response, + headers: { 'Content-Type' => 'application/hal+json' }) + stub_request(:get, 'api.example.org/page3').to_return(body: page3_response, + headers: { 'Content-Type' => 'application/hal+json' }) end def api diff --git a/hyperclient.gemspec b/hyperclient.gemspec index c01318d..fb8678c 100644 --- a/hyperclient.gemspec +++ b/hyperclient.gemspec @@ -8,7 +8,6 @@ Gem::Specification.new do |gem| gem.homepage = 'https://github.com/codegram/hyperclient/' gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } gem.files = `git ls-files`.split("\n") - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") gem.name = 'hyperclient' gem.require_paths = ['lib'] gem.version = Hyperclient::VERSION @@ -17,4 +16,5 @@ Gem::Specification.new do |gem| gem.add_dependency 'faraday', '>= 0.9.0' gem.add_dependency 'faraday_hal_middleware' gem.add_dependency 'faraday_middleware' + gem.metadata['rubygems_mfa_required'] = 'true' end diff --git a/lib/hyperclient/resource.rb b/lib/hyperclient/resource.rb index 269261c..d953e85 100644 --- a/lib/hyperclient/resource.rb +++ b/lib/hyperclient/resource.rb @@ -111,9 +111,7 @@ def method_missing(method, *args, &block) elsif !Array.method_defined?(method) %i[_attributes _embedded _links].each do |target| target = send(target) - if target.respond_to?(method.to_s) - return target.send(method, *args, &block) - end + return target.send(method, *args, &block) if target.respond_to?(method.to_s) end super end diff --git a/lib/hyperclient/resource_collection.rb b/lib/hyperclient/resource_collection.rb index 095e65f..915ed9c 100644 --- a/lib/hyperclient/resource_collection.rb +++ b/lib/hyperclient/resource_collection.rb @@ -23,9 +23,7 @@ def initialize(collection, entry_point) private def build_resource(representation) - if representation.is_a?(Array) - return representation.map(&method(:build_resource)) - end + return representation.map(&method(:build_resource)) if representation.is_a?(Array) Resource.new(representation, @entry_point) end diff --git a/test/hyperclient/resource_test.rb b/test/hyperclient/resource_test.rb index ce96ae7..2f2f85e 100644 --- a/test/hyperclient/resource_test.rb +++ b/test/hyperclient/resource_test.rb @@ -60,7 +60,8 @@ module Hyperclient describe '_links' do it '_expand' do - resource = Resource.new({ '_links' => { 'orders' => { 'href' => '/orders/{id}', 'templated' => true } } }, entry_point) + resource = Resource.new({ '_links' => { 'orders' => { 'href' => '/orders/{id}', 'templated' => true } } }, + entry_point) _(resource._links.orders._expand(id: 1)._url).must_equal '/orders/1' _(resource.orders._expand(id: 1)._url).must_equal '/orders/1' _(resource.orders(id: 1)._url).must_equal '/orders/1' From 90bab91e43ef8a7a3d54ea845bf6eeb8d165b3d6 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 16 Feb 2023 11:25:20 -0500 Subject: [PATCH 04/20] Added Ruby 3.2. Signed-off-by: Daniel (dB.) Doubrovkine --- .github/workflows/test.yml | 3 +++ CHANGELOG.md | 3 ++- Gemfile | 2 +- lib/hyperclient/version.rb | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 930e7f1..d531776 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,7 @@ jobs: fail-fast: false matrix: entry: + - { ruby: '3.2' } - { ruby: '2.7', faraday: '0.9.0' } - { ruby: '2.7', faraday: '0.17.0' } - { ruby: '2.7', faraday: '~> 1.0' } @@ -15,6 +16,8 @@ jobs: - { ruby: 'ruby-head', allowed-failure: true } - { ruby: 'jruby-head', allowed-failure: true } name: test (${{ matrix.entry.ruby }}, ${{ matrix.entry.faraday || 'default' }}) + env: + FARADAY_VERSION: ${{ matrix.entry.faraday }} steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index ca43a11..d6d7f27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ ## Changelog -### 1.0.2 (Next) +### 1.1.0 (Next) * [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). * [#269](https://github.com/codegram/hyperclient/pull/269): Re-add code coverage - [@dblock](https://github.com/dblock). * [#270](https://github.com/codegram/hyperclient/pull/270): Upgrade Rubocop to 1.45 - [@dblock](https://github.com/dblock). +* [#271](https://github.com/codegram/hyperclient/pull/271): Test against Ruby 3.2 - [@dblock](https://github.com/dblock). * Your contribution here. ### 1.0.1 (2021/01/02) diff --git a/Gemfile b/Gemfile index a9c1e94..c61e3bb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org/' -gem 'faraday', ENV['FARADAY_VERSION'] if ENV.key?('FARADAY_VERSION') +gem 'faraday', ENV['FARADAY_VERSION'] if ENV['FARADAY_VERSION'] && !ENV['FARADAY_VERSION'].empty? gemspec diff --git a/lib/hyperclient/version.rb b/lib/hyperclient/version.rb index 83b1978..46f95c0 100644 --- a/lib/hyperclient/version.rb +++ b/lib/hyperclient/version.rb @@ -1,3 +1,3 @@ module Hyperclient - VERSION = '1.0.2'.freeze + VERSION = '1.1.0'.freeze end From 4b3064bcf0c09696aa2c5048c047709b7428d43c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Feb 2023 03:13:13 +0000 Subject: [PATCH 05/20] Update rubocop requirement from ~> 1.45.1 to ~> 1.46.0 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.45.1...v1.46.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index c61e3bb..d6b2d57 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ end group :development, :test do gem 'rake' - gem 'rubocop', '~> 1.45.1', require: false + gem 'rubocop', '~> 1.46.0', require: false gem 'rubocop-minitest', require: false gem 'rubocop-rake', require: false gem 'simplecov', require: false From e446423677da1925bd89d43230b3f242c44fc2d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 03:58:51 +0000 Subject: [PATCH 06/20] Update rubocop requirement from ~> 1.46.0 to ~> 1.48.0 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.46.0...v1.48.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d6b2d57..8c84199 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ end group :development, :test do gem 'rake' - gem 'rubocop', '~> 1.46.0', require: false + gem 'rubocop', '~> 1.48.0', require: false gem 'rubocop-minitest', require: false gem 'rubocop-rake', require: false gem 'simplecov', require: false From f2c856c346c7271efc7fa285dd1e348613f2d920 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 31 Jan 2024 20:07:51 -0500 Subject: [PATCH 07/20] Add support for Faraday 2.x. --- .github/workflows/test.yml | 9 ++------- .rubocop_todo.yml | 8 +++++--- CHANGELOG.md | 3 ++- Gemfile | 3 +-- README.md | 4 ++-- features/steps/api_navigation.rb | 6 +++--- features/steps/default_config.rb | 4 ++-- features/support/env.rb | 15 ++++++++++++++- hyperclient.gemspec | 5 ++--- lib/hyperclient/entry_point.rb | 6 +++--- test/hyperclient/entry_point_test.rb | 26 +++++++++++++------------- test/hyperclient_test.rb | 10 +++++----- test/test_helper.rb | 6 +++++- 13 files changed, 59 insertions(+), 46 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d531776..21b1aa7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,15 +9,10 @@ jobs: matrix: entry: - { ruby: '3.2' } - - { ruby: '2.7', faraday: '0.9.0' } - - { ruby: '2.7', faraday: '0.17.0' } - - { ruby: '2.7', faraday: '~> 1.0' } - - { ruby: 'jruby-9.3' } + - { ruby: '2.7' } - { ruby: 'ruby-head', allowed-failure: true } - { ruby: 'jruby-head', allowed-failure: true } - name: test (${{ matrix.entry.ruby }}, ${{ matrix.entry.faraday || 'default' }}) - env: - FARADAY_VERSION: ${{ matrix.entry.faraday }} + name: test (${{ matrix.entry.ruby }}) steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a77901a..11596b3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-02-16 15:23:43 UTC using RuboCop version 1.45.1. +# on 2024-02-01 15:09:00 UTC using RuboCop version 1.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -35,7 +35,7 @@ Lint/RedundantSafeNavigation: Exclude: - 'lib/hyperclient/link.rb' -# Offense count: 2 +# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: nested, compact @@ -43,8 +43,9 @@ Style/ClassAndModuleChildren: Exclude: - 'features/steps/api_navigation.rb' - 'features/steps/default_config.rb' + - 'features/support/env.rb' -# Offense count: 4 +# Offense count: 5 # Configuration parameters: AllowedConstants. Style/Documentation: Exclude: @@ -53,4 +54,5 @@ Style/Documentation: - 'features/steps/api_navigation.rb' - 'features/steps/default_config.rb' - 'features/support/api.rb' + - 'features/support/env.rb' - 'features/support/fixtures.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index d6d7f27..ff81465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ ## Changelog -### 1.1.0 (Next) +### 2.0.0 (Next) * [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). * [#269](https://github.com/codegram/hyperclient/pull/269): Re-add code coverage - [@dblock](https://github.com/dblock). * [#270](https://github.com/codegram/hyperclient/pull/270): Upgrade Rubocop to 1.45 - [@dblock](https://github.com/dblock). * [#271](https://github.com/codegram/hyperclient/pull/271): Test against Ruby 3.2 - [@dblock](https://github.com/dblock). +* [#285](https://github.com/codegram/hyperclient/pull/285): Support Faraday 2.x - [@dblock](https://github.com/dblock). * Your contribution here. ### 1.0.1 (2021/01/02) diff --git a/Gemfile b/Gemfile index 8c84199..91fc703 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,5 @@ source 'https://rubygems.org/' -gem 'faraday', ENV['FARADAY_VERSION'] if ENV['FARADAY_VERSION'] && !ENV['FARADAY_VERSION'].empty? - gemspec group :development do @@ -25,6 +23,7 @@ end group :test do gem 'danger-changelog', '~> 0.6.0' gem 'danger-toc', '~> 0.2.0' + gem 'faraday-follow_redirects' gem 'minitest' gem 'mocha' gem 'rack-test' diff --git a/README.md b/README.md index 8ab765f..1a7c78b 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Hyperclient constructs a connection using typical [Faraday](http://github.com/lo ```ruby api = Hyperclient.new('https://grape-with-roar.herokuapp.com/api') do |client| client.connection do |conn| - conn.use Faraday::Request::OAuth + conn.use Faraday::Request::Instrumentation end end ``` @@ -60,7 +60,7 @@ You can pass options to the Faraday connection block in the `connection` block: ```ruby api = Hyperclient.new('https://grape-with-roar.herokuapp.com/api') do |client| client.connection(ssl: { verify: false }) do |conn| - conn.use Faraday::Request::OAuth + conn.use Faraday::Request::Instrumentation end end ``` diff --git a/features/steps/api_navigation.rb b/features/steps/api_navigation.rb index 59c6c28..b75b075 100644 --- a/features/steps/api_navigation.rb +++ b/features/steps/api_navigation.rb @@ -43,13 +43,13 @@ class Spinach::Features::ApiNavigation < Spinach::FeatureSteps end step 'I should be able to access it\'s title and body' do - @post._attributes.title.wont_equal nil - @post._attributes.body.wont_equal nil + assert_kind_of String, @post._attributes.title + assert_kind_of String, @post._attributes.body end step 'I should also be able to access it\'s embedded comments' do comment = @post._embedded.comments.first - comment._attributes.title.wont_equal nil + assert_kind_of String, comment._attributes.title end step 'I should be able to navigate to next page' do diff --git a/features/steps/default_config.rb b/features/steps/default_config.rb index 8c86470..3d21c9e 100644 --- a/features/steps/default_config.rb +++ b/features/steps/default_config.rb @@ -25,7 +25,7 @@ class Spinach::Features::DefaultConfig < Spinach::FeatureSteps end step 'it should have been parsed as JSON' do - @posts._attributes.total_posts.to_i.must_equal 4 - @posts._attributes['total_posts'].to_i.must_equal 4 + assert_equal 4, @posts._attributes.total_posts.to_i + assert_equal 4, @posts._attributes['total_posts'].to_i end end diff --git a/features/support/env.rb b/features/support/env.rb index 5d73b35..c3dd8f5 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,4 +1,17 @@ -require 'minitest/spec' +require 'minitest' require 'webmock' WebMock.enable! require 'hyperclient' + +Minitest::Spec.new nil if defined?(Minitest::Spec) +Spinach.config[:failure_exceptions] << Minitest::Assertion + +class Spinach::FeatureSteps + include Minitest::Assertions + attr_accessor :assertions + + def initialize(*args) + super(*args) + self.assertions = 0 + end +end diff --git a/hyperclient.gemspec b/hyperclient.gemspec index fb8678c..68f5601 100644 --- a/hyperclient.gemspec +++ b/hyperclient.gemspec @@ -13,8 +13,7 @@ Gem::Specification.new do |gem| gem.version = Hyperclient::VERSION gem.add_dependency 'addressable' - gem.add_dependency 'faraday', '>= 0.9.0' - gem.add_dependency 'faraday_hal_middleware' - gem.add_dependency 'faraday_middleware' + gem.add_dependency 'faraday', '>= 2' + gem.add_dependency 'faraday_hal_middleware', '>= 0.2' gem.metadata['rubygems_mfa_required'] = 'true' end diff --git a/lib/hyperclient/entry_point.rb b/lib/hyperclient/entry_point.rb index 96cebc8..f9ce119 100644 --- a/lib/hyperclient/entry_point.rb +++ b/lib/hyperclient/entry_point.rb @@ -1,4 +1,4 @@ -require 'faraday_middleware' +require 'faraday/follow_redirects' require 'faraday_hal_middleware' module Hyperclient @@ -20,7 +20,7 @@ def message # # client = Hyperclient::EntryPoint.new('http://my.api.org/') do |entry_point| # entry_point.connection do |conn| - # conn.use Faraday::Request::OAuth + # conn.use Faraday::Request::Instrumentation # end # entry_point.headers['Access-Token'] = 'token' # end @@ -138,7 +138,7 @@ def faraday_block=(value) def default_faraday_block lambda do |connection, &block| connection.use Faraday::Response::RaiseError - connection.use FaradayMiddleware::FollowRedirects + connection.use Faraday::FollowRedirects::Middleware connection.request :hal_json connection.response :hal_json, content_type: /\bjson$/ diff --git a/test/hyperclient/entry_point_test.rb b/test/hyperclient/entry_point_test.rb index 7dcd3ce..bdc22dd 100644 --- a/test/hyperclient/entry_point_test.rb +++ b/test/hyperclient/entry_point_test.rb @@ -26,18 +26,18 @@ module Hyperclient it 'can insert additional middleware after a connection has been constructed' do _(entry_point.connection).must_be_kind_of Faraday::Connection - entry_point.connection.use :instrumentation + entry_point.connection.use Faraday::Request::Instrumentation handlers = entry_point.connection.builder.handlers - _(handlers).must_include FaradayMiddleware::Instrumentation + _(handlers).must_include Faraday::Request::Instrumentation end it 'creates a Faraday connection with the default block' do handlers = entry_point.connection.builder.handlers _(handlers).must_include Faraday::Response::RaiseError - _(handlers).must_include FaradayMiddleware::FollowRedirects - _(handlers).must_include FaradayMiddleware::EncodeHalJson - _(handlers).must_include FaradayMiddleware::ParseHalJson + _(handlers).must_include Faraday::FollowRedirects::Middleware + _(handlers).must_include Faraday::HalJson::Request + _(handlers).must_include Faraday::HalJson::Response _(entry_point.connection.options.params_encoder).must_equal Faraday::FlatParamsEncoder end @@ -137,9 +137,9 @@ module Hyperclient it 'creates a Faraday connection with the default block' do handlers = entry_point.connection.builder.handlers _(handlers).wont_include Faraday::Response::RaiseError - _(handlers).wont_include FaradayMiddleware::FollowRedirects - _(handlers).must_include FaradayMiddleware::EncodeJson - _(handlers).must_include FaradayMiddleware::ParseJson + _(handlers).wont_include Faraday::FollowRedirects + _(handlers).must_include Faraday::Request::Json + _(handlers).must_include Faraday::Response::Json end end end @@ -148,7 +148,7 @@ module Hyperclient let(:entry_point) do EntryPoint.new 'http://my.api.org/' do |entry_point| entry_point.connection do |conn| - conn.use Faraday::Request::OAuth + conn.use Faraday::Request::Instrumentation end entry_point.headers['Access-Token'] = 'token' end @@ -168,11 +168,11 @@ module Hyperclient it 'creates a Faraday connection with the default block plus any additional handlers' do handlers = entry_point.connection.builder.handlers - _(handlers).must_include Faraday::Request::OAuth + _(handlers).must_include Faraday::Request::Instrumentation _(handlers).must_include Faraday::Response::RaiseError - _(handlers).must_include FaradayMiddleware::FollowRedirects - _(handlers).must_include FaradayMiddleware::EncodeHalJson - _(handlers).must_include FaradayMiddleware::ParseHalJson + _(handlers).must_include Faraday::FollowRedirects::Middleware + _(handlers).must_include Faraday::HalJson::Request + _(handlers).must_include Faraday::HalJson::Response _(entry_point.connection.options.params_encoder).must_equal Faraday::FlatParamsEncoder end diff --git a/test/hyperclient_test.rb b/test/hyperclient_test.rb index 9efd2a3..1daef19 100644 --- a/test/hyperclient_test.rb +++ b/test/hyperclient_test.rb @@ -13,7 +13,7 @@ let(:client) do Hyperclient.new('http://api.example.org/') do |client| client.connection(default: true) do |conn| - conn.use Faraday::Request::OAuth + conn.use Faraday::Request::Instrumentation end client.headers['Access-Token'] = 'token' end @@ -31,11 +31,11 @@ it 'creates a Faraday connection with the default block plus any additional handlers' do handlers = client.connection.builder.handlers - _(handlers).must_include Faraday::Request::OAuth + _(handlers).must_include Faraday::Request::Instrumentation _(handlers).must_include Faraday::Response::RaiseError - _(handlers).must_include FaradayMiddleware::FollowRedirects - _(handlers).must_include FaradayMiddleware::EncodeHalJson - _(handlers).must_include FaradayMiddleware::ParseHalJson + _(handlers).must_include Faraday::FollowRedirects::Middleware + _(handlers).must_include Faraday::HalJson::Request + _(handlers).must_include Faraday::HalJson::Response end end end diff --git a/test/test_helper.rb b/test/test_helper.rb index c9f1875..f0a1d9c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -17,10 +17,14 @@ require 'minitest/autorun' require 'minitest/pride' +require 'minitest/unit' require 'mocha/minitest' require 'json' -MiniTest::Test.class_eval do +require 'faraday' +require 'faraday/request/instrumentation' + +MiniTest::Assertions.class_eval do def stub_request(conn, adapter_class = Faraday::Adapter::Test, &stubs_block) adapter_handler = conn.builder.handlers.find { |h| h.klass < Faraday::Adapter } if adapter_handler From 180e8882d059c888effef5938726153b3270a8f8 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 1 Feb 2024 10:26:49 -0500 Subject: [PATCH 08/20] Require faraday-follow_redirects. --- .rubocop_todo.yml | 2 +- Gemfile | 1 - hyperclient.gemspec | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 11596b3..0021c96 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-02-01 15:09:00 UTC using RuboCop version 1.48.1. +# on 2024-02-01 15:28:54 UTC using RuboCop version 1.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new diff --git a/Gemfile b/Gemfile index 91fc703..34cc726 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,6 @@ end group :test do gem 'danger-changelog', '~> 0.6.0' gem 'danger-toc', '~> 0.2.0' - gem 'faraday-follow_redirects' gem 'minitest' gem 'mocha' gem 'rack-test' diff --git a/hyperclient.gemspec b/hyperclient.gemspec index 68f5601..64a978d 100644 --- a/hyperclient.gemspec +++ b/hyperclient.gemspec @@ -14,6 +14,7 @@ Gem::Specification.new do |gem| gem.add_dependency 'addressable' gem.add_dependency 'faraday', '>= 2' + gem.add_dependency 'faraday-follow_redirects' gem.add_dependency 'faraday_hal_middleware', '>= 0.2' gem.metadata['rubygems_mfa_required'] = 'true' end From f7cbfc27de98671a6ae3d12e5f1904330ebaa97d Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 1 Feb 2024 10:47:28 -0500 Subject: [PATCH 09/20] Preparing for release, 2.0. --- CHANGELOG.md | 3 +-- README.md | 2 +- lib/hyperclient/version.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff81465..77e6952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,12 @@ ## Changelog -### 2.0.0 (Next) +### 2.0.0 (2024/02/01) * [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). * [#269](https://github.com/codegram/hyperclient/pull/269): Re-add code coverage - [@dblock](https://github.com/dblock). * [#270](https://github.com/codegram/hyperclient/pull/270): Upgrade Rubocop to 1.45 - [@dblock](https://github.com/dblock). * [#271](https://github.com/codegram/hyperclient/pull/271): Test against Ruby 3.2 - [@dblock](https://github.com/dblock). * [#285](https://github.com/codegram/hyperclient/pull/285): Support Faraday 2.x - [@dblock](https://github.com/dblock). -* Your contribution here. ### 1.0.1 (2021/01/02) diff --git a/README.md b/README.md index 1a7c78b..9a2e466 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Hyperclient is a Hypermedia API client written in Ruby. It fully supports [JSON # Usage -The examples in this README use the [Splines Demo API](https://github.com/ruby-grape/grape-with-roar) running [here](https://grape-with-roar.herokuapp.com/api). If you're upgrading from a previous version, please make sure to read [UPGRADING](UPGRADING.md). +The examples in this README use the [Splines Demo API](https://github.com/ruby-grape/grape-with-roar) running [here](https://grape-with-roar.herokuapp.com/api). Use version 1.x with Faraday 1.x, and version 2.x with Faraday 2.x. If you're upgrading from a previous version, please make sure to read [UPGRADING](UPGRADING.md). ## API Client diff --git a/lib/hyperclient/version.rb b/lib/hyperclient/version.rb index 46f95c0..1aa34bb 100644 --- a/lib/hyperclient/version.rb +++ b/lib/hyperclient/version.rb @@ -1,3 +1,3 @@ module Hyperclient - VERSION = '1.1.0'.freeze + VERSION = '2.0.0'.freeze end From 4fbc886e4cb20250a352d87b6eeceb0dddb19c13 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 1 Feb 2024 10:48:07 -0500 Subject: [PATCH 10/20] Preparing for next developer iteration, 2.0.1. --- CHANGELOG.md | 4 ++++ lib/hyperclient/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77e6952..8ae3e74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Changelog +### 2.0.1 (Next) + +* Your contribution here. + ### 2.0.0 (2024/02/01) * [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). diff --git a/lib/hyperclient/version.rb b/lib/hyperclient/version.rb index 1aa34bb..7b68657 100644 --- a/lib/hyperclient/version.rb +++ b/lib/hyperclient/version.rb @@ -1,3 +1,3 @@ module Hyperclient - VERSION = '2.0.0'.freeze + VERSION = '2.0.1'.freeze end From 72856b97de0790c3abfc4d355ebeee2b8d120fef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 03:24:47 +0000 Subject: [PATCH 11/20] Update danger-changelog requirement from ~> 0.6.0 to ~> 0.7.0 Updates the requirements on [danger-changelog](https://github.com/dblock/danger-changelog) to permit the latest version. - [Release notes](https://github.com/dblock/danger-changelog/releases) - [Changelog](https://github.com/dblock/danger-changelog/blob/master/CHANGELOG.md) - [Commits](https://github.com/dblock/danger-changelog/compare/v0.6.0...v0.7.0) --- updated-dependencies: - dependency-name: danger-changelog dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 34cc726..9e491cc 100644 --- a/Gemfile +++ b/Gemfile @@ -21,7 +21,7 @@ group :development, :test do end group :test do - gem 'danger-changelog', '~> 0.6.0' + gem 'danger-changelog', '~> 0.7.0' gem 'danger-toc', '~> 0.2.0' gem 'minitest' gem 'mocha' From 5ab9bf4903724f245d95c605081f4126c956c5d1 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Sun, 12 May 2024 12:41:45 -0400 Subject: [PATCH 12/20] Upgraded RuboCop to 1.63.5. --- .rubocop_todo.yml | 3 ++- CHANGELOG.md | 1 + Gemfile | 2 +- examples/splines_api.rb | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0021c96..fe50fe9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-02-01 15:28:54 UTC using RuboCop version 1.48.1. +# on 2024-05-12 16:41:11 UTC using RuboCop version 1.63.5. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -20,6 +20,7 @@ Lint/EmptyBlock: - 'test/hyperclient/entry_point_test.rb' # Offense count: 4 +# Configuration parameters: AllowedParentClasses. Lint/MissingSuper: Exclude: - 'lib/hyperclient/attributes.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ae3e74..efd4d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 2.0.1 (Next) +* [#298](https://github.com/codegram/hyperclient/pull/298): Upgraded rubocop to 1.63.5 - [@dblock](https://github.com/dblock). * Your contribution here. ### 2.0.0 (2024/02/01) diff --git a/Gemfile b/Gemfile index 9e491cc..fd433a2 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ end group :development, :test do gem 'rake' - gem 'rubocop', '~> 1.48.0', require: false + gem 'rubocop', '~> 1.63.5', require: false gem 'rubocop-minitest', require: false gem 'rubocop-rake', require: false gem 'simplecov', require: false diff --git a/examples/splines_api.rb b/examples/splines_api.rb index 34d3b43..61d959d 100644 --- a/examples/splines_api.rb +++ b/examples/splines_api.rb @@ -7,7 +7,7 @@ # enumerate splines api.splines.each do |spline| - puts spline.uuid.to_s + puts spline.uuid puts " reticulated: #{spline.reticulated ? 'yes' : 'no'}" puts " thumbnail: #{spline['images:thumbnail']}" end From 582a7410cceb498b66660b32d29c1a639df5f845 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 10 Sep 2025 09:47:23 -0400 Subject: [PATCH 13/20] Remove broken badges. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 9a2e466..cf361d6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Gem Version](http://img.shields.io/gem/v/hyperclient.svg)](http://badge.fury.io/rb/hyperclient) [![Build Status](https://github.com/codegram/hyperclient/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/codegram/hyperclient/actions/workflows/test.yml) -[![Code Climate](https://codeclimate.com/github/codegram/hyperclient.svg)](https://codeclimate.com/github/codegram/hyperclient) [![Coverage Status](https://img.shields.io/coveralls/codegram/hyperclient.svg)](https://coveralls.io/r/codegram/hyperclient?branch=master) Hyperclient is a Hypermedia API client written in Ruby. It fully supports [JSON HAL](http://stateless.co/hal_specification.html). From a0782128ac23e0499266227c482b4e585304edfa Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 10 Sep 2025 09:54:58 -0400 Subject: [PATCH 14/20] Added Ruby 3.4. --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 21b1aa7..ff75f78 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,7 @@ jobs: fail-fast: false matrix: entry: + - { ruby: '3.4' } - { ruby: '3.2' } - { ruby: '2.7' } - { ruby: 'ruby-head', allowed-failure: true } From 17be9cbd147dd3420ae0b4f50e2cf98f27ee0e1b Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 10 Sep 2025 09:57:13 -0400 Subject: [PATCH 15/20] Upgraded RuboCop to 1.80.2. --- .rubocop.yml | 2 +- .rubocop_todo.yml | 12 +++++++----- CHANGELOG.md | 11 ++++++----- Gemfile | 2 +- features/support/env.rb | 3 ++- test/hyperclient/entry_point_test.rb | 3 +++ test/hyperclient/link_collection_test.rb | 4 ++++ test/hyperclient/link_test.rb | 12 ++++++++++++ test/hyperclient/resource_test.rb | 8 ++++++++ test/hyperclient_test.rb | 1 + 10 files changed, 45 insertions(+), 13 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6405b60..95b1856 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ inherit_from: .rubocop_todo.yml -require: +plugins: - rubocop-rake - rubocop-minitest diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index fe50fe9..90890bc 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,14 +1,13 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-05-12 16:41:11 UTC using RuboCop version 1.63.5. +# on 2025-09-10 13:55:47 UTC using RuboCop version 1.80.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. # Offense count: 1 -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec +# Configuration parameters: Severity. Gemspec/RequiredRubyVersion: Exclude: - 'hyperclient.gemspec' @@ -30,16 +29,19 @@ Lint/MissingSuper: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowedMethods. +# Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods. # AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal? +# AdditionalNilMethods: present?, blank?, try, try! Lint/RedundantSafeNavigation: Exclude: - 'lib/hyperclient/link.rb' # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. +# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules. # SupportedStyles: nested, compact +# SupportedStylesForClasses: ~, nested, compact +# SupportedStylesForModules: ~, nested, compact Style/ClassAndModuleChildren: Exclude: - 'features/steps/api_navigation.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index efd4d21..97f38a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,15 @@ ### 2.0.1 (Next) -* [#298](https://github.com/codegram/hyperclient/pull/298): Upgraded rubocop to 1.63.5 - [@dblock](https://github.com/dblock). +* [#298](https://github.com/codegram/hyperclient/pull/300): Upgraded RuboCop to 1.80.2 - [@dblock](https://github.com/dblock). +* [#298](https://github.com/codegram/hyperclient/pull/298): Upgraded RuboCop to 1.63.5 - [@dblock](https://github.com/dblock). * Your contribution here. ### 2.0.0 (2024/02/01) * [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock). * [#269](https://github.com/codegram/hyperclient/pull/269): Re-add code coverage - [@dblock](https://github.com/dblock). -* [#270](https://github.com/codegram/hyperclient/pull/270): Upgrade Rubocop to 1.45 - [@dblock](https://github.com/dblock). +* [#270](https://github.com/codegram/hyperclient/pull/270): Upgrade RuboCop to 1.45 - [@dblock](https://github.com/dblock). * [#271](https://github.com/codegram/hyperclient/pull/271): Test against Ruby 3.2 - [@dblock](https://github.com/dblock). * [#285](https://github.com/codegram/hyperclient/pull/285): Support Faraday 2.x - [@dblock](https://github.com/dblock). @@ -44,14 +45,14 @@ ### 0.9.0 (2018/01/10) * [#133](https://github.com/codegram/hyperclient/pull/133): Removed futuroscope - [@dblock](https://github.com/dblock). -* [#131](https://github.com/codegram/hyperclient/pull/131): Upgrade to Rubocop 0.50.0, fix Bundler's insecure git source warning - [@nebolsin](https://github.com/nebolsin). +* [#131](https://github.com/codegram/hyperclient/pull/131): Upgrade to RuboCop 0.50.0, fix Bundler's insecure git source warning - [@nebolsin](https://github.com/nebolsin). * [#132](https://github.com/codegram/hyperclient/pull/132): Swapped yard dependency for danger-toc - [@dblock](https://github.com/dblock). ### 0.8.6 (2017/08/27) * [#122](https://github.com/codegram/hyperclient/pull/122): Improve error message when server returns invalid data - [@ivoanjo](https://github.com/ivoanjo). * [#125](https://github.com/codegram/hyperclient/pull/125): Add table of contents to readme and add note asking users to add their projects to the wiki - [@ivoanjo](https://github.com/ivoanjo). -* [#127](https://github.com/codegram/hyperclient/pull/127): Minor fixes: Fix warnings, and pry-byebug to dev Gemfile and tweak rubocop execution - [@ivoanjo](https://github.com/ivoanjo). +* [#127](https://github.com/codegram/hyperclient/pull/127): Minor fixes: Fix warnings, and pry-byebug to dev Gemfile and tweak RuboCop execution - [@ivoanjo](https://github.com/ivoanjo). * [#128](https://github.com/codegram/hyperclient/pull/128): Fix link delegation returning nil for field with value false - [@ivoanjo](https://github.com/ivoanjo). ### 0.8.5 (2017/07/05) @@ -112,7 +113,7 @@ * [#64](https://github.com/codegram/hyperclient/issues/64): Added support for curies - [@dblock](https://github.com/dblock). * [#58](https://github.com/codegram/hyperclient/issues/58): Automatically follow redirects - [@dblock](https://github.com/dblock). * [#63](https://github.com/codegram/hyperclient/pull/63): You can omit the navigational elements, `api.links.products` is now equivalent to `api.products` - [@dblock](https://github.com/dblock). -* [#61](https://github.com/codegram/hyperclient/pull/61): Implemented Rubocop, Ruby-style linter - [@dblock](https://github.com/dblock). +* [#61](https://github.com/codegram/hyperclient/pull/61): Implemented RuboCop, Ruby-style linter - [@dblock](https://github.com/dblock). ### 0.4.0 (2014/05/05) diff --git a/Gemfile b/Gemfile index fd433a2..6dbcf99 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ end group :development, :test do gem 'rake' - gem 'rubocop', '~> 1.63.5', require: false + gem 'rubocop', '~> 1.80.2', require: false gem 'rubocop-minitest', require: false gem 'rubocop-rake', require: false gem 'simplecov', require: false diff --git a/features/support/env.rb b/features/support/env.rb index c3dd8f5..918de40 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -8,10 +8,11 @@ class Spinach::FeatureSteps include Minitest::Assertions + attr_accessor :assertions def initialize(*args) - super(*args) + super self.assertions = 0 end end diff --git a/test/hyperclient/entry_point_test.rb b/test/hyperclient/entry_point_test.rb index bdc22dd..8aa3a98 100644 --- a/test/hyperclient/entry_point_test.rb +++ b/test/hyperclient/entry_point_test.rb @@ -21,6 +21,7 @@ module Hyperclient it 'can update headers after a connection has been constructed' do _(entry_point.connection).must_be_kind_of Faraday::Connection entry_point.headers.update('Content-Type' => 'application/foobar') + _(entry_point.headers['Content-Type']).must_equal 'application/foobar' end @@ -28,6 +29,7 @@ module Hyperclient _(entry_point.connection).must_be_kind_of Faraday::Connection entry_point.connection.use Faraday::Request::Instrumentation handlers = entry_point.connection.builder.handlers + _(handlers).must_include Faraday::Request::Instrumentation end @@ -136,6 +138,7 @@ module Hyperclient it 'creates a Faraday connection with the default block' do handlers = entry_point.connection.builder.handlers + _(handlers).wont_include Faraday::Response::RaiseError _(handlers).wont_include Faraday::FollowRedirects _(handlers).must_include Faraday::Request::Json diff --git a/test/hyperclient/link_collection_test.rb b/test/hyperclient/link_collection_test.rb index 3dcb55d..7eb49a3 100644 --- a/test/hyperclient/link_collection_test.rb +++ b/test/hyperclient/link_collection_test.rb @@ -32,6 +32,7 @@ module Hyperclient describe 'plain link' do let(:plain_link) { links.self } + it 'must be correct' do _(plain_link._url).must_equal '/productions/1' end @@ -39,6 +40,7 @@ module Hyperclient describe 'templated link' do let(:templated_link) { links.search } + it 'must expand' do _(templated_link._expand(search: 'gizmos')._url).must_equal '/productions/1?categories=gizmos' end @@ -47,6 +49,7 @@ module Hyperclient describe 'curied link collection' do let(:curied_link) { links['image:thumbnail'] } let(:curie) { links._curies['image'] } + it 'must expand' do _(curied_link._expand(version: 'small')._url).must_equal '/images/thumbnails/small.jpg' end @@ -71,6 +74,7 @@ module Hyperclient describe 'null link value' do let(:null_link) { links.null_link } + it 'must be nil' do _(null_link).must_be_nil end diff --git a/test/hyperclient/link_test.rb b/test/hyperclient/link_test.rb index e4ffeca..86e0dbc 100644 --- a/test/hyperclient/link_test.rb +++ b/test/hyperclient/link_test.rb @@ -11,11 +11,13 @@ module Hyperclient describe prop do it 'returns the property value' do link = Link.new('key', { prop => 'value' }, entry_point) + _(link.send("_#{prop}")).must_equal 'value' end it 'returns nil if the property is not present' do link = Link.new('key', {}, entry_point) + _(link.send("_#{prop}")).must_be_nil end end @@ -53,11 +55,13 @@ module Hyperclient describe 'required argument' do it 'builds a Link with the templated URI representation' do link = Link.new('key', { 'href' => '/orders/{id}', 'templated' => true }, entry_point) + _(link._expand(id: '1')._url).must_equal '/orders/1' end it 'expands an uri template without variables' do link = Link.new('key', { 'href' => '/orders/{id}', 'templated' => true }, entry_point) + _(link._expand._url).must_equal '/orders/' _(link._url).must_equal '/orders/' end @@ -66,27 +70,32 @@ module Hyperclient describe 'query string argument' do it 'builds a Link with the templated URI representation' do link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => true }, entry_point) + _(link._expand(id: '1')._url).must_equal '/orders?id=1' end it 'expands an uri template without variables' do link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => true }, entry_point) + _(link._expand._url).must_equal '/orders' _(link._url).must_equal '/orders' end it 'does not expand unknown variables' do link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => true }, entry_point) + _(link._expand(unknown: '1')._url).must_equal '/orders' end it 'only expands known variables' do link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => true }, entry_point) + _(link._expand(unknown: '1', id: '2')._url).must_equal '/orders?id=2' end it 'only expands templated links' do link = Link.new('key', { 'href' => '/orders{?id}', 'templated' => false }, entry_point) + _(link._expand(id: '1')._url).must_equal '/orders{?id}' end end @@ -119,6 +128,7 @@ module Hyperclient it 'returns the link when no uri template' do link = Link.new('key', { 'href' => '/orders' }, entry_point) + _(link._url).must_equal '/orders' end @@ -341,11 +351,13 @@ module Hyperclient it 'responds to missing methods' do resource.expects(:respond_to?).with('orders').returns(false) resource.expects(:respond_to?).with('embedded').returns(true) + _(link.respond_to?(:embedded)).must_equal true end it 'does not delegate to_ary to resource' do resource.expects(:to_ary).never + _([[link, link]].flatten).must_equal [link, link] end end diff --git a/test/hyperclient/resource_test.rb b/test/hyperclient/resource_test.rb index 2f2f85e..d2d2bb7 100644 --- a/test/hyperclient/resource_test.rb +++ b/test/hyperclient/resource_test.rb @@ -62,6 +62,7 @@ module Hyperclient it '_expand' do resource = Resource.new({ '_links' => { 'orders' => { 'href' => '/orders/{id}', 'templated' => true } } }, entry_point) + _(resource._links.orders._expand(id: 1)._url).must_equal '/orders/1' _(resource.orders._expand(id: 1)._url).must_equal '/orders/1' _(resource.orders(id: 1)._url).must_equal '/orders/1' @@ -94,16 +95,19 @@ module Hyperclient describe 'method_missing' do it 'delegates to attributes' do resource._attributes.expects(:foo).returns('bar') + _(resource.foo).must_equal 'bar' end it 'delegates to links' do resource._links.expects(:foo).returns('bar') + _(resource.foo).must_equal 'bar' end it 'delegates to embedded' do resource._embedded.expects(:foo).returns('bar') + _(resource.foo).must_equal 'bar' end @@ -111,11 +115,13 @@ module Hyperclient resource._attributes.expects('respond_to?').with('foo').returns(false) resource._links.expects('respond_to?').with('foo').returns(false) resource._embedded.expects('respond_to?').with('foo').returns(false) + _(-> { resource.foo }).must_raise NoMethodError end it 'delegates []' do resource._attributes.expects(:foo).returns('bar') + _(resource['foo']).must_equal 'bar' end @@ -133,6 +139,7 @@ module Hyperclient describe 'with a default value' do it 'returns the value for keys that exist' do resource._attributes.expects(:foo).returns('bar') + _(resource.fetch('https://github.com/foo', 'default value')).must_equal 'bar' end @@ -144,6 +151,7 @@ module Hyperclient describe 'with a block' do it 'returns the value for keys that exist' do resource._attributes.expects(:foo).returns('bar') + _(resource.fetch('https://github.com/foo') { 'default value' }).must_equal 'bar' end diff --git a/test/hyperclient_test.rb b/test/hyperclient_test.rb index 1daef19..011d06e 100644 --- a/test/hyperclient_test.rb +++ b/test/hyperclient_test.rb @@ -31,6 +31,7 @@ it 'creates a Faraday connection with the default block plus any additional handlers' do handlers = client.connection.builder.handlers + _(handlers).must_include Faraday::Request::Instrumentation _(handlers).must_include Faraday::Response::RaiseError _(handlers).must_include Faraday::FollowRedirects::Middleware From 4d7eff577c3d1275f4997c2b4356848b9fe94031 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 10 Sep 2025 10:03:33 -0400 Subject: [PATCH 16/20] Fix: positional arguments test will begin failing in future versions of Ruby. --- test/hyperclient/resource_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hyperclient/resource_test.rb b/test/hyperclient/resource_test.rb index d2d2bb7..6c96c12 100644 --- a/test/hyperclient/resource_test.rb +++ b/test/hyperclient/resource_test.rb @@ -13,7 +13,7 @@ module Hyperclient end it 'initializes its attributes' do - Attributes.expects(:new).with(foo: :bar) + Attributes.expects(:new).with({ foo: :bar }) Resource.new({ foo: :bar }, entry_point) end From ab95577207d0fd684b7379163792e332bdd0486c Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 10 Sep 2025 10:03:51 -0400 Subject: [PATCH 17/20] Fix: Ruby 3.4 removes spaces around the hash rocket. --- test/hyperclient/link_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hyperclient/link_test.rb b/test/hyperclient/link_test.rb index 86e0dbc..f4400de 100644 --- a/test/hyperclient/link_test.rb +++ b/test/hyperclient/link_test.rb @@ -276,7 +276,7 @@ module Hyperclient link = Link.new('key', { 'href' => '/productions/1' }, 'foo') _(link.inspect).must_include 'Link' - _(link.inspect).must_include '"href"=>"/productions/1"' + _(link.inspect).must_include({ 'href' => '/productions/1' }.inspect) end end From 8b75812c3fedbb2cfb6e0224dba28c1df7efa321 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 10 Sep 2025 10:06:58 -0400 Subject: [PATCH 18/20] Lock version of coverallsapp/github-action and run test with spinach. --- .github/workflows/coverage.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d501940..73232e3 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,15 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install Ruby (2.7) - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.4 bundler-cache: true - - name: Build and test with RSpec - run: | - bundle exec rake test - - name: Coveralls - uses: coverallsapp/github-action@master + - run: | + bundle exec rake test spinach + - uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} From a9cfe61ee8dd274494702c53387136ea88f536b9 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 10 Sep 2025 10:09:33 -0400 Subject: [PATCH 19/20] Run danger on ubuntu-latest. --- .github/workflows/danger.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index c643c4b..d8a4cff 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -5,7 +5,7 @@ on: types: [opened, reopened, edited, synchronize] jobs: danger: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: @@ -13,7 +13,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.4 bundler-cache: true - name: Run Danger run: | From fd69e3ea1d0674912ee5995c4ca04fec53c0a68d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 02:05:03 +0000 Subject: [PATCH 20/20] Update rubocop requirement from ~> 1.80.2 to ~> 1.81.1 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.80.2...v1.81.1) --- updated-dependencies: - dependency-name: rubocop dependency-version: 1.81.1 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6dbcf99..64e8cb6 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ end group :development, :test do gem 'rake' - gem 'rubocop', '~> 1.80.2', require: false + gem 'rubocop', '~> 1.81.1', require: false gem 'rubocop-minitest', require: false gem 'rubocop-rake', require: false gem 'simplecov', require: false