Class: File

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

Overview

Recognizing that Dir.getwd is not always the dir of the file being interpreted

Thus the pattern has been $:.unshift(File.dirname(__FILE__)) which according to gilesbowkett.blogspot.com/2009/04/unshiftfiledirnamefile.html This shit is evil. People are undecided as to how evil, but evil it is.

Preferable is require File.expand_path(File.dirname(__FILE__)) + “foo”

but then you have a load of File.expand_path(File.dirname(__FILE__)) everywhere so it would be nice to have File.here , as in require File.here “foo”

Class Method Summary collapse

Class Method Details

.here(string) ⇒ Object



82
83
84
# File 'lib/tarpaulin.rb', line 82

def File.here (string)
  return Context::determine(2){}[:path] + '/' + string
end