https://github.com/solnic/coercible
Powerful, flexible and configurable coercion library. And nothing more.
https://github.com/solnic/coercible
Keywords from Contributors
data-validation dry-rb rubygem
Last synced: about 6 hours ago
JSON representation
Repository metadata
Powerful, flexible and configurable coercion library. And nothing more.
- Host: GitHub
- URL: https://github.com/solnic/coercible
- Owner: solnic
- License: mit
- Created: 2012-12-22T09:18:46.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2017-09-01T21:14:40.000Z (over 8 years ago)
- Last Synced: 2026-02-07T17:17:34.857Z (24 days ago)
- Language: Ruby
- Homepage:
- Size: 385 KB
- Stars: 137
- Watchers: 7
- Forks: 14
- Open Issues: 12
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE.txt
README.md
Coercible
Installation
Add this line to your application's Gemfile:
gem 'coercible'
And then execute:
$ bundle
Or install it yourself as:
$ gem install coercible
Usage
Coercible gives you access to coercer objects where each object is responsible
for coercing only one type into other types. For example a string coercer knows
only how to coerce string objects, integer coercer knows only how to coerce integers
etc.
Here's the most basic example:
coercer = Coercible::Coercer.new
# coerce a string to a date
coercer[String].to_date('2012/12/25') # => #<Date: 4912573/2,0,2299161>
# coerce a string to a boolean value
coercer[String].to_boolean('yes') # => true
# you got the idea :)
For more control you can configure your coercer like that:
# build coercer instance
coercer = Coercible::Coercer.new do |config|
config.string.boolean_map = { 'yup' => true, 'nope' => false }
end
# coerce a string to boolean
coercer[String].to_boolean('yup') # => true
coercer[String].to_boolean('nope') # => false
Note that at the moment only Integer and String are configurable. More configurable
coercers will be added later whenever we find good usecases.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Owner metadata
- Name: Peter Solnica
- Login: solnic
- Email:
- Kind: user
- Description: @hanami • @dry-rb • @rom-rb
- Website: https://solnic.dev
- Location:
- Twitter: solnic_dev
- Company: @valued-app
- Icon url: https://avatars.githubusercontent.com/u/1066?v=4
- Repositories: 63
- Last ynced at: 2024-05-01T10:48:39.843Z
- Profile URL: https://github.com/solnic
GitHub Events
Total
- Pull request event: 1
Last Year
- Pull request event: 1
Committers metadata
Last synced: 3 days ago
Total Commits: 84
Total Committers: 5
Avg Commits per committer: 16.8
Development Distribution Score (DDS): 0.071
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Piotr Solnica | p****a@g****m | 78 |
| Markus Schirp | m****j@s****m | 3 |
| Ken Dreyer | k****r@k****m | 1 |
| DawidJanczak | d****k@g****m | 1 |
| Handi Wiguna | h****i@d****m | 1 |
Committer domains:
- domikado.com: 1
- ktdreyer.com: 1
- schirp-dso.com: 1
Issue and Pull Request metadata
Last synced: 27 days ago
Total issues: 13
Total pull requests: 14
Average time to close issues: over 1 year
Average time to close pull requests: over 1 year
Total issue authors: 12
Total pull request authors: 13
Average comments per issue: 1.85
Average comments per pull request: 2.79
Merged pull request: 4
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
- boutil (2)
- fredwu (1)
- dspaeth-faber (1)
- guyboertje (1)
- lovehandle (1)
- schmurfy (1)
- maksar (1)
- buszu (1)
- eval (1)
- reidmorrison (1)
- Epigene (1)
- kurbaitis (1)
Top Pull Request Authors
- kml (2)
- mbj (2)
- handiwiguna (1)
- EdwardBetts (1)
- ktdreyer (1)
- rrrene (1)
- p-lambert (1)
- danielbecker (1)
- tb0yd (1)
- ivoanjo (1)
- jstepien (1)
- DawidJanczak (1)
- snusnu (1)
Top Issue Labels
- feature (1)
Top Pull Request Labels
Package metadata
- Total packages: 13
-
Total downloads:
- rubygems: 252,621,563 total
- Total docker downloads: 1,106,278,378
- Total dependent packages: 15 (may contain duplicates)
- Total dependent repositories: 9,550 (may contain duplicates)
- Total versions: 25
- Total maintainers: 1
gem.coop: coercible
Powerful, flexible and configurable coercion library. And nothing more.
- Homepage: https://github.com/solnic/coercible
- Documentation: http://www.rubydoc.info/gems/coercible/
- Licenses: MIT
- Latest release: 1.0.0 (published about 12 years ago)
- Last Synced: 2026-03-02T20:31:05.506Z (1 day ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 126,343,736 Total
- Docker Downloads: 553,139,189
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.092%
- Docker downloads count: 0.178%
- Downloads: 0.191%
- Maintainers (1)
ubuntu-22.04: ruby-coercible
- Homepage: https://github.com/solnic/coercible
- Licenses: mit
- Latest release: 1.0.0-2.1 (published 19 days ago)
- Last Synced: 2026-02-13T13:14:31.265Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.74%
- Stargazers count: 1.304%
- Forks count: 1.657%
rubygems.org: coercible
Powerful, flexible and configurable coercion library. And nothing more.
- Homepage: https://github.com/solnic/coercible
- Documentation: http://www.rubydoc.info/gems/coercible/
- Licenses: MIT
- Latest release: 1.0.0 (published about 12 years ago)
- Last Synced: 2026-03-01T20:01:55.581Z (2 days ago)
- Versions: 5
- Dependent Packages: 15
- Dependent Repositories: 9,550
- Downloads: 126,277,827 Total
- Docker Downloads: 553,139,189
-
Rankings:
- Downloads: 0.191%
- Docker downloads count: 0.209%
- Dependent repos count: 0.338%
- Dependent packages count: 1.292%
- Average: 2.279%
- Stargazers count: 4.711%
- Forks count: 6.933%
- Maintainers (1)
proxy.golang.org: github.com/solnic/coercible
- Homepage:
- Documentation: https://pkg.go.dev/github.com/solnic/coercible#section-documentation
- Licenses: mit
- Latest release: v1.0.0 (published about 12 years ago)
- Last Synced: 2026-03-01T20:01:55.877Z (2 days ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 4.127%
- Forks count: 5.421%
- Average: 7.472%
- Dependent packages count: 9.56%
- Dependent repos count: 10.779%
ubuntu-23.10: ruby-coercible
- Homepage: https://github.com/solnic/coercible
- Licenses:
- Latest release: 1.0.0-2.1 (published 18 days ago)
- Last Synced: 2026-02-13T18:16:42.626Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: ruby-coercible
- Homepage: https://github.com/solnic/coercible
- Documentation: https://packages.debian.org/trixie/ruby-coercible
- Licenses:
- Latest release: 1.0.0-2.1 (published 20 days ago)
- Last Synced: 2026-02-13T13:14:16.993Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-coercible
- Homepage: https://github.com/solnic/coercible
- Licenses:
- Latest release: 1.0.0-2.1 (published 21 days ago)
- Last Synced: 2026-02-11T06:37:02.398Z (21 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-coercible
- Homepage: https://github.com/solnic/coercible
- Documentation: https://packages.debian.org/bullseye/ruby-coercible
- Licenses:
- Latest release: 1.0.0-2.1 (published 21 days ago)
- Last Synced: 2026-02-13T08:19:08.543Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-10: ruby-coercible
- Homepage: https://github.com/solnic/coercible
- Documentation: https://packages.debian.org/buster/ruby-coercible
- Licenses:
- Latest release: 1.0.0-2 (published 21 days ago)
- Last Synced: 2026-02-13T04:19:55.613Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-coercible
- Homepage: https://github.com/solnic/coercible
- Documentation: https://packages.debian.org/bookworm/ruby-coercible
- Licenses:
- Latest release: 1.0.0-2.1 (published 19 days ago)
- Last Synced: 2026-02-12T23:27:21.297Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- codeclimate-test-reporter >= 0 development
- mutant >= 0
- mutant-rspec >= 0
- rake ~> 10.0 development
- rspec ~> 3.1.0 development
- rspec-its ~> 1.0 development
- descendants_tracker ~> 0.0.1
Score: 27.643332878509778
