diff --git a/.rubocop_gradual.lock b/.rubocop_gradual.lock new file mode 100644 index 0000000..de19132 --- /dev/null +++ b/.rubocop_gradual.lock @@ -0,0 +1,18 @@ +{ + "bin/checksums:2906467651": [ + [12, 28, 2, "Lint/Syntax: unexpected token error\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 5858765], + [14, 18, 2, "Lint/Syntax: unexpected token error\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 5858765], + [20, 1, 4, "Lint/Syntax: unexpected token kELSE\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 2087423834], + [33, 1, 3, "Lint/Syntax: unexpected token kEND\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 193405706], + [45, 11, 2, "Lint/Syntax: unexpected token tLSHFT\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 5859461], + [46, 21, 1, "Lint/Syntax: unexpected token tSTAR\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 177551], + [47, 14, 1, "Lint/Syntax: `-' interpreted as argument prefix\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 177544], + [47, 17, 1, "Lint/Syntax: unexpected token tSTRING_BEG\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 177543], + [53, 9, 3, "Lint/Syntax: unexpected token tCONSTANT\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 193466585], + [54, 14, 3, "Lint/Syntax: unexpected token tCONSTANT\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 193467647], + [54, 21, 1, "Lint/Syntax: unexpected token tCOLON\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 177567], + [55, 21, 1, "Lint/Syntax: unexpected token tCOLON\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 177567], + [56, 22, 4, "Lint/Syntax: unexpected token tCONSTANT\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 2089414472], + [57, 22, 4, "Lint/Syntax: unexpected token tCONSTANT\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 2089414472] + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index df2422a..bb34f75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.1.4] 2024-03-21 ([tag][1.1.4t]) ### Added - Ruby 3.3 to CI (@pboling) -- Improved test coverage (via `kettle-soup-cover` 🎉) (@pboling) ### Fixed - Remove the executable bit from non-executable files (@Fryguy) diff --git a/bin/rake b/bin/rake index 02376ad..4eb7d7b 100755 --- a/bin/rake +++ b/bin/rake @@ -13,7 +13,7 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) bundle_binstub = File.expand_path("bundle", __dir__) if File.file?(bundle_binstub) - if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300)) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") load(bundle_binstub) else abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. diff --git a/bin/rspec b/bin/rspec index 352e15e..cb53ebe 100755 --- a/bin/rspec +++ b/bin/rspec @@ -13,7 +13,7 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) bundle_binstub = File.expand_path("bundle", __dir__) if File.file?(bundle_binstub) - if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300)) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") load(bundle_binstub) else abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. diff --git a/spec/config/debug.rb b/spec/config/debug.rb deleted file mode 100644 index 2c875e1..0000000 --- a/spec/config/debug.rb +++ /dev/null @@ -1,15 +0,0 @@ -if DEBUGGING - if DEBUG_IDE - # See: https://github.com/ruby-debug/ruby-debug-ide#start-debugging-session - # TODO: Figure out how to make this work? Or perhaps the pry integration is sufficient? - else - require "pry-suite" - end -elsif DEBUG_JRUBY - if DEBUG_IDE - # See: https://github.com/ruby-debug/ruby-debug-ide#start-debugging-session - # TODO: Figure out how to make this work? Or perhaps the pry integration is sufficient? - else - require "pry-debugger-jruby" - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8bae8c3..5d08d8f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,13 @@ # frozen_string_literal: true +begin + # This does not require "simplecov", + # because that has a side-effect of running `.simplecov` + require "kettle-soup-cover" +rescue LoadError + puts "Not running code coverage" +end + DEBUG = ENV.fetch("DEBUG", nil) == "true" DEBUG_IDE = ENV.fetch("DEBUG_IDE", "false") == "true" @@ -28,31 +36,15 @@ def actual_minor_version?(major, minor, engine = "ruby") # RSpec Helpers from this gem require "version_gem/rspec" -engine = "ruby" -major = 2 -minor = 7 -version = "#{major}.#{minor}" -gte_min = VersionGem::Faux.gte_minimum_version?(version, engine) -actual_minor = VersionGem::Faux.actual_minor_version?(major, minor, engine) - -DEBUGGING = gte_min && DEBUG -DEBUG_JRUBY = VersionGem::Faux.gte_minimum_version?(version, "jruby") -RUN_COVERAGE = gte_min && (ENV.fetch("COVER_ALL", nil) || ENV.fetch("CI_CODECOV", nil) || ENV["CI"].nil?) -ALL_FORMATTERS = (gte_min && ENV.fetch("COVER_ALL", nil)) || - (actual_minor && (ENV.fetch("CI_CODECOV", nil) || ENV.fetch("CI", nil))) - # RSpec Configs require "config/rspec/rspec_core" require "config/rspec/rspec_block_is_expected" -require "config/debug" -# Load Code Coverage as the last thing before this gem -if RUN_COVERAGE - require "simplecov" # Config file `.simplecov` is run immediately when simplecov loads -end +# RSpec Helpers +require "helpers/under_test" + +# Last thing before this gem is code coverage: +require "simplecov" if defined?(Kettle) && Kettle::Soup::Cover::DO_COV # This gem require "version_gem" - -# RSpec Helpers -require "helpers/under_test"