Class: PoiseLanguages::System::Resource Private
- Inherits:
-
Chef::Resource
- Object
- Chef::Resource
- PoiseLanguages::System::Resource
- Includes:
- Poise
- Defined in:
- lib/poise_languages/system/resource.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A ‘poise_language_system` resource to manage installing a language from system packages. This is an internal implementation detail of poise-languages.
Instance Attribute Summary collapse
-
#dev_package ⇒ String, false
Name of the development headers package, or false to disable installing headers.
-
#dev_package_overrides ⇒ Hash<String, String>
A hash of override names for dev packages that don’t match the normal naming scheme.
-
#package_name ⇒ String
Name of the main package for the language.
-
#package_version ⇒ String?
Version of the package(s) to install.
-
#parent ⇒ Chef::Resource
Resource for the language runtime.
Instance Method Summary collapse
-
#default_dev_package ⇒ String
private
Compute the default package name for the development headers.
Instance Attribute Details
#dev_package ⇒ String, false
Name of the development headers package, or false to disable installing headers. By default computed from #package_name.
47 |
# File 'lib/poise_languages/system/resource.rb', line 47 attribute(:dev_package, kind_of: [String, FalseClass], default: lazy { default_dev_package }) |
#dev_package_overrides ⇒ Hash<String, String>
A hash of override names for dev packages that don’t match the normal naming scheme.
52 |
# File 'lib/poise_languages/system/resource.rb', line 52 attribute(:dev_package_overrides, kind_of: Hash, default: lazy { {} }) |
#package_name ⇒ String
Name of the main package for the language.
42 |
# File 'lib/poise_languages/system/resource.rb', line 42 attribute(:package_name, kind_of: String, name_attribute: true) |
#package_version ⇒ String?
Version of the package(s) to install. This is distinct from version, and is the specific version package version, not the language version. By default this is unset meaning the latest version will be used.
58 |
# File 'lib/poise_languages/system/resource.rb', line 58 attribute(:package_version, kind_of: [String, NilClass]) |
#parent ⇒ Chef::Resource
Resource for the language runtime. Used only for messages.
62 |
# File 'lib/poise_languages/system/resource.rb', line 62 attribute(:parent, kind_of: Chef::Resource, required: true) |
Instance Method Details
#default_dev_package ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Compute the default package name for the development headers.
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/poise_languages/system/resource.rb', line 72 def default_dev_package # Check for an override. return dev_package_overrides[package_name] if dev_package_overrides.include?(package_name) suffix = node.value_for_platform_family(debian: '-dev', rhel: '-devel', fedora: '-devel') # Platforms like Arch and Gentoo don't need this anyway. I've got no # clue how Amazon Linux does this. if suffix package_name + suffix else nil end end |