Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (24 sloc) 1.08 KB

Description

Provides an easy way of using/sharing Ruby extension libraries (think activesupport) with a bias to monkeypatch-agnostic extensions. Read this for an explanation of why.

Examples

Using my extension library for these examples

irb>> require 'core'; require 'my_core'
true
irb>> Core.default_library = MyCore
MyCore
irb>> Core.extends Array
true
irb>> Array.ancestors
=> [Array, MyCore::Array, Enumerable, Object, PP::ObjectMixin, Kernel]

Limitations

Checks for method name collisions currently use *instance_methods and *methods of a class. Patches for more thorough checks are welcome.

Todo

  • Config file to save/load your often used extensions

  • Support loading multiple files ie multiple methods under a class directory ie activesupport/facets-like.

  • Make it easier to share (a la sake) and use core extensions made by others.

  • Provide aliasing for methods to bypass method name clashes.

  • Use Ruby2Ruby to handpick methods to extend.