Module: Paratrooper::Chef

Defined in:
lib/capistrano-paratrooper-chef.rb

Class Method Summary collapse

Class Method Details

.resource(name, extra_path = nil) ⇒ Object

Raises:

  • (Errno::ENOENT)


26
27
28
29
30
31
32
33
34
# File 'lib/capistrano-paratrooper-chef.rb', line 26

def self.resource(name, extra_path=nil)
  subdirs = [extra_path, 'default'].compact
  subdirs.each do |path|
    resource = Pathname.new(__FILE__).dirname.join('capistrano-paratrooper-chef/resources', path, name)
    return resource  if File.exists?(resource)
  end

  raise Errno::ENOENT, name
end