Class: R10K::Module::Local

Inherits:
Base
  • Object
show all
Defined in:
lib/r10k/module/local.rb

Overview

A dummy module type that can be used to “protect” Puppet modules that exist inside of the Puppetfile “moduledir” location. Local modules will not be modified, and will not be purged when r10k removes unmanaged modules.

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS, Logging::SYSLOG_LEVELS_MAP

Instance Attribute Summary

Attributes inherited from Base

#dirname, #environment, #name, #origin, #owner, #path, #spec_deletable, #title

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#accept, #cachedir, #delete_spec_dir, #full_path, #initialize, #maybe_delete_spec_dir, #should_sync?

Methods included from Logging

add_outputters, debug_formatter, default_formatter, default_outputter, #logger, #logger_name, parse_level

Constructor Details

This class inherits a constructor from R10K::Module::Base

Class Method Details

.implement?(name, args) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/r10k/module/local.rb', line 10

def self.implement?(name, args)
  args[:local] || args[:type].to_s == 'local'
end

.statically_defined_versionObject



14
15
16
# File 'lib/r10k/module/local.rb', line 14

def self.statically_defined_version(*)
  "0.0.0"
end

Instance Method Details

#propertiesObject



22
23
24
25
26
27
28
# File 'lib/r10k/module/local.rb', line 22

def properties
  {
    :expected => "0.0.0 (local)",
    :actual   => "0.0.0 (local)",
    :type     => :forge,
  }
end

#statusObject



30
31
32
# File 'lib/r10k/module/local.rb', line 30

def status
  :insync
end

#sync(opts = {}) ⇒ Boolean

Returns false, because local modules are always considered in-sync.

Parameters:

  • opts (Hash) (defaults to: {})

    Deprecated

Returns:

  • (Boolean)

    false, because local modules are always considered in-sync



36
37
38
39
# File 'lib/r10k/module/local.rb', line 36

def sync(opts={})
  logger.debug1 _("Module %{title} is a local module, always indicating synced.") % {title: title}
  false
end

#versionObject



18
19
20
# File 'lib/r10k/module/local.rb', line 18

def version
  self.class.statically_defined_version
end