Class: Puppet::Module::Tool::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/puppet/module/tool/cli.rb

Overview

CLI

This class is used by the command-line program to dispatch actions.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.method_option_repositoryObject



17
18
19
# File 'lib/puppet/module/tool/cli.rb', line 17

def self.method_option_repository
  method_option :puppet_module_repository, :aliases => '-r', :default => Puppet.settings[:puppet_module_repository], :desc => "Module repository to use"
end

Instance Method Details

#build(path = nil) ⇒ Object



44
45
46
# File 'lib/puppet/module/tool/cli.rb', line 44

def build(path = nil)
  Puppet::Module::Tool::Applications::Builder.run(find_module_root(path), options)
end

#changelogObject



107
108
109
110
111
112
113
114
# File 'lib/puppet/module/tool/cli.rb', line 107

def changelog
  Puppet::Module::Tool.prepare_settings(options)
  if ENV['PAGER']
    exec ENV['PAGER'], Puppet::Module::Tool.changelog_filename
  else
    puts File.read(Puppet::Module::Tool.changelog_filename)
  end
end

#changes(path = nil) ⇒ Object



86
87
88
# File 'lib/puppet/module/tool/cli.rb', line 86

def changes(path = nil)
  Puppet::Module::Tool::Applications::Checksummer.run(find_module_root(path), options)
end

#cleanObject



39
40
41
# File 'lib/puppet/module/tool/cli.rb', line 39

def clean
  Puppet::Module::Tool::Applications::Cleaner.run(options)
end

#generate(name) ⇒ Object



28
29
30
# File 'lib/puppet/module/tool/cli.rb', line 28

def generate(name)
  Puppet::Module::Tool::Applications::Generator.run(name, options)
end

#install(name) ⇒ Object



68
69
70
# File 'lib/puppet/module/tool/cli.rb', line 68

def install(name)
  Puppet::Module::Tool::Applications::Installer.run(name, options)
end

#repositoryObject



91
92
93
94
# File 'lib/puppet/module/tool/cli.rb', line 91

def repository
  Puppet::Module::Tool.prepare_settings(options)
  say Puppet.settings[:puppet_module_repository]
end

#search(term) ⇒ Object



74
75
76
# File 'lib/puppet/module/tool/cli.rb', line 74

def search(term)
  Puppet::Module::Tool::Applications::Searcher.run(term, options)
end

#usageObject



97
98
99
100
101
102
103
104
# File 'lib/puppet/module/tool/cli.rb', line 97

def usage
  Puppet::Module::Tool.prepare_settings(options)
  if ENV['PAGER']
    exec ENV['PAGER'], Puppet::Module::Tool.usage_filename
  else
    puts File.read(Puppet::Module::Tool.usage_filename)
  end
end

#versionObject



22
23
24
# File 'lib/puppet/module/tool/cli.rb', line 22

def version
  say Puppet::Module::Tool.version
end