class Rsense::Server::Config
Attributes
errors[RW]
ignores[RW]
options[RW]
port[RW]
searched[RW]
Public Class Methods
new()
click to toggle source
# File lib/rsense/server/config.rb, line 13 def initialize @searched = [] @ignores = [] @errors = [] end
Public Instance Methods
check_options(name)
click to toggle source
# File lib/rsense/server/config.rb, line 64 def check_options(name) @options.rest[name] if @options.rest.key?(name) end
search(path_str="~", level=0)
click to toggle source
# File lib/rsense/server/config.rb, line 19 def search(path_str="~", level=0) level = level + 1 path = FileTree.new(path_str) return if @searched.include?(path) @searched << path conf = path.join(".rsense").expand_path unless conf.exist? if path.parent == path || level == 3 contender = Pathname.new("~").join(".rsense").expand_path conf = contender if contender.exist? else conf = search(path.parent, level) end end conf end
set_up(path)
click to toggle source
# File lib/rsense/server/config.rb, line 68 def set_up(path) conf = search(path) if conf options(conf) end end