From 6381057554c4fc6e01828daab4451b16ecfdea8c Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Sun, 23 Feb 2025 05:59:57 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Skip=20install=5Ftasks=20test=20?= =?UTF-8?q?on=20Ruby=202.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Appraisals | 4 ++++ Gemfile.lock | 7 +++++++ README.md | 13 +++++++++++++ gem_checksums.gemspec | 1 + spec/config/rspec/rspec_pending_for.rb | 1 + spec/gem_checksums_spec.rb | 3 ++- spec/spec_helper.rb | 1 + 7 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 spec/config/rspec/rspec_pending_for.rb diff --git a/Appraisals b/Appraisals index 2bdb619..7f405cf 100644 --- a/Appraisals +++ b/Appraisals @@ -1,5 +1,9 @@ # frozen_string_literal: true +# HOW TO UPDATE APPRAISALS: +# BUNDLE_GEMFILE=Appraisal.root.gemfile bundle +# BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update + # Used for head (nightly) releases of ruby, truffleruby, and jruby. # Split into discrete appraisals if one of them needs a dependency locked discretely. appraise "head" do diff --git a/Gemfile.lock b/Gemfile.lock index 6128b6c..e9cb12b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -126,6 +126,10 @@ GEM rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) + rspec-pending_for (0.1.16) + rspec-core + ruby_engine (>= 1, < 3) + ruby_version (~> 1.0) rspec-stubbed_env (1.0.1) rspec-support (3.13.2) rubocop (1.71.2) @@ -174,6 +178,8 @@ GEM rubocop-thread_safety (0.6.0) rubocop (>= 1.48.1) ruby-progressbar (1.13.0) + ruby_engine (2.0.3) + ruby_version (1.0.3) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -243,6 +249,7 @@ DEPENDENCIES reek (~> 6.4) rspec (~> 3.13) rspec-block_is_expected (~> 1.0) + rspec-pending_for (~> 0.1, >= 0.1.16) rspec-stubbed_env (~> 1.0, >= 1.0.1) rubocop-lts (~> 8.1, >= 8.1.1) rubocop-packaging (~> 0.5, >= 0.5.2) diff --git a/README.md b/README.md index eabe043..5152ed2 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,11 @@ It is different from, and improves on, the standard rake task in that it: - does various checks to ensure the generated checksums will be valid - does `git commit` the generated checksums +The script accomplishes the same thing if you prefer that: +```shell +gem_checksums +``` + ## Installation Install the gem and add to the gem's Gemfile by executing: @@ -49,6 +54,14 @@ rake build:checksums Generating checksums makes sense when you are building and releasing a gem, so how does it fit into that process? +### Note for Ruby 2.2 + +The rake task is not supported on Ruby 2.2, so call the script instead like: + +```shell +gem_checksums +``` + ### How To: Release gem with checksums generated by `gem_checksums` NOTE: This is an example process which assumes your project has bundler binstubs, and a version.rb file, diff --git a/gem_checksums.gemspec b/gem_checksums.gemspec index 0553da1..f68574b 100644 --- a/gem_checksums.gemspec +++ b/gem_checksums.gemspec @@ -72,6 +72,7 @@ Gem::Specification.new do |spec| # Tests spec.add_development_dependency("rspec", "~> 3.13") # ruby >= 0 spec.add_development_dependency("rspec-block_is_expected", "~> 1.0") # ruby >= 1.8.7 + spec.add_development_dependency("rspec-pending_for", "~> 0.1", ">= 0.1.16") # ruby >= 1.8.7 spec.add_development_dependency("rspec-stubbed_env", "~> 1.0", ">= 1.0.1") # Ruby >= 1.8.7 # Development Tasks diff --git a/spec/config/rspec/rspec_pending_for.rb b/spec/config/rspec/rspec_pending_for.rb new file mode 100644 index 0000000..6ef63e7 --- /dev/null +++ b/spec/config/rspec/rspec_pending_for.rb @@ -0,0 +1 @@ +require "rspec/pending_for" diff --git a/spec/gem_checksums_spec.rb b/spec/gem_checksums_spec.rb index 4e4400c..7e30200 100644 --- a/spec/gem_checksums_spec.rb +++ b/spec/gem_checksums_spec.rb @@ -36,7 +36,8 @@ describe "::install_tasks" do subject(:install_tasks) { described_class.install_tasks } - it "loads vc_ruby/tasks.rb" do + it "loads gem_checksums/tasks.rb" do + skip_for(engine: "ruby", versions: "2.2.10", reason: "Minimum Ruby for install_tasks is v2.3 ") # The order is important, spec will fail if wrong order block_is_expected.to not_raise_error & change { Rake.application.options.rakelib } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fa9643b..27b635b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,6 +6,7 @@ # RSpec Configs require_relative "config/byebug" require_relative "config/rspec/rspec_block_is_expected" +require_relative "config/rspec/rspec_pending_for" require_relative "config/rspec/rspec_stubbed_env" require_relative "config/rspec/rspec_core" require_relative "config/rspec/version_gem"