Class/Module Index [+]

Quicksearch

Fluent::Config

Public Class Methods

bool_value(str) click to toggle source
# File lib/fluent/config.rb, line 136
def self.bool_value(str)
  case str.to_s
  when 'true', 'yes'
    true
  when 'false', 'no'
    false
  else
    nil
  end
end
new(name='') click to toggle source
# File lib/fluent/config.rb, line 102
def self.new(name='')
  Element.new('', '', {}, [])
end
parse(str, fname, basepath=Dir.pwd) click to toggle source
# File lib/fluent/config.rb, line 98
def self.parse(str, fname, basepath=Dir.pwd)
  Parser.parse(str, fname, basepath)
end
read(path) click to toggle source
# File lib/fluent/config.rb, line 94
def self.read(path)
  Parser.read(path)
end
size_value(str) click to toggle source
# File lib/fluent/config.rb, line 106
def self.size_value(str)
  case str.to_s
  when /([0-9]+)k/
    $~[1].to_i * 1024
  when /([0-9]+)m/
    $~[1].to_i * (1024**2)
  when /([0-9]+)g/
    $~[1].to_i * (1024**3)
  when /([0-9]+)t/
    $~[1].to_i * (1024**4)
  else
    str.to_i
  end
end
time_value(str) click to toggle source
# File lib/fluent/config.rb, line 121
def self.time_value(str)
  case str.to_s
  when /([0-9]+)s/
    $~[1].to_i
  when /([0-9]+)m/
    $~[1].to_i * 60
  when /([0-9]+)h/
    $~[1].to_i * 60*60
  when /([0-9]+)d/
    $~[1].to_i * 24*60*60
  else
    str.to_f
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.