class RubyConf::RUBY_CONF

Constants

EXTENTIONS

Public Class Methods

__rc_autoload() click to toggle source
# File lib/ruby-conf.rb, line 36
def __rc_autoload
  Find.find('.') do |path|
    next unless @@conf.nil? && path =~ /(?:^|\.)(?:#{EXTENTIONS.join('|')})$/
    if (path =~ /(?:^|\.)(?:#{EXTENTIONS.join('|')})$/) && (File.read(path) =~ /^\s*\#\s*[%:=>&!;-]\s*ruby-conf\s*(?::(.*))?$/mi)
      options = $1
      RubyConf.err "Don't know what to do with options yet, you can have these back: #{options}" if options
      break if __rc_load(path)
    end
  end
end
__rc_conf() click to toggle source
# File lib/ruby-conf.rb, line 21
def __rc_conf() @@conf end
__rc_load(path) click to toggle source
# File lib/ruby-conf.rb, line 23
def __rc_load(path)
  __rc_set_conf
  if load(path) && @@conf
    @@path, @@mtime, @@md5 = path, File.mtime(path).to_i, Digest::MD5.hexdigest(File.read(path))
    RubyConf.out "[ruby-conf] Auto-Loaded config at path: #{path}"
  end
end
__rc_loaded_conf() click to toggle source
# File lib/ruby-conf.rb, line 20
def __rc_loaded_conf() { path:@@path, mtime:@@mtime, md5:@@md5 } end
__rc_reload() click to toggle source
# File lib/ruby-conf.rb, line 30
def __rc_reload
  if @@mtime && @@mtime != File.mtime(@@path).to_i && @@md5 != Digest::MD5.hexdigest(File.read(@@path))
    RubyConf.err "[ruby-conf] Detected change in config file, reloading..."
    __rc_load(@@path)
  end
end
__rc_set_conf(conf = nil) click to toggle source
# File lib/ruby-conf.rb, line 22
def __rc_set_conf(conf = nil) @@conf, @@path, @@mtime, @@md5 = conf, nil, nil, nil end
inspect() click to toggle source
# File lib/ruby-conf.rb, line 59
def inspect()
  __rc_reload
  @@conf.inspect
end
method_missing(name, *args, &block) click to toggle source
# File lib/ruby-conf.rb, line 46
def method_missing(name, *args, &block)
  __rc_reload
  __rc_autoload if @@conf.nil?
  @@conf.__send__(name, *args, &block)
end
nil?() click to toggle source
# File lib/ruby-conf.rb, line 63
def nil?()
  __rc_reload
  @@conf.nil?
end
to_s() click to toggle source
# File lib/ruby-conf.rb, line 51
def to_s()
  __rc_reload
  @@conf.to_s
end
to_str() click to toggle source
# File lib/ruby-conf.rb, line 55
def to_str()
  __rc_reload
  @@conf.to_str
end