Need

Open source Ruby solution that will make your relative requires dissapear
Download

Need Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Price:
  • FREE
  • Publisher Name:
  • Drew Olson
  • Publisher web site:
  • http://rubyforge.org/users/dfg59/
  • Operating Systems:
  • Mac OS X
  • File Size:
  • 0 KB

Need Tags


Need Description

Open source Ruby solution that will make your relative requires dissapear 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 just use the File.dirname(FILE) trick. Using Need means that you don not 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 do 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"NOTE: Need is licensed and provided under the terms of the MIT License. What's New in This Release: · Need can now optionally take a path rather than a block.


Need Related Software