Sha256: af3435a130a6dba4f2e9b0b662c345045e069ad741513ecd10016eda22b16279

Contents?: true

Size: 1.33 KB

Versions: 33

Compression:

Stored size: 1.33 KB

Contents

Puppet::Face.define(:module, '1.0.0') do
  action(:generate) do
    summary "Generate boilerplate for a new module."
    description <<-EOT
      Generates boilerplate for a new module by creating the directory
      structure and files recommended for the Puppet community's best practices.

      A module may need additional directories beyond this boilerplate
      if it provides plugins, files, or templates.
    EOT

    returns "Array of Pathname objects representing paths of generated files."

    examples <<-EOT
      Generate a new module in the current directory:

      $ puppet module generate puppetlabs-ssh
      notice: Generating module at /Users/kelseyhightower/puppetlabs-ssh
      puppetlabs-ssh
      puppetlabs-ssh/tests
      puppetlabs-ssh/tests/init.pp
      puppetlabs-ssh/spec
      puppetlabs-ssh/spec/spec_helper.rb
      puppetlabs-ssh/spec/spec.opts
      puppetlabs-ssh/README
      puppetlabs-ssh/Modulefile
      puppetlabs-ssh/metadata.json
      puppetlabs-ssh/manifests
      puppetlabs-ssh/manifests/init.pp
    EOT

    arguments "<name>"

    when_invoked do |name, options|
      Puppet::ModuleTool.set_option_defaults options
      Puppet::ModuleTool::Applications::Generator.run(name, options)
    end

    when_rendering :console do |return_value|
      return_value.map {|f| f.to_s }.join("\n")
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
puppet-3.3.2 lib/puppet/face/module/generate.rb
puppet-3.3.1 lib/puppet/face/module/generate.rb
puppet-3.3.1.rc3 lib/puppet/face/module/generate.rb
puppet-3.3.1.rc2 lib/puppet/face/module/generate.rb
puppet-3.3.1.rc1 lib/puppet/face/module/generate.rb
puppet-3.3.0 lib/puppet/face/module/generate.rb
puppet-3.3.0.rc3 lib/puppet/face/module/generate.rb
puppet-3.3.0.rc2 lib/puppet/face/module/generate.rb
puppet-3.2.4 lib/puppet/face/module/generate.rb
puppet-3.2.3 lib/puppet/face/module/generate.rb
puppet-3.2.3.rc1 lib/puppet/face/module/generate.rb
puppet-3.2.2 lib/puppet/face/module/generate.rb
puppet-3.2.1 lib/puppet/face/module/generate.rb
puppet-3.2.1.rc1 lib/puppet/face/module/generate.rb
puppet-3.2.0.rc2 lib/puppet/face/module/generate.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/face/module/generate.rb
puppet-3.2.0.rc1 lib/puppet/face/module/generate.rb
puppet-3.1.1 lib/puppet/face/module/generate.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/face/module/generate.rb
puppet-3.1.0 lib/puppet/face/module/generate.rb