Class: Puppet::Module::Tool::Applications::Builder

Inherits:
Application
  • Object
show all
Defined in:
lib/puppet/module/tool/applications/builder.rb

Instance Attribute Summary

Attributes inherited from Application

#options

Instance Method Summary collapse

Methods inherited from Application

#discuss, #load_modulefile!, #metadata, #parse_filename!, #repository, run

Methods included from Utils::Interrogation

#confirms?, #header, #prompt, #say, #subheader

Constructor Details

#initialize(path, options) ⇒ Builder

Returns a new instance of Builder.



9
10
11
12
13
# File 'lib/puppet/module/tool/applications/builder.rb', line 9

def initialize(path, options)
  @path = File.expand_path(path)
  @pkg_path = File.join(@path, 'pkg')
  super(options)
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/puppet/module/tool/applications/builder.rb', line 15

def run
  load_modulefile!
  create_directory
  copy_contents
  
  header "Building #{@path} for release"
  tar
  gzip
  relative = Pathname.new(File.join(@pkg_path, filename('tar.gz'))).relative_path_from(Pathname.new(Dir.pwd))
  # TODO Implement "release" feature.
  ### say "Done. Now you probably want to:\n  $ puppet-module release #{relative}"
  say "Done. Built: #{relative}"
end