Class: File

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

Class Method Summary collapse

Class Method Details

.hereObject


24
25
26
# File 'lib/x.rb', line 24

def self.here
  dirname(caller[0].split(':').first)
end

.up(dir_count = 1) ⇒ Object


28
29
30
31
32
# File 'lib/x.rb', line 28

def self.up(dir_count = 1)
  path = dirname(caller[0].split(':').first)
  dir_count.times { path = path / '..' }
  path
end