Sha256: 08c969e579443dd390b71297e626f0a53bc5458df8b7e11fdbc47151e2cd8ae8
Contents?: true
Size: 591 Bytes
Versions: 12
Compression:
Stored size: 591 Bytes
Contents
module Timetrap module AutoSheets # # Check the current dir and all parent dirs for .timetrap-sheet # class NestedDotfiles def check_sheet(dir) dotfile = File.join(dir, '.timetrap-sheet') File.read(dotfile).chomp if File.exist?(dotfile) end def sheet dir = Dir.pwd while true do sheet = check_sheet dir break if nil != sheet new_dir = File.expand_path("..", dir) break if new_dir == dir dir = new_dir end return sheet end end end end
Version data entries
12 entries across 12 versions & 1 rubygems