Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates from main #3

Open
wants to merge 8 commits into
base: 1.1-stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 1 addition & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ jobs:
fail-fast: false
matrix:
experimental: [false]
rubygems:
- latest
bundler:
- latest
ruby:
- "2.7"

Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/heads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
experimental: [false]
ruby:
- "2.2"
- "2.3"
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/supported.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unsupported.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
18 changes: 18 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
11 changes: 7 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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:
Expand All @@ -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
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
25 changes: 13 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
version_gem (1.1.2)
version_gem (2.0.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions checksums/version_gem-2.0.0.gem.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d1a07c446c351fe776e003a0ea88b8b365bbdc617ce6cc359c45f388ad03f3d4
1 change: 1 addition & 0 deletions checksums/version_gem-2.0.0.gem.sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
71a5dc9786c0f04d7c1820effac31acb0f4bacb3ed5ab347f1e18c5fd012fabe9336428d6b646ee4e6737d1f79e2437b891c7d2e6e25e0d4a47bb2b90f309d4d
2 changes: 2 additions & 0 deletions lib/version_gem/api.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module VersionGem
module Api
# The version number as a string
Expand Down
2 changes: 2 additions & 0 deletions lib/version_gem/error.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module VersionGem
class Error < RuntimeError; end
end
2 changes: 2 additions & 0 deletions lib/version_gem/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module VersionGem
# Helpers for library CI integration against many different versions of Ruby
module Ruby
Expand Down
2 changes: 1 addition & 1 deletion lib/version_gem/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion spec/version_gem/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions spec/version_gem/error_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions version_gem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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'
Expand Down
Loading