Methods
#
A
D
E
G
I
N
P
S
T
V
Included Modules
Constants
QUOTE_REGEXP_SQ = /\A([^'\\]*(?:\\.[^'\\]*)*)'/
 

escape with backslash

QUOTE_REGEXP_DQ = /\A([^"\\]*(?:""[^"\\]*|\\.[^"\\]*)*)"/
 

escape with backslash and doubled dq

ESCAPE_MAP = { "r" => "\r", "n" => "\n", "b" => "\b", "t" => "\t", }
 

escaped char map

DEFAULT_CONFIG_FILE = rb_str_new2(default_config_file)
 
Class Public methods
new(filename = nil)
# File ext/openssl/lib/openssl/config.rb, line 212
def initialize(filename = nil)
  @data = {}
  if filename
    File.open(filename.to_s) do |file|
      Config.parse_config(file).each do |section, hash|
        self[section] = hash
      end
    end
  end
end
parse(str)
# File ext/openssl/lib/openssl/config.rb, line 20
def parse(str)
  c = new()
  parse_config(StringIO.new(str)).each do |section, hash|
    c[section] = hash
  end
  c
end
parse_config(io)
# File ext/openssl/lib/openssl/config.rb, line 30
def parse_config(io)
  begin
    parse_config_lines(io)
  rescue ConfigError => e
    e.message.replace("error in line #{io.lineno}: " + e.message)
    raise
  end
end
Instance Public methods
[](section)
# File ext/openssl/lib/openssl/config.rb, line 248
def [](section)
  @data[section] || {}
end
[]=(section, pairs)
# File ext/openssl/lib/openssl/config.rb, line 257
def []=(section, pairs)
  check_modify
  @data[section] ||= {}
  pairs.each do |key, value|
    self.add_value(section, key, value)
  end
end
add_value(section, key, value)
# File ext/openssl/lib/openssl/config.rb, line 243
def add_value(section, key, value)
  check_modify
  (@data[section] ||= {})[key] = value
end
each()
# File ext/openssl/lib/openssl/config.rb, line 281
def each
  @data.each do |section, hash|
    hash.each do |key, value|
      yield [section, key, value]
    end
  end
end
get_value(section, key)
# File ext/openssl/lib/openssl/config.rb, line 223
def get_value(section, key)
  if section.nil?
    raise TypeError.new('nil not allowed')
  end
  section = 'default' if section.empty?
  get_key_string(section, key)
end
inspect()
# File ext/openssl/lib/openssl/config.rb, line 289
def inspect
  "#<#{self.class.name} sections=#{sections.inspect}>"
end
section(name)
# File ext/openssl/lib/openssl/config.rb, line 252
def section(name)
  warn('Config#section is deprecated; use Config#[]')
  @data[name] || {}
end
sections()
# File ext/openssl/lib/openssl/config.rb, line 265
def sections
  @data.keys
end
to_s()
# File ext/openssl/lib/openssl/config.rb, line 269
def to_s
  ary = []
  @data.keys.sort.each do |section|
    ary << "[ #{section} ]\n"
    @data[section].keys.each do |key|
      ary << "#{key}=#{@data[section][key]}\n"
    end
    ary << "\n"
  end
  ary.join
end
value(arg1, arg2 = nil)
# File ext/openssl/lib/openssl/config.rb, line 231
def value(arg1, arg2 = nil)
  warn('Config#value is deprecated; use Config#get_value')
  if arg2.nil?
    section, key = 'default', arg1
  else
    section, key = arg1, arg2
  end
  section ||= 'default'
  section = 'default' if section.empty?
  get_key_string(section, key)
end
Instance Protected methods
data()
# File ext/openssl/lib/openssl/config.rb, line 295
def data
  @data
end