Module: Librarian::Puppet::Simple::Installer

Includes:
Iterator, Util
Included in:
CLI
Defined in:
lib/librarian/puppet/simple/installer.rb

Instance Method Summary collapse

Methods included from Iterator

#clear_modules, #each_module, #each_module_of_type, #mod, #modules

Methods included from Util

#base_dir, #forge, #module_path, #print_verbose, #system_cmd

Instance Method Details

#install!Object

installs modules using the each_module method from our iterator mixin



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/librarian/puppet/simple/installer.rb', line 23

def install!
  each_module do |repo|

    print_verbose "\n##### processing module #{repo[:name]}..."

    module_dir = File.join(module_path, repo[:name])

    unless File.exists?(module_dir)
      case
      when repo[:git]
        install_git module_path, repo[:name], repo[:git], repo[:ref]
      when repo[:tarball]
        install_tarball module_path, repo[:name], repo[:tarball]
      else
        abort('only the :git and :tarball provider are currently supported')
      end
    else
      print_verbose "\nModule #{repo[:name]} already installed in #{module_path}"
    end
  end
end