= need
* http://need.rubyforge.org
* source code - http://github.com/dfg59/need/tree/master
== DESCRIPTION:
Need makes ruby relative requires just work. Simply need a file with a relative path
and the file will always be required correctly, regardless of what file your application is
being launched through. Typically, ruby projects would unshift lib onto $PATH or use the
File.dirname(__FILE__) trick. Using need means you don't have to worry about either of these.
Assume you have two files, one directly in lib and the other in lib/extensions. Let's assume
that file_a in lib requires file_b, in lib/extensions. Previously, you would doing some crazy
load path unshifting or use the __FILE__ trick to make these requires flexible enough to work
when your app is being accessed by rake, through a test suite, or required as a gem. Now, just
use need.
In file_a:
need"extensions/file_b"
need "extensions/file_b"
== FEATURES/PROBLEMS:
== SYNOPSIS:
need"relative/path/to/file"
need "relative/path/to/file"
== REQUIREMENTS:
== INSTALL:
* rubyforge - sudo gem install need
* github - sudo gem install dfg59-need --source=http://gems.github.com
== LICENSE:
(The MIT License)
Copyright (c) 2008 FIX
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* http://need.rubyforge.org
* source code - http://github.com/dfg59/need/tree/master
== DESCRIPTION:
Need makes ruby relative requires just work. Simply need a file with a relative path
and the file will always be required correctly, regardless of what file your application is
being launched through. Typically, ruby projects would unshift lib onto $PATH or use the
File.dirname(__FILE__) trick. Using need means you don't have to worry about either of these.
Assume you have two files, one directly in lib and the other in lib/extensions. Let's assume
that file_a in lib requires file_b, in lib/extensions. Previously, you would doing some crazy
load path unshifting or use the __FILE__ trick to make these requires flexible enough to work
when your app is being accessed by rake, through a test suite, or required as a gem. Now, just
use need.
In file_a:
need"extensions/file_b"
need "extensions/file_b"
== FEATURES/PROBLEMS:
== SYNOPSIS:
need"relative/path/to/file"
need "relative/path/to/file"
== REQUIREMENTS:
== INSTALL:
* rubyforge - sudo gem install need
* github - sudo gem install dfg59-need --source=http://gems.github.com
== LICENSE:
(The MIT License)
Copyright (c) 2008 FIX
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.