module ErbHiera::Directory::Match

Public Class Methods

path(path, regexp) click to toggle source
# File lib/erb-hiera/directory.rb, line 16
def self.path(path, regexp)
  result = path.match(regexp)

  if result.length != 2
    raise StandardError, "failed to match regexp for path: #{regexp}/#{path}"
  end

  result[1]
end