diff --git a/lib/puppet/face/module_tool.rb b/lib/puppet/face/module_tool.rb index 3e2a8b92e..20b9cb63e 100644 --- a/lib/puppet/face/module_tool.rb +++ b/lib/puppet/face/module_tool.rb @@ -1,12 +1,12 @@ require 'puppet/face' require 'puppet/module_tool' -Puppet::Face.define(:module_tool, '0.0.1') do +Puppet::Face.define(:module_tool, '1.0.0') do copyright "Puppet Labs", 2011 license "Apache 2 license; see COPYING" summary "Creates, installs and searches for modules on the Puppet Forge." description <<-EOT Creates, installs and searches for modules on the Puppet Forge. EOT end diff --git a/lib/puppet/face/module_tool/build.rb b/lib/puppet/face/module_tool/build.rb index e2efea716..87e6aff33 100644 --- a/lib/puppet/face/module_tool/build.rb +++ b/lib/puppet/face/module_tool/build.rb @@ -1,35 +1,35 @@ -Puppet::Face.define(:module_tool, '0.0.1') do +Puppet::Face.define(:module_tool, '1.0.0') do action(:build) do summary "Build a module release package." description <<-EOT Build a module release archive file by processing the Modulefile in the module directory. The release archive file will be stored in the pkg directory of the module directory. EOT returns "Pathname object representing the path to the release archive." examples <<-EOT Build a module release from within the module directory: $ puppet module_tool build Build a module release from outside the module directory: $ puppet module_tool build /path/to/module EOT arguments "" when_invoked do |path, options| root_path = Puppet::Module::Tool.find_module_root(path) Puppet::Module::Tool::Applications::Builder.run(root_path, options) end when_rendering :console do |return_value| # Get the string representation of the Pathname object and print it to # the console. return_value.to_s end end end diff --git a/lib/puppet/face/module_tool/changes.rb b/lib/puppet/face/module_tool/changes.rb index d76fe0d1a..11e1152da 100644 --- a/lib/puppet/face/module_tool/changes.rb +++ b/lib/puppet/face/module_tool/changes.rb @@ -1,36 +1,36 @@ -Puppet::Face.define(:module_tool, '0.0.1') do +Puppet::Face.define(:module_tool, '1.0.0') do action(:changes) do summary "Show modified files of an installed module." description <<-EOT Show files that have been modified after installation of a given module by comparing the on-disk md5 checksum of each file against the module's metadata. EOT returns "Array of strings representing paths of modified files." examples <<-EOT Show modified files of an installed module: $ puppet module_tool changes /path/to/module EOT arguments "" when_invoked do |path, options| root_path = Puppet::Module::Tool.find_module_root(path) Puppet::Module::Tool::Applications::Checksummer.run(root_path, options) end when_rendering :console do |return_value| if return_value.empty? Puppet.notice "No modified files" else Puppet.warning "#{return_value.size} files modified" end return_value.map do |changed_file| "#{changed_file}" end.join("\n") end end end diff --git a/lib/puppet/face/module_tool/clean.rb b/lib/puppet/face/module_tool/clean.rb index 59c1ed9a6..b0aee46ab 100644 --- a/lib/puppet/face/module_tool/clean.rb +++ b/lib/puppet/face/module_tool/clean.rb @@ -1,25 +1,25 @@ -Puppet::Face.define(:module_tool, '0.0.1') do +Puppet::Face.define(:module_tool, '1.0.0') do action(:clean) do summary "Clean the module download cache." description <<-EOT Clean the module download cache. EOT returns "Return a status Hash" examples <<-EOT Clean the module download cache: $ puppet module_tool clean EOT when_invoked do |options| Puppet::Module::Tool::Applications::Cleaner.run(options) end when_rendering :console do |return_value| # Print the status message to the console. return_value[:msg] end end end diff --git a/lib/puppet/face/module_tool/generate.rb b/lib/puppet/face/module_tool/generate.rb index c02febe38..371b35861 100644 --- a/lib/puppet/face/module_tool/generate.rb +++ b/lib/puppet/face/module_tool/generate.rb @@ -1,30 +1,30 @@ -Puppet::Face.define(:module_tool, '0.0.1') do +Puppet::Face.define(:module_tool, '1.0.0') do action(:generate) do summary "Generate boilerplate for a new module." description <<-EOT Generate boilerplate for a new module by creating a directory pre-populated with a directory structure and files recommended for Puppet best practices. EOT returns "Array of Pathname objects representing paths of generated files." examples <<-EOT Generate a new module in the current directory: $ puppet module_tool generate username-modulename EOT arguments "" when_invoked do |name, options| Puppet::Module::Tool::Applications::Generator.run(name, options) end when_rendering :console do |return_value| return_value.map do |generated_file| "#{generated_file}" end.join("\n") end end end diff --git a/lib/puppet/face/module_tool/install.rb b/lib/puppet/face/module_tool/install.rb index 7d136d139..f0cc1a68c 100644 --- a/lib/puppet/face/module_tool/install.rb +++ b/lib/puppet/face/module_tool/install.rb @@ -1,75 +1,75 @@ -Puppet::Face.define(:module_tool, '0.0.1') do +Puppet::Face.define(:module_tool, '1.0.0') do action(:install) do summary "Install a module from a repository or release archive." description <<-EOT Install a module from a release archive file on-disk or by downloading one from a repository. Unpack the archive into the install directory specified by the --install-dir option, which defaults to the first directory in the modulepath. EOT returns "Pathname object representing the path to the installed module." examples <<-EOT Install a module from the default repository: $ puppet module_tool install username-modulename Install a specific module version from a repository: $ puppet module_tool install username-modulename --version=0.0.1 Install a module into a specific directory: $ puppet module_tool install username-modulename --install-dir=path Install a module from a release archive: $ puppet module_tool install username-modulename-0.0.1.tar.gz EOT arguments "" option "--force", "-f" do summary "Force overwrite of existing module, if any." description <<-EOT Force overwrite of existing module, if any. EOT end option "--install-dir=", "-i=" do default_to { Puppet.settings[:modulepath].split(File::PATH_SEPARATOR).first } summary "The directory into which modules are installed." description <<-EOT The directory into which modules are installed, defaults to the first directory in the modulepath. EOT end option "--module-repository=", "-r=" do default_to { Puppet.settings[:module_repository] } summary "Module repository to use." description <<-EOT Module repository to use. EOT end option "--version=", "-v=" do summary "Module version to install." description <<-EOT Module version to install, can be a requirement string, eg '>= 1.0.3', defaults to latest version. EOT end when_invoked do |name, options| Puppet::Module::Tool::Applications::Installer.run(name, options) end when_rendering :console do |return_value| # Get the string representation of the Pathname object and print it to # the console. return_value.to_s end end end diff --git a/lib/puppet/face/module_tool/search.rb b/lib/puppet/face/module_tool/search.rb index bb76702b9..c59f189fe 100644 --- a/lib/puppet/face/module_tool/search.rb +++ b/lib/puppet/face/module_tool/search.rb @@ -1,38 +1,38 @@ -Puppet::Face.define(:module_tool, '0.0.1') do +Puppet::Face.define(:module_tool, '1.0.0') do action(:search) do summary "Search a repository for a module." description <<-EOT Search a repository for modules whose names match a specific substring. EOT returns "Array of module metadata hashes" examples <<-EOT Search the default repository for a module: $ puppet module_tool search modulename EOT arguments "" option "--module-repository=", "-r=" do default_to { Puppet.settings[:module_repository] } summary "Module repository to use." description <<-EOT Module repository to use. EOT end when_invoked do |term, options| Puppet.notice "Searching #{options[:module_repository]}" Puppet::Module::Tool::Applications::Searcher.run(term, options) end when_rendering :console do |return_value| Puppet.notice "#{return_value.size} found." return_value.map do |match| "#{match['full_name']} (#{match['version']})" end.join("\n") end end end