Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Yet another WTF library!

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 License
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 unpatched.gemspec
README.md

Convenience library, like ActiveSupport or extlib, but without a single monkey-patch. It is also an API experiment.

Usage

Stand alone:

require 'unpatched'
include Unpatched

like("FooBar").but.underscore!
about(1).month.and(4).days.ago!

Is that too much sugar? Try this:

require 'unpatched'
include Unpatched::Unfancy
_('FooBar').underscore!

Still too much?

require 'unpatched'
Unpatched['FooBar'].underscore!

With Sinatra:

require 'sinatra'
require 'unpatched'
helpers Unpatched

get '/' do
  expires exactly(1.5).minutes.from_now!
  "Hey, ho, let's go!"
end

When to use an exclamation mark

Short: You don't have to. But methods without one will always return magically enhanced objects. Since you never want to pass those on (otherwise, what's the point?), you can get vanilla objects by using an exclamation mark.

Rule of thumb: Use it at the end of your method chain.

Installation

gem install unpatched
Something went wrong with that request. Please try again.