lib/rest_dsl.rb in rest_dsl-0.1.7 vs lib/rest_dsl.rb in rest_dsl-0.1.8

- old
+ new

@@ -1,40 +1,40 @@ -require_relative 'rest_dsl/version' -require_relative 'rest_dsl/errors' -require_relative 'rest_dsl/dsl' -require 'psych' -require 'json' - -module RestDSL - class << self - attr_reader :config_file_location - attr_reader :use_config_file - attr_reader :config - - def config_file_location=(arg) - @config_file_location = arg - load_config - end - - def default_configs - {} - end - - def configuration - @config - end - - private - def load_config - @config = - if File.exist?("#{config_file_location}/rest_dsl.yml") - Psych.load_file("#{config_file_location}/rest_dsl.yml") - else - default_configs - end - end - end - - @config_file_location = './config' - load_config - +require_relative 'rest_dsl/version' +require_relative 'rest_dsl/errors' +require_relative 'rest_dsl/dsl' +require 'psych' +require 'json' + +module RestDSL + class << self + attr_reader :config_file_location + attr_reader :use_config_file + attr_reader :config + + def config_file_location=(arg) + @config_file_location = arg + load_config + end + + def default_configs + {} + end + + def configuration + @config + end + + private + def load_config + @config = + if File.exist?("#{config_file_location}/rest_dsl.yml") + Psych.load_file("#{config_file_location}/rest_dsl.yml") + else + default_configs + end + end + end + + @config_file_location = './config' + load_config + end \ No newline at end of file