lib/rubysermon/configurator.rb
c61af953
 require 'json'
 
 module Rubysermon
 	class Configurator
 
 		def initialize(config_path)
 			raw_json = File.read(config_path)
f081173d
 
 			begin
 				@parsed_settings = JSON.parse(raw_json, symbolize_names: true)
 			rescue JSON::ParserError
 				@parsed_settings = {}
 				$stderr.puts "Invalid JSON file"
 			end
c61af953
 		end
 
 		def get_settings
 			@parsed_settings
 		end
 	end
 end