Sha256: 6bb2a0896513465c93faf9cb7d3f4aa8f63c16c3a672b3575eac51759c623d4d

Contents?: true

Size: 743 Bytes

Versions: 7

Compression:

Stored size: 743 Bytes

Contents

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rest_dsl-0.1.9 lib/rest_dsl.rb
rest_dsl-0.1.7 lib/rest_dsl.rb
rest_dsl-0.1.5 lib/rest_dsl.rb
rest_dsl-0.1.4 lib/rest_dsl.rb
rest_dsl-0.1.3 lib/rest_dsl.rb
rest_dsl-0.1.2 lib/rest_dsl.rb
rest_dsl-0.1.1 lib/rest_dsl.rb