relative

Ruby core enhancing library that provides support for opening, reading and naming files
Download

relative Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Price:
  • FREE
  • Publisher Name:
  • Designing Patterns
  • Publisher web site:
  • http://rubyforge.org/projects/jobmanager/
  • Operating Systems:
  • Mac OS X
  • File Size:
  • 8 KB

relative Tags


relative Description

Ruby core enhancing library that provides support for opening, reading and naming files relative is a free and open source library thatwill enhance Ruby's core and standard libraries to support naming, opening, and reading files relative to the Ruby file currently being interpreted (the contents of the __ FILE __ identifier). This functionality is especially useful in embedded Ruby (eruby, erb, erubis, etc.) where absolute paths or paths relative to the interpreter's current working directory are problematic (due to file system structures and working directories varying across platforms and web servers). Here are some key features of "relative":· The File.expand_path_relative_to_caller class method that expands paths relative to the calling file (analogous to File.expand_path, which expands paths relative to the interpreter's current working directory)· The Kernel#require_relative instance method that allows Ruby modules to be imported with paths relative to the calling file· The Pathname#expand_path_relative_to_caller instance method that returns a new Pathname object created by expanding the receiver Pathname relative to the calling file (analogous to Pathname.expand_path, which expands a Pathname relative to the interpreter's current working directory)· The PathRelativeToCaller class, instances of which are constructed with a path relative to the calling file and can be passed into all of the core and standard Ruby I/O methods (IO.read, File.open, etc). A PathRelativeToCaller instance expands the relative path with which it is initialized and evaluates to the absolute path in I/O methods; it makes the relative path accessible through an attribute accessor, however.NOTE: relative is licensed and distributed under the terms of the MIT/X Consortium License.


relative Related Software