https://github.com/rubyworks/main_like_module
Completing Toplevel's proxy of Object class
https://github.com/rubyworks/main_like_module
Last synced: about 1 year ago
JSON representation
Completing Toplevel's proxy of Object class
- Host: GitHub
- URL: https://github.com/rubyworks/main_like_module
- Owner: rubyworks
- Created: 2011-12-20T04:26:34.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-02-28T19:01:35.000Z (about 14 years ago)
- Last Synced: 2025-02-08T00:42:56.008Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
Awesome Lists containing this project
README
# Main Like Module
[](http://travis-ci.org/rubyworks/main_like_module)
__DESCRIPTION__
Did you know `main`? Main is actually the special name Ruby gives
to the toplevel object. This object is very special, it is actually
in part a proxy object for the Object class itself. But it's only
a partial implementation.
I have long argued that the toplevel object should be replaced with
an self extended module, e.g.
module Toplevel
extend self
# ruby is executed here
end
This would have a couple of significant benefits. First, the toplevel
would no longer pollute every other object in the system. And second,
the toplevel would be a fully operational module context.
Alas, so far, no avail. But there's always hope. In the mean time,
we can at least support the second point by completing the proxy,
making it emulate the Object class context in full. And that's
exactly what Main Like Module does.
__COPYRIGHTS__
Copyright (c) 2009 Rubyworks
Main as Module is distributable in accordance with the BSD-2-Clause license.
See COPYING.md for details.