Class: PumaBacklogDetector::FlagFile

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FlagFile

Returns a new instance of FlagFile.



56
57
58
59
60
# File 'lib/puma_backlog_detector.rb', line 56

def initialize path
  @path = path
  @exists = File.exists? path
  set false
end

Instance Method Details

#set(value) ⇒ Object



62
63
64
65
66
67
# File 'lib/puma_backlog_detector.rb', line 62

def set value
  if @exists != value
    FileUtils.send((value ? :touch : :rm_f), @path)
    @exists = value
  end
end