modules/sr/lib/serializers/implementations/json_serializer.rb
# Save json to file.
# Throw exception if there is an error.
Save json to file.
Throw exception if there is an error.
Save json to file . Throw exception if there is an error .
def save_file(file, data)
    puts "Saving to json file: #{file}" if $verbose
    begin
      File.open(file, 'w') do |f|
        f.write JSON.pretty_generate data
      end
    rescue StandardError
      puts "Error saving json file: #{file}. #{$ERROR_INFO}" if $verbose
      raise
    end
  end
def save_file ( file , data ) puts "Saving to json file: #{file}" if $verbose begin File . open ( file , 'w' ) do | f | f . write JSON . pretty_generate data end rescue StandardError puts "Error saving json file: #{file}. #{$ERROR_INFO}" if $verbose raise end end
Save json to file.
Save json to file .
file
data