Class: ExtremeContinuousBuilder::Status

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Status

Returns a new instance of Status.



90
91
92
# File 'lib/extreme_continuous_builder.rb', line 90

def initialize(path)
  @path = path
end

Instance Method Details

#keep(status) ⇒ Object



94
95
96
# File 'lib/extreme_continuous_builder.rb', line 94

def keep(status)
  File.open(@path, "w+", 0777) { |file| file.write(status.to_s) }
end

#recallObject



98
99
100
101
102
103
104
105
# File 'lib/extreme_continuous_builder.rb', line 98

def recall
  if File.exists?(@path)
     value = File.read(@path)
     value.empty? ? false : value.to_sym
  else
     false
  end
end