Method: Hussh.save_recording_if_changed

Defined in:
lib/hussh.rb

.save_recording_if_changedObject



88
89
90
91
92
93
94
95
96
# File 'lib/hussh.rb', line 88

def self.save_recording_if_changed
  return if !self.recording_changed?
  @@recording_path ||= self.path_for_recording(name)
  if !File.exist?(@@recording_path)
    FileUtils.mkdir_p(File.dirname(@@recording_path))
  end
  File.write(@@recording_path, @@recorded_responses.to_yaml)
  @@recording_changed = false
end