diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index bb41341..7d26064 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,13 +1,13 @@ # These are supported funding model platforms +buy_me_a_coffee: pboling +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry github: [pboling] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: galtzo # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username +issuehunt: pboling # Replace with a single IssueHunt username ko_fi: pboling # Replace with a single Ko-fi username -tidelift: rubygems/version_gem # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: pboling # Replace with a single Liberapay username -issuehunt: pboling # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +open_collective: # Replace with a single Open Collective username +patreon: galtzo # Replace with a single Patreon username +polar: pboling +thanks_dev: gh/pboling +tidelift: rubygems/version_gem # Replace with a single Tidelift platform-name/package-name e.g., npm/babel diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 68f6acb..91b6239 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -33,10 +33,6 @@ jobs: fail-fast: false matrix: experimental: [false] - rubygems: - - latest - bundler: - - latest ruby: - "2.7" @@ -84,7 +80,7 @@ jobs: hide_complexity: true indicators: true output: both - thresholds: '86 88' + thresholds: '100 100' continue-on-error: ${{ matrix.experimental != 'false' }} - name: Add Coverage PR Comment diff --git a/.github/workflows/heads.yml b/.github/workflows/heads.yml index 9aae8e2..3d594f3 100644 --- a/.github/workflows/heads.yml +++ b/.github/workflows/heads.yml @@ -28,10 +28,6 @@ jobs: fail-fast: false matrix: experimental: [true] - rubygems: - - latest - bundler: - - latest ruby: # rubocop supports JRuby, but I can't get it to work on jruby-head (and the problem might be in JRuby!) - "ruby-head" diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml index 4e2cd45..a9ed0bf 100644 --- a/.github/workflows/legacy.yml +++ b/.github/workflows/legacy.yml @@ -37,7 +37,6 @@ jobs: - "2.6" - "2.5" - "2.4" - - "2.3" runs-on: ubuntu-20.04 continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} steps: diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 5317639..98cf06f 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -22,7 +22,7 @@ jobs: matrix: experimental: [false] ruby: - - "2.2" + - "2.3" runs-on: ubuntu-20.04 steps: - name: Checkout diff --git a/.github/workflows/supported.yml b/.github/workflows/supported.yml index e5343c1..3505fcc 100644 --- a/.github/workflows/supported.yml +++ b/.github/workflows/supported.yml @@ -29,14 +29,11 @@ jobs: fail-fast: false matrix: experimental: [false] - rubygems: - - latest - bundler: - - latest ruby: - "2.7" - "3.0" - "3.1" + - "3.2" runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} diff --git a/.github/workflows/unsupported.yml b/.github/workflows/unsupported.yml index 56989f9..ff8965f 100644 --- a/.github/workflows/unsupported.yml +++ b/.github/workflows/unsupported.yml @@ -30,7 +30,7 @@ jobs: matrix: experimental: [false] ruby: - - "2.2" + - "2.3" runs-on: ubuntu-20.04 continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} diff --git a/.rubocop.yml b/.rubocop.yml index d7b8b52..75e5036 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,9 @@ inherit_from: .rubocop_todo.yml inherit_gem: rubocop-lts: rubocop-lts.yml +AllCops: + DisplayCopNames: true # Display the name of the failing cops + Metrics/BlockLength: ExcludedMethods: - context @@ -13,3 +16,18 @@ Metrics/BlockLength: - shared_examples_for - namespace - draw + +Lint/RaiseException: + Enabled: true + +Lint/StructNewOverride: + Enabled: true + +Style/HashEachMethods: + Enabled: true + +Style/HashTransformKeys: + Enabled: true + +Style/HashTransformValues: + Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b9c8271..dfb9367 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,16 +1,18 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-03-17 05:51:32 -0600 using RuboCop version 0.68.1. +# on 2023-03-17 06:34:13 -0600 using RuboCop version 0.81.0. # 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: IgnoredMethods. Metrics/AbcSize: Max: 17 # Offense count: 1 +# Configuration parameters: IgnoredMethods. Metrics/CyclomaticComplexity: Max: 8 @@ -20,11 +22,12 @@ Metrics/MethodLength: Max: 11 # Offense count: 1 +# Configuration parameters: IgnoredMethods. Metrics/PerceivedComplexity: Max: 8 # Offense count: 2 -# Configuration parameters: EnforcedStyle. +# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols. # SupportedStyles: inline, group Style/AccessModifierDeclarations: Exclude: @@ -38,9 +41,9 @@ Style/Documentation: - 'lib/version_gem.rb' - 'lib/version_gem/api.rb' -# Offense count: 32 +# Offense count: 31 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https -Metrics/LineLength: +Layout/LineLength: Max: 198 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cbe457..94fecfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Removed +## [1.1.3] - 2023-06-05 ([tag][1.1.3t]) +### Removed +- Formally drop Ruby 2.2 support + - Ruby 2.2 was already de facto minimum version supported, which is why this wasn't a 2.0 release. + ## [1.1.2] - 2023-03-17 ([tag][1.1.2t]) ### Added - `VersionGem::Ruby` to help library CI integration against many different versions of Ruby (@pboling) @@ -49,7 +54,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release, with basic version parsing API (@pboling) -[Unreleased]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.2...HEAD +[Unreleased]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.3...HEAD +[1.1.3]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.2...v1.1.3 +[1.1.3t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.3 [1.1.2]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.1...v1.1.2 [1.1.2t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.2 [1.1.1]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.0...v1.1.1 diff --git a/Gemfile.lock b/Gemfile.lock index e5dec12..9b589cd 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - version_gem (1.1.2) + version_gem (2.0.0) GEM remote: https://rubygems.org/ @@ -43,21 +43,22 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.0) - rubocop (0.68.1) + rubocop (0.81.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) - parser (>= 2.5, != 2.5.1.1) + parser (>= 2.7.0.1) rainbow (>= 2.2.2, < 4.0) + rexml ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.6) - rubocop-lts (8.0.2) - rubocop-ruby2_2 (~> 1.0.4) - rubocop-performance (1.3.0) - rubocop (>= 0.68.0) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-lts (10.0.1) + rubocop-ruby2_3 (~> 1.0.3) + rubocop-performance (1.6.1) + rubocop (>= 0.71.0) rubocop-rspec (1.41.0) rubocop (>= 0.68.1) - rubocop-ruby2_2 (1.0.4) - rubocop (= 0.68.1) + rubocop-ruby2_3 (1.0.3) + rubocop (= 0.81.0) ruby-progressbar (1.13.0) simplecov (0.21.2) docile (~> 1.1) @@ -72,7 +73,7 @@ GEM simplecov simplecov-lcov (0.8.0) simplecov_json_formatter (0.1.4) - unicode-display_width (1.5.0) + unicode-display_width (1.8.0) PLATFORMS arm64-darwin-22 @@ -88,7 +89,7 @@ DEPENDENCIES rake (~> 13.0) rspec (~> 3.0) rspec-block_is_expected - rubocop-lts (~> 8.0, >= 8.0.2) + rubocop-lts (~> 10.0, >= 10.0.1) rubocop-performance rubocop-rspec simplecov (~> 0.21) diff --git a/README.md b/README.md index 585d2fe..44854ba 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ MyLib::Version.to_h # => { major: 0, minor: 1, patch: 0, pre: "" } Your `version.rb` file now abides the Ruby convention of directory / path matching the namespace / class! -#### Query Ruby Version (as of version 1.2.0) +#### Query Ruby Version (as of version 1.1.2) In Continuous Integration environments for libraries that run against many versions of Ruby, I often need to configure things discretely per Ruby version, and doing so forced me to repeat diff --git a/checksums/version_gem-2.0.0.gem.sha256 b/checksums/version_gem-2.0.0.gem.sha256 new file mode 100644 index 0000000..de23bee --- /dev/null +++ b/checksums/version_gem-2.0.0.gem.sha256 @@ -0,0 +1 @@ +d1a07c446c351fe776e003a0ea88b8b365bbdc617ce6cc359c45f388ad03f3d4 \ No newline at end of file diff --git a/checksums/version_gem-2.0.0.gem.sha512 b/checksums/version_gem-2.0.0.gem.sha512 new file mode 100644 index 0000000..8afd68e --- /dev/null +++ b/checksums/version_gem-2.0.0.gem.sha512 @@ -0,0 +1 @@ +71a5dc9786c0f04d7c1820effac31acb0f4bacb3ed5ab347f1e18c5fd012fabe9336428d6b646ee4e6737d1f79e2437b891c7d2e6e25e0d4a47bb2b90f309d4d \ No newline at end of file diff --git a/lib/version_gem/api.rb b/lib/version_gem/api.rb index e228c93..80516a3 100644 --- a/lib/version_gem/api.rb +++ b/lib/version_gem/api.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module VersionGem module Api # The version number as a string diff --git a/lib/version_gem/error.rb b/lib/version_gem/error.rb index 4bdf60e..ad478b4 100644 --- a/lib/version_gem/error.rb +++ b/lib/version_gem/error.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module VersionGem class Error < RuntimeError; end end diff --git a/lib/version_gem/ruby.rb b/lib/version_gem/ruby.rb index f0a67f5..0672447 100644 --- a/lib/version_gem/ruby.rb +++ b/lib/version_gem/ruby.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module VersionGem # Helpers for library CI integration against many different versions of Ruby module Ruby diff --git a/lib/version_gem/version.rb b/lib/version_gem/version.rb index cbd55ea..31a9cbd 100644 --- a/lib/version_gem/version.rb +++ b/lib/version_gem/version.rb @@ -2,7 +2,7 @@ module VersionGem module Version - VERSION = '1.1.2'.freeze + VERSION = '2.0.0' # This would work in this gem, but not in external libraries, # because version files are loaded in Gemspecs before bundler # has a chance to load dependencies. diff --git a/spec/version_gem/api_spec.rb b/spec/version_gem/api_spec.rb index 8163288..b34e134 100644 --- a/spec/version_gem/api_spec.rb +++ b/spec/version_gem/api_spec.rb @@ -2,7 +2,7 @@ # If your version file will be required by a gemspec, do not do this, instead follow README.md#usage module UnderTest - VERSION = '12.34.56.pre-78'.freeze + VERSION = '12.34.56.pre-78' extend VersionGem::Api end diff --git a/spec/version_gem/error_spec.rb b/spec/version_gem/error_spec.rb index 07d0c4c..32f6c4f 100644 --- a/spec/version_gem/error_spec.rb +++ b/spec/version_gem/error_spec.rb @@ -5,7 +5,11 @@ expect(described_class).is_a?(StandardError) end - it 'can be raised' do - expect { raise(described_class, 'moo') }.to raise_error(described_class, 'moo') + describe 'raise' do + subject(:raising) { raise(described_class, 'moo') } + + it 'can be raised' do + block_is_expected.to raise_error(described_class, 'moo') + end end end diff --git a/version_gem.gemspec b/version_gem.gemspec index aa662ac..71b3e00 100644 --- a/version_gem.gemspec +++ b/version_gem.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.description = 'Versions are good. Versions are cool. Versions will win.' spec.homepage = 'https://gitlab.com/oauth-xx/version_gem' spec.license = 'MIT' - spec.required_ruby_version = '>= 2.2' + spec.required_ruby_version = '>= 2.3' spec.metadata['homepage_uri'] = spec.homepage spec.metadata['source_code_uri'] = "#{spec.homepage}/-/tree/v#{spec.version}" @@ -52,10 +52,10 @@ Gem::Specification.new do |spec| # Debugger spec.add_development_dependency 'pry' - # Linting - rubocop-lts v8 is a rubocop wrapper for Ruby >= 2.2, + # Linting - rubocop-lts v10 is a rubocop wrapper for Ruby >= 2.3, # and should only be bumped when dropping old Ruby support # see: https://dev.to/pboling/rubocop-lts-1e31 - spec.add_development_dependency 'rubocop-lts', ['~> 8.0', '>= 8.0.2'] + spec.add_development_dependency 'rubocop-lts', ['~> 10.0', '>= 10.0.1'] # Lint RSpec code spec.add_development_dependency 'rubocop-rspec'