https://github.com/librariesio/semantic_range
:card_index: Parse and compare semantic version numbers and ranges
https://github.com/librariesio/semantic_range
Keywords from Contributors
activerecord activejob mvc rubygems background-jobs jobs sidekiq rack feature-flag
Last synced: about 21 hours ago
JSON representation
Repository metadata
:card_index: Parse and compare semantic version numbers and ranges
- Host: GitHub
- URL: https://github.com/librariesio/semantic_range
- Owner: librariesio
- License: mit
- Created: 2015-11-12T13:29:08.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2026-02-24T23:51:32.000Z (7 days ago)
- Last Synced: 2026-02-27T22:01:41.234Z (4 days ago)
- Language: Ruby
- Homepage: https://libraries.io/github/librariesio/semantic_range
- Size: 152 KB
- Stars: 24
- Watchers: 5
- Forks: 13
- Open Issues: 4
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Support: .github/SUPPORT.md
README.md
SemanticRange
node-semver written in Ruby for comparison and inclusion of semantic versions and ranges.
NOTE: current master and releases >= 3 use keyword arguments instead of positional arguments to pass options.
If you used SemanticRange.compare(a, b, true) in SemanticRange 2, in SemanticRange 3 use SemanticRange.compare(a, b, loose: true)
Installation
Add this line to your application's Gemfile:
gem 'semantic_range'
And then execute:
$ bundle
Or install it yourself as:
$ gem install semantic_range
Usage
SemanticRange.valid?('1.2.3') # true
SemanticRange.valid?('a.b.c') # false
SemanticRange.valid('1.2.3') # '1.2.3'
SemanticRange.valid('a.b.c') # nil
SemanticRange.clean(' =v1.2.3 ') # '1.2.3'
SemanticRange.filter(['0.9.0', '1.3.0', '1.5.0', '2.0.5'], '1.3.0 || <1.0.0 || >2.0.0') # ['0.9.0', '1.3.0', '2.0.5']
SemanticRange.satisfies?('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') # true
SemanticRange.gt?('1.2.3', '9.8.7') # false
SemanticRange.lt?('1.2.3', '9.8.7') # true
Options
All functions support optional keyword arguments that modify default behavior. The options supported are:
looseBe more forgiving about not-quite-valid semver strings. Any resulting output will always be 100% strict compliant.falseby default.
Some functions support platform option:
platformChanges behavior for'Rubygems'and'Packagist'.nilby default. See https://github.com/librariesio/semantic_range/issues/59
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/librariesio/semantic_range. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Owner metadata
- Name: Libraries.io
- Login: librariesio
- Email: support@libraries.io
- Kind: organization
- Description: Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.
- Website: https://libraries.io
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/11243589?v=4
- Repositories: 74
- Last ynced at: 2024-04-12T10:03:32.025Z
- Profile URL: https://github.com/librariesio
GitHub Events
Total
- Member event: 1
- Pull request event: 6
- Fork event: 2
- Watch event: 2
- Push event: 2
- Pull request review comment event: 3
- Pull request review event: 7
- Create event: 1
Last Year
- Pull request event: 2
- Watch event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 128
Total Committers: 13
Avg Commits per committer: 9.846
Development Distribution Score (DDS): 0.367
Commits in past year: 1
Committers in past year: 1
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Andrew Nesbitt | a****z@g****m | 81 |
| Kris Handley | h****s@g****m | 21 |
| Jeremy Katz | j****y@t****m | 5 |
| Tyrel Souza | t****a@g****m | 4 |
| Travis Collins | t****x@g****m | 3 |
| Roman Sokhan | p****k@g****m | 3 |
| Keith Barrette | e****b@g****m | 3 |
| Tieg Zaharia | t****a@g****m | 2 |
| Olle Jonsson | o****n@a****m | 2 |
| jsonperl | j****l@g****m | 1 |
| Zeke Sikelianos | z****e@s****m | 1 |
| Rodrigo Fernandes | r****o@g****m | 1 |
| Geremia Taglialatela | t****v@g****m | 1 |
Committer domains:
- sikelianos.com: 1
- auctionet.com: 1
- tidelift.com: 1
Issue and Pull Request metadata
Last synced: 7 days ago
Total issues: 42
Total pull requests: 42
Average time to close issues: 9 days
Average time to close pull requests: about 13 hours
Total issue authors: 3
Total pull request authors: 15
Average comments per issue: 0.67
Average comments per pull request: 1.14
Merged pull request: 37
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- andrew (38)
- rtfpessoa (3)
- rochefort (1)
Top Pull Request Authors
- krishandley (20)
- tyrelsouza (2)
- kbarrette (2)
- lhtest429 (2)
- tradiff (2)
- pustomytnyk (2)
- andrew (2)
- olleolleolle (2)
- tagliala (2)
- katzj (1)
- rtfpessoa (1)
- zeke (1)
- jsonperl (1)
- casperisfine (1)
- tiegz (1)
Top Issue Labels
- help wanted (37)
- enhancement (34)
- dependency (1)
- bug (1)
Top Pull Request Labels
Package metadata
- Total packages: 2
-
Total downloads:
- rubygems: 118,265,016 total
- Total docker downloads: 35,125,562
- Total dependent packages: 7 (may contain duplicates)
- Total dependent repositories: 33,210 (may contain duplicates)
- Total versions: 26
- Total maintainers: 3
gem.coop: semantic_range
node-semver rewritten in ruby, for comparison and inclusion of semantic versions and ranges
- Homepage: https://libraries.io/github/librariesio/semantic_range
- Documentation: http://www.rubydoc.info/gems/semantic_range/
- Licenses: MIT
- Latest release: 3.1.1 (published 7 days ago)
- Last Synced: 2026-03-01T11:02:34.314Z (2 days ago)
- Versions: 13
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 59,141,189 Total
- Docker Downloads: 17,562,781
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.155%
- Downloads: 0.464%
- Maintainers (3)
rubygems.org: semantic_range
node-semver rewritten in ruby, for comparison and inclusion of semantic versions and ranges
- Homepage: https://libraries.io/github/librariesio/semantic_range
- Documentation: http://www.rubydoc.info/gems/semantic_range/
- Licenses: MIT
- Latest release: 3.1.1 (published 7 days ago)
- Last Synced: 2026-02-27T20:00:52.630Z (4 days ago)
- Versions: 13
- Dependent Packages: 7
- Dependent Repositories: 33,210
- Downloads: 59,123,827 Total
- Docker Downloads: 17,562,781
-
Rankings:
- Dependent repos count: 0.185%
- Downloads: 0.487%
- Docker downloads count: 1.112%
- Dependent packages count: 2.484%
- Average: 3.757%
- Forks count: 7.159%
- Stargazers count: 11.117%
- Maintainers (1)
Dependencies
- guard-rspec >= 0
- rspec ~> 3.4 development
Score: 24.745870134049603