Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steveklabnik/require_relative
This backports require_relative to Ruby 1.8.
https://github.com/steveklabnik/require_relative
Last synced: 17 days ago
JSON representation
This backports require_relative to Ruby 1.8.
- Host: GitHub
- URL: https://github.com/steveklabnik/require_relative
- Owner: steveklabnik
- Created: 2011-03-06T02:07:39.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-10-22T17:28:33.000Z (about 13 years ago)
- Last Synced: 2024-10-10T20:19:24.863Z (about 1 month ago)
- Language: Ruby
- Homepage: http://steveklabnik.github.com/require_relative/
- Size: 488 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
require\_relative
================In Ruby 1.9.2, "." was removed from the $LOAD_PATH. require_relative was
added to let you require files relative to your current directory.This gem backports both of these features to earlier Rubies.
## Usage
require 'rubygems'
require 'require_relative'require 'foo' #=> LoadError
require_relative 'foo' #=> works!If you're intending to use this gem to transition from Ruby 1.8.x to
1.9.2, do this:require 'rubygems'
require 'require_relative' if RUBY_VERSION =~ /1\.8/And then it should run just fine on both.
## Other Documentation
This gem is pretty straightforward, but we do have source documentation,
generated by rocco. You can find it in the gh-pages branch of this
repository or on [the
website](http://steveklabnik.github.com/require_relative).## Contributing
Please fork the project, make your commits, push them to GitHub, and
make a pull request. Patches should have documentation and/or tests.
Don't be afraid to make a pull request without them, if you don't know
how to test something we can work on it in the comments. :)To run the tests, simply "rake test."
To install your development version of the gem, simply "rake install".
To generate the documentation, "rake read," and it'll open in your
browser.## License
require\_relative is licensed under one of three licenses: WTFPL, BSD,
or the same license as Ruby. Your choice.