Class: R10K::Module::Forge
- Inherits:
-
R10K::Module
- Object
- R10K::Module
- R10K::Module::Forge
- Includes:
- Logging
- Defined in:
- lib/r10k/module/forge.rb
Instance Attribute Summary
Attributes inherited from R10K::Module
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, path, args) ⇒ Forge
constructor
A new instance of Forge.
- #sync!(options = {}) ⇒ Object
Methods included from Logging
formatter, included, level, level=, #logger, outputter
Methods inherited from R10K::Module
Constructor Details
Class Method Details
Instance Method Details
#sync!(options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/r10k/module/forge.rb', line 27 def sync!( = {}) return if insync? if insync? logger.debug1 "Module #{@full_name} already matches version #{@version}" elsif File.exist? logger.debug "Module #{@full_name} is installed but doesn't match version #{@version}, upgrading" cmd = [] cmd << 'upgrade' cmd << "--version=#{@version}" cmd << "--ignore-dependencies" cmd << @full_name pmt cmd else logger.debug "Module #{@full_name} is not installed" cmd = [] cmd << 'install' cmd << "--version=#{@version}" cmd << "--ignore-dependencies" cmd << @full_name pmt cmd end end |