class Timetrap::AutoSheets::NestedDotfiles

Check the current dir and all parent dirs for .timetrap-sheet

Public Instance Methods

check_sheet(dir) click to toggle source
# File lib/timetrap/auto_sheets/nested_dotfiles.rb, line 7
def check_sheet(dir)
  dotfile = File.join(dir, '.timetrap-sheet')
  File.read(dotfile).chomp if File.exist?(dotfile)
end
sheet() click to toggle source
# File lib/timetrap/auto_sheets/nested_dotfiles.rb, line 12
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