Added modules
This commit is contained in:
parent
c53c931217
commit
59ec520742
646 changed files with 35182 additions and 0 deletions
27
modules/stdlib/spec/lib/puppet_spec/modules.rb
Executable file
27
modules/stdlib/spec/lib/puppet_spec/modules.rb
Executable file
|
@ -0,0 +1,27 @@
|
|||
#! /usr/bin/env ruby -S rspec
|
||||
module PuppetSpec::Modules
|
||||
class << self
|
||||
def create(name, dir, options = {})
|
||||
module_dir = File.join(dir, name)
|
||||
FileUtils.mkdir_p(module_dir)
|
||||
|
||||
environment = options[:environment]
|
||||
|
||||
if metadata = options[:metadata]
|
||||
metadata[:source] ||= 'github'
|
||||
metadata[:author] ||= 'puppetlabs'
|
||||
metadata[:version] ||= '9.9.9'
|
||||
metadata[:license] ||= 'to kill'
|
||||
metadata[:dependencies] ||= []
|
||||
|
||||
metadata[:name] = "#{metadata[:author]}/#{name}"
|
||||
|
||||
File.open(File.join(module_dir, 'metadata.json'), 'w') do |f|
|
||||
f.write(metadata.to_pson)
|
||||
end
|
||||
end
|
||||
|
||||
Puppet::Module.new(name, module_dir, environment)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue