https://github.com/janlelis/sugar_refinery
Tiny refinements for Ruby
https://github.com/janlelis/sugar_refinery
refinements ruby support-library zucker
Last synced: 6 months ago
JSON representation
Tiny refinements for Ruby
- Host: GitHub
- URL: https://github.com/janlelis/sugar_refinery
- Owner: janlelis
- License: mit
- Created: 2010-08-05T17:11:44.000Z (over 15 years ago)
- Default Branch: main
- Last Pushed: 2021-10-21T19:35:04.000Z (over 4 years ago)
- Last Synced: 2025-08-20T06:48:18.605Z (6 months ago)
- Topics: refinements, ruby, support-library, zucker
- Language: Ruby
- Homepage: https://janlelis.github.io/sugar_refinery
- Size: 602 KB
- Stars: 110
- Watchers: 8
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Ruby Sugar Refinery [](https://badge.fury.io/rb/sugar_refinery) [![[ci]](https://github.com/janlelis/sugar_refinery/workflows/Test/badge.svg)](https://github.com/janlelis/sugar_refinery/actions?query=workflow%3ATest)
The Ruby Sugar Refinery is a collection of tiny [refinements](https://ruby-doc.org/core/doc/syntax/refinements_rdoc.html) (declarative local core extensions) for Ruby.
## Setup & usage
Add to Gemfile:
```ruby
gem 'sugar_refinery', require: 'sugar_refinery/all'
```
Then add refinements to the current Ruby file or module:
```ruby
using SugarRefinery::CamelSnake
using SugarRefinery::HashZip
"ClassName".to_snake # => "class_name"
Hash.zip [1,2,3], [4,5,6] # => {1=>4, 2=>5, 3=>6}
```
## List of included refinements
Please see [the documentation](http://janlelis.github.io/sugar_refinery), [the code](https://github.com/janlelis/sugar_refinery/tree/master/lib/sugar_refinery) or [the specs](https://github.com/janlelis/sugar_refinery/tree/master/spec)!
## The Sugar Refinery was Zucker before
This collection of core extensions used to be called **zucker**.
Missing former functionality? It might have been extracted into a separate micro gem:
* [iterate](https://github.com/janlelis/iterate) | Control structure-like iteration
* [instance_variables_from](https://github.com/janlelis/instance_variables_from) | Auto-assign instance variables
* [egonil](https://github.com/janlelis/egonil) | Egocentric nil
* [debugging](https://github.com/janlelis/debugging) | Print debugging helpers
* [procstar](https://github.com/janlelis/procstar) | Beyond symbol2proc
* [ruby_info](https://github.com/janlelis/ruby_info) | Misc information about the Ruby environment
* [ruby_version](https://github.com/janlelis/ruby_version) | Smart Ruby version accessor
* [ruby_engine](https://github.com/janlelis/ruby_engine) | Smar Ruby engine accessor
## J-_-L
Copyright (c) 2010-2016 [Jan Lelis](https://janlelis.com), released under the MIT license