modules/sr/lib/serializers/implementations/json_serializer.rb
# Load json from file.
# Silent: always returns an object
Load json from file.
Silent: always returns an object
Load json from file . Silent : always returns an object
def load_file(file)
    puts "Loading json from file: #{file}" if $verbose
    loaded_data = {}
    begin
      loaded_data = JSON.parse File.read file if File.exist? file
    rescue JSON::ParserError
      puts "Error parsing file: #{file}. #{$ERROR_INFO}" if $verbose
    ensure
      @json_data = loaded_data
    end
  end
def load_file ( file ) puts "Loading json from file: #{file}" if $verbose loaded_data = { } begin loaded_data = JSON . parse File . read file if File . exist? file rescue JSON :: ParserError puts "Error parsing file: #{file}. #{$ERROR_INFO}" if $verbose ensure @json_data = loaded_data end end
Load json from file.
Load json from file .
file