Skip to content

Commit

Permalink
[gemspec] Enforce only major and minor parts of required Ruby version (
Browse files Browse the repository at this point in the history
…#622)

For example, if the `.ruby-version` file has `3.3.3`, then the required
Ruby version will be `>= 3.3.0`.

My motivation for making this change is that it seems that this gem
requiring Ruby 3.3.3 is causing a problem for dependabot updates:
https://github.com/davidrunger/dotfiles/network/updates/848692807

```
Bundler::SolveFailure with message: Could not find compatible versions

Because Ruby >= 3.3.3 could not be found in the local ruby installation
  and fcom >= 0.7.0 depends on Ruby >= 3.3.3,
  fcom >= 0.7.0 cannot be used.
So, because Gemfile depends on fcom >= 0.7.0, <= 0.8.0,
  version solving has failed.
```

I think dependabot might currently use Ruby 3.3.1, so hopefully relaxing
from `>= 3.3.3` to `>= 3.3.0` will fix that issue.
  • Loading branch information
davidrunger authored Jun 28, 2024
1 parent 4880619 commit 0d0f2a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased
[no unreleased changes yet]
- Enforce only major and minor parts of required Ruby version (loosening the
required Ruby version from 3.3.3 to 3.3.0)

## v0.9.0 (2024-06-28)
- Print first 8 characters of commit SHA (not 7)
Expand Down
3 changes: 2 additions & 1 deletion fcom.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ Gem::Specification.new do |spec|
spec.add_dependency('rainbow', '>= 3.0', '< 4')
spec.add_dependency('slop', '~> 4.8')

spec.required_ruby_version = ">= #{File.read('.ruby-version').rstrip}"
required_ruby_version = File.read('.ruby-version').rstrip.sub(/\A(\d+\.\d+)\.\d+\z/, '\1.0')
spec.required_ruby_version = ">= #{required_ruby_version}"
end

0 comments on commit 0d0f2a5

Please sign in to comment.