Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Start using refine, today. Be ready for Ruby 2.0!

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 refine.gemspec
README.md

Allows you to use refine in older Ruby versions. It will simply fall back to prepend if available, to include otherwise (read: you will still pollute global scope).

Installation

gem install refine

Example

require 'refine' if RUBY_VERSION < '2.0'

module PassiveSupport
  refine String do
    def underscore
      # ...
    end

    def camel_case
      # ...
    end
  end

  refine Module do
    def parent
      # ...
    end
  end
end

class MyFancyApp
  using PassiveSupport
end
Something went wrong with that request. Please try again.