Module: ForemanMaintain::Concerns::DirectoryMarker

Defined in:
lib/foreman_maintain/concerns/directory_marker.rb

Instance Method Summary collapse

Instance Method Details

#find_marked_directory(directory) ⇒ Object



10
11
12
# File 'lib/foreman_maintain/concerns/directory_marker.rb', line 10

def find_marked_directory(directory)
  find_dir_containing_file(directory, mark_name)
end

#mark_nameObject



14
15
16
17
# File 'lib/foreman_maintain/concerns/directory_marker.rb', line 14

def mark_name
  cls = self.class.name.split('::').last.downcase
  ".#{cls}_directory_mark"
end

#with_marked_directory(directory) ⇒ Object



4
5
6
7
8
# File 'lib/foreman_maintain/concerns/directory_marker.rb', line 4

def with_marked_directory(directory)
  mark_directory(directory)
  yield
  unmark_directory(directory)
end