Method: Puppet::ModuleTool.username_and_modname_from

Defined in:
lib/puppet/module_tool.rb

.username_and_modname_from(full_module_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return the username and modname for a given full_module_name, or raise an ArgumentError if the argument isn’t parseable.



35
36
37
38
39
40
41
42
# File 'lib/puppet/module_tool.rb', line 35

def self.username_and_modname_from(full_module_name)
  matcher = full_module_name.match(FULL_MODULE_NAME_PATTERN)
  if matcher
    matcher.captures
  else
    raise ArgumentError, _("Not a valid full name: %{full_module_name}") % { full_module_name: full_module_name }
  end
end