Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roberts1000/corelib_ruby
Useful extensions to ruby core
https://github.com/roberts1000/corelib_ruby
Last synced: about 1 month ago
JSON representation
Useful extensions to ruby core
- Host: GitHub
- URL: https://github.com/roberts1000/corelib_ruby
- Owner: roberts1000
- Created: 2015-10-09T19:01:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-19T05:24:07.000Z (almost 6 years ago)
- Last Synced: 2024-11-28T14:14:20.577Z (about 2 months ago)
- Language: Ruby
- Size: 43.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# corelib_ruby
Many languages provide a vast library of methods or functions for developers to use, whereas Ruby only provides basic (albeit powerful) building blocks. At best, this leads to more complex applications and time wasted writing code another developer has probably already written; at worst it results in core class extensions being placed in helper methods or on objects that have no business owning the methods. The lack of a good strategy for managing Ruby extentions really becomes apparent when a developer needs to share his extensions across multiple projects.
Corelib aims to solve this problem by providing a central gem for developers to share extensions & additions to the Ruby core. Corelib focuses on:
1. Reducing Code Duplication
2. Improving Code Readability
3. Sharing Developer Knowledge
4. Reducing Errors
5. Saving Developers Time
6. Improving Code Quality & PerformanceWe invite all like minded developers to join us in growing the corelib library of extensions.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'corelib_ruby'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install corelib_ruby
## Usage
Browse the `/lib/corelib_ruby/` directory to find new methods; each method provides extensive document. All of these methods are now available inside your application without any additional configuration.
## Finding Methods
To find methods, read through the `lib/corelib_ruby/core_ext` folder.
## Conventions
All methods are prefixed with `cl_` to help prevent collisions with other libraries and to make it clear that the method is not part of Ruby core. The unfortunate downside is it dirties up the up the method name. To help clean things up, all methods have a more simple alias of just `_`. For example, `String#cl_all_spaces?` is aliased to `String#_all_spaces?`. Use whichever strategy you like, but we recommend that you pick one and try to be consistent.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` 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](https://rubygems.org).
Open a console with either command
$ bin/console
$ rake consoleRun rspec tests
$ rspec
Run rubocop
$ bin/rubocop
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/corlewsolutions/corelib_ruby.