From b81339ab22a4f0d30b4f67d5057ab7bc355c3701 Mon Sep 17 00:00:00 2001 From: Kirill Mokevnin Date: Wed, 12 Aug 2026 12:42:00 -0400 Subject: [PATCH] =?UTF-8?q?chore(deps):=20=D0=BF=D0=BE=D0=B4=D0=BD=D1=8F?= =?UTF-8?q?=D1=82=D1=8C=20ruby=20=D0=B4=D0=BE=204=20=D0=B8=20=D0=BE=D0=B1?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B8=D1=82=D1=8C=20rspec=20=D1=81=20rubocop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI собирал практику на ruby 2.7.2 при каноне кита 4.0.6, а Gemfile держал rubocop 1.12 и rspec 3.10 из 2021 года. Версия ruby теперь берётся из .ruby-version, то есть у CI и у разработчика один источник. Плагин rubocop-rspec подключён явно: без записи в plugins линтер его грузил как расширение и печатал предупреждение о миграции. Три его копа отключены, потому что described_class и be_pair прячут ровно тот API, который спека показывает читателю. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 6 +-- .rubocop.yml | 13 ++++++ .ruby-version | 1 + Gemfile | 6 +-- Gemfile.lock | 85 +++++++++++++++++++++++----------------- hexlet-pairs.gemspec | 2 +- spec/pairs_spec.rb | 6 +-- 7 files changed, 73 insertions(+), 46 deletions(-) create mode 100644 .ruby-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58f855f..0a0ff91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,13 +7,13 @@ on: jobs: build: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7.2 - - name: Install - run: make install + ruby-version: .ruby-version + bundler-cache: true - name: Run linter run: make lint - name: Run tests diff --git a/.rubocop.yml b/.rubocop.yml index 08f0f14..fc86556 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,6 @@ +plugins: + - rubocop-rspec + AllCops: Exclude: - "vendor/**/*" @@ -10,3 +13,13 @@ Style/Documentation: Enabled: false Metrics/BlockLength: Enabled: false + +# Спека читается как документация к библиотеке, поэтому имя класса и предикат +# пишутся явно: described_class и be_pair прячут ровно тот API, который она +# показывает. +RSpec/DescribedClass: + Enabled: false +RSpec/PredicateMatcher: + Enabled: false +RSpec/MultipleExpectations: + Enabled: false diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..d13e837 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +4.0.6 diff --git a/Gemfile b/Gemfile index 42d3013..da980c8 100644 --- a/Gemfile +++ b/Gemfile @@ -2,8 +2,8 @@ source 'https://rubygems.org' gemspec -gem 'rspec', '~> 3.10' +gem 'rspec', '~> 3.13' -gem 'rubocop', '~> 1.12.1' +gem 'rubocop', '~> 1.89' -gem 'rubocop-rspec', '~> 2.2.0' +gem 'rubocop-rspec', '~> 3.10' diff --git a/Gemfile.lock b/Gemfile.lock index 11a7666..17f6e77 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,52 +6,65 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) - diff-lcs (1.4.4) - parallel (1.20.1) - parser (3.0.1.0) + ast (2.4.3) + diff-lcs (1.6.2) + json (2.21.2) + language_server-protocol (3.17.0.6) + lint_roller (1.1.0) + parallel (2.1.0) + parser (3.3.12.0) ast (~> 2.4.1) - rainbow (3.0.0) - regexp_parser (2.1.1) - rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + racc + prism (1.9.0) + racc (1.8.1) + rainbow (3.1.1) + regexp_parser (2.12.0) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.2) - rubocop (1.12.1) - parallel (~> 1.10) - parser (>= 3.0.0.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + rubocop (1.89.0) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (>= 1.10) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.2.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.4.1) - parser (>= 2.7.1.5) - rubocop-rspec (2.2.0) - rubocop (~> 1.0) - rubocop-ast (>= 1.1.0) - ruby-progressbar (1.11.0) - unicode-display_width (2.0.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.50.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-rspec (3.10.2) + lint_roller (~> 1.1) + regexp_parser (>= 2.0) + rubocop (~> 1.86, >= 1.86.2) + ruby-progressbar (1.13.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) PLATFORMS + aarch64-linux ruby + x86_64-linux DEPENDENCIES hexlet-pairs! - rspec (~> 3.10) - rubocop (~> 1.12.1) - rubocop-rspec (~> 2.2.0) + rspec (~> 3.13) + rubocop (~> 1.89) + rubocop-rspec (~> 3.10) BUNDLED WITH - 2.2.15 + 4.0.16 diff --git a/hexlet-pairs.gemspec b/hexlet-pairs.gemspec index 2e022aa..6e406e3 100644 --- a/hexlet-pairs.gemspec +++ b/hexlet-pairs.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.description = "A SICP'ish Functional Pairs implemented in Ruby." spec.homepage = "https://github.com/hexlet-components/ruby-pairs" spec.license = "MIT" - spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0") + spec.required_ruby_version = Gem::Requirement.new(">= 4.0") spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = "https://github.com/hexlet-components/ruby-pairs" diff --git a/spec/pairs_spec.rb b/spec/pairs_spec.rb index 914386a..d4c6193 100644 --- a/spec/pairs_spec.rb +++ b/spec/pairs_spec.rb @@ -30,8 +30,8 @@ end it 'check_pair' do - expect(-> { Pairs.car(345) }).to raise_error(NoMethodError) - expect(-> { Pairs.cdr('asdf') }).to raise_error(NoMethodError) - expect(-> { Pairs.car({ key: 'value' }) }).to raise_error(NoMethodError) + expect { Pairs.car(345) }.to raise_error(NoMethodError) + expect { Pairs.cdr('asdf') }.to raise_error(NoMethodError) + expect { Pairs.car({ key: 'value' }) }.to raise_error(NoMethodError) end end