Method: Puppet::ModuleTool.find_module_root
- Defined in:
- lib/puppet/module_tool.rb
.find_module_root(path) ⇒ Pathname?
Find the module root when given a path by checking each directory up from its current location until it finds one that satisfies is_module_root?
48 49 50 51 52 53 54 55 56 |
# File 'lib/puppet/module_tool.rb', line 48 def self.find_module_root(path) path = Pathname.new(path) if path.class == String path..ascend do |p| return p if is_module_root?(p) end nil end |