lib/njord/configuration_reader.rb in njord-0.1.3 vs lib/njord/configuration_reader.rb in njord-0.2.0
- old
+ new
@@ -2,19 +2,20 @@
require 'json'
require 'ostruct'
module Njord
module ConfigurationReader
- CONFIG_FILE = ".njord.yml"
+ CONFIG_FILE = ".njord.yml".freeze
def self.read_from_file
if File.exist?(CONFIG_FILE)
- JSON.parse(YAML::load_file(CONFIG_FILE).to_json, object_class: OpenStruct)
+ JSON.parse(YAML.load_file(CONFIG_FILE).to_json, object_class: OpenStruct)
else
- raise ArgumentError.new("No .njord.yml config file exists. Please create one.") if config.nil?
+ raise(ArgumentError, "No .njord.yml config file exists. \
+ Please create one.")
end
rescue
- raise ArgumentError.new("Something is wrong with the .njord.yml - please check the README for a valid example.") if config.nil?
+ raise(ArgumentError, "Something is wrong with the .njord.yml - \
+ please check the README for a valid example.")
end
end
end
-
\ No newline at end of file