0.0
No commit activity in last 3 years
No release in over 3 years
Useful extensions to ruby core.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 0.10.1
~> 11.1
~> 3.4.0
~> 0.40.0
 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 & Performance

We invite all like minded developers to join us in growing the corelib library of extensions.

Installation

Add this line to your application's Gemfile:

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.

Open a console with either command

$ bin/console
$ rake console

Run rspec tests

$ rspec

Run rubocop

$ bin/rubocop

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/corlewsolutions/corelib_ruby.