Module: PuppetfileResolver::Puppetfile::Parser::R10KEval::PuppetModule
- Defined in:
- lib/puppetfile-resolver/puppetfile/parser/r10k_eval/puppet_module.rb
Class Method Summary collapse
Class Method Details
.from_puppetfile(title, args) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/puppet_module.rb', line 14 def self.from_puppetfile(title, args) return Module::Git.to_document_module(title, args) if Module::Git.implements?(title, args) return Module::Svn.to_document_module(title, args) if Module::Svn.implements?(title, args) return Module::Local.to_document_module(title, args) if Module::Local.implements?(title, args) return Module::Forge.to_document_module(title, args) if Module::Forge.implements?(title, args) Module::Invalid.to_document_module(title, args) end |
.parse_title(title) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/puppet_module.rb', line 23 def self.parse_title(title) if (match = title.match(/\A(\w+)\Z/)) [nil, match[1]] elsif (match = title.match(/\A(\w+)[-\/](\w+)\Z/)) [match[1], match[2]] else raise ArgumentError, format("Module name (%<title>s) must match either 'modulename' or 'owner/modulename'", title: title) end end |