Lines Matching defs:section
22 parse_config(StringIO.new(str)).each do |section, hash|
23 c[section] = hash
39 def get_key_string(data, section, key) # :nodoc:
40 if v = data[section] && data[section][key]
42 elsif section == 'ENV'
55 section = 'default'
56 data = {section => {}}
62 section = $1.strip
63 data[section] ||= {}
70 section = $1
75 value = unescape_value(data, section, $3)
76 (data[section] ||= {})[key] = value.strip
97 def unescape_value(data, section, value)
123 refsec = section
216 Config.parse_config(file).each do |section, hash|
217 self[section] = hash
223 def get_value(section, key)
224 if section.nil?
227 section = 'default' if section.empty?
228 get_key_string(section, key)
234 section, key = 'default', arg1
236 section, key = arg1, arg2
238 section ||= 'default'
239 section = 'default' if section.empty?
240 get_key_string(section, key)
243 def add_value(section, key, value)
245 (@data[section] ||= {})[key] = value
248 def [](section)
249 @data[section] || {}
252 def section(name)
253 warn('Config#section is deprecated; use Config#[]')
257 def []=(section, pairs)
259 @data[section] ||= {}
261 self.add_value(section, key, value)
271 @data.keys.sort.each do |section|
272 ary << "[ #{section} ]\n"
273 @data[section].keys.each do |key|
274 ary << "#{key}=#{@data[section][key]}\n"
282 @data.each do |section, hash|
284 yield [section, key, value]
309 def get_key_string(section, key)
310 Config.get_key_string(@data, section, key)