Refinements arrived to Ruby trunk here The purpose of Refinements is to make monkey patching safer, extending core classes but limiting its effects to a particular area of code.
Shugo Maeda wrote …
"Refinements are similar to Classboxes. However, Refinements doesn't
support local rebinding as mentioned later. In this sense,
Refinements might be more similar to selector namespaces, but I'm not
sure because I have never seen any implementation of selector
In Refinements, a Ruby module is used as a namespace (or classbox) for
class extensions. Such class extensions are called refinements. For
example, the following module refines Fixnum."