Class: File
- Inherits:
-
Object
- Object
- File
- Defined in:
- lib/file.rb
Class Method Summary collapse
-
.here(*args) ⇒ Object
Hides all that lovely expand/join/dirname(__FILE__, path) crap.
Class Method Details
.here(*args) ⇒ Object
Hides all that lovely expand/join/dirname(__FILE__, path) crap
E.g.: require File.here(“../lib/pants”)
Splatty version for the OS Agnosts out there: require File.here(%w[.. lib pants])
8 9 10 |
# File 'lib/file.rb', line 8 def self.here(*args) p = File.(File.join(File.dirname(caller.first.split(':')[0]), *args)) end |