Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkh/unpatched
Yet another WTF library!
https://github.com/rkh/unpatched
Last synced: 18 days ago
JSON representation
Yet another WTF library!
- Host: GitHub
- URL: https://github.com/rkh/unpatched
- Owner: rkh
- License: mit
- Created: 2011-05-31T14:13:43.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-05-31T14:26:43.000Z (over 13 years ago)
- Last Synced: 2024-10-14T19:42:48.909Z (about 1 month ago)
- Language: Ruby
- Homepage: http://rkh.github.com/unpatched/
- Size: 97.7 KB
- Stars: 23
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
README
Convenience library, like ActiveSupport or extlib, but without a single
monkey-patch. It is also an API experiment.# Usage
Stand alone:
``` ruby
require 'unpatched'
include Unpatchedlike("FooBar").but.underscore!
about(1).month.and(4).days.ago!
```Is that too much sugar? Try this:
``` ruby
require 'unpatched'
include Unpatched::Unfancy
_('FooBar').underscore!
```Still too much?
``` ruby
require 'unpatched'
Unpatched['FooBar'].underscore!
```With Sinatra:
``` ruby
require 'sinatra'
require 'unpatched'
helpers Unpatchedget '/' 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