class Octogate::ConfigLoader

Public Class Methods

load_config(config_file) click to toggle source
# File lib/octogate/config_loader.rb, line 4
def load_config(config_file)
  instance = new
  instance.instance_eval(File.read(config_file), config_file)
  instance.instance_eval do
    @_target_builders.each do |tb|
      Octogate.config.targets ||= {}
      Octogate.config.targets[tb.name] = tb.__to_target__
    end
  end
end
new() click to toggle source
# File lib/octogate/config_loader.rb, line 16
def initialize
  @_target_builders = []
end

Public Instance Methods

ca_file(ca_file) click to toggle source
# File lib/octogate/config_loader.rb, line 30
def ca_file(ca_file)
  Octogate.config.ca_file = ca_file
end
ssl_verify(verify) click to toggle source
# File lib/octogate/config_loader.rb, line 34
def ssl_verify(verify)
  Octogate.config.ssl_verify = verify
end
target(name, &block) click to toggle source
# File lib/octogate/config_loader.rb, line 24
def target(name, &block)
  builder = TargetBuilder.new(name)
  builder.instance_eval(&block)
  @_target_builders << builder
end
token(token) click to toggle source
# File lib/octogate/config_loader.rb, line 20
def token(token)
  Octogate.config.token = token
end