Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/file.rb

Class Method Summary collapse

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.expand_path(File.join(File.dirname(caller.first.split(':')[0]), *args))
end