Class: Chef::Deployment::Monitor::MarkerFileSink
- Defined in:
- lib/chef_deployment_monitor/sinks.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(outfile) ⇒ MarkerFileSink
constructor
A new instance of MarkerFileSink.
-
#receive(data) ⇒ Object
will modify the marker file last write data of marker file will be within 5 seconds of last deployement.
Constructor Details
#initialize(outfile) ⇒ MarkerFileSink
Returns a new instance of MarkerFileSink.
14 15 16 |
# File 'lib/chef_deployment_monitor/sinks.rb', line 14 def initialize(outfile) @file = outfile end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
12 13 14 |
# File 'lib/chef_deployment_monitor/sinks.rb', line 12 def file @file end |
Instance Method Details
#receive(data) ⇒ Object
will modify the marker file last write data of marker file will be within 5 seconds of last deployement
21 22 23 24 25 |
# File 'lib/chef_deployment_monitor/sinks.rb', line 21 def receive(data) File.open(file, 'w+') do |f| f.write(data.to_json) end end |