Puppet Class: ruby::rubygems

Inherits:
ruby
Defined in:
manifests/rubygems.pp

Overview

Class: ruby::rubygems

This class installs ruby::rubygems It can be include directly or from ruby class.

Parameters

version

The package version, used in the ensure parameter of package type. Default: present. Can be ‘latest’ or a specific version number. Note that if the argument absent (see below) is set to true, the package is removed, whatever the value of version parameter.

absent

Set to ‘true’ to remove package(s) installed by module Can be defined also by the (top scope) variable $ruby_absent

noops

Set noop metaparameter to true for all the resources managed by the module. Basically you can run a dryrun for this specific module if you set this to true. Default: undef

package

The name of ruby package

Parameters:

  • version (Any) (defaults to: 'present')
  • absent (Any) (defaults to: false)
  • noops (Any) (defaults to: undef)
  • package (Any) (defaults to: $ruby::package_rubygems)


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'manifests/rubygems.pp', line 26

class ruby::rubygems (
  $version             = 'present',
  $absent              = false,
  $noops               = undef,
  $package             = $ruby::package_rubygems
  ) inherits ruby {

  $bool_absent=any2bool($absent)

  ### Definition of some variables used in the module
  $manage_package = $bool_absent ? {
    true  => 'absent',
    false => $version,
  }

  ### Managed resources

  if $ruby::package_rubygems {
    if ! defined(Package[$ruby::package_rubygems]) {
      package { $ruby::package_rubygems:
        ensure => $manage_package,
        noop   => $noops,
      }
    }
  }
}