lib/miu.rb in miu-0.0.3 vs lib/miu.rb in miu-0.0.4

- old
+ new

@@ -4,10 +4,30 @@ class << self def root @root ||= find_root 'Gemfile' end + def default_port + 22200 + end + + def default_rpc_port + default_port + end + + def default_god_port + default_port + 1 + end + + def default_god_config + 'config/miu.god' + end + + def default_fluent_config + 'config/fluent.conf' + end + def plugins @plugins ||= {} end def register(name, plugin, options = {}, &block) @@ -20,12 +40,12 @@ end def find_root(flag, base = nil) require 'pathname' path = base || Dir.pwd - while path && File.directory?(path) && File.exist?("#{path}/#{flag}") + while path && File.directory?(path) && !File.exist?("#{path}/#{flag}") parent = File.dirname path - path = path != parent && path + path = path != parent && parent end raise 'Could not find root path' unless path Pathname.new File.realpath(path) end end