Class: PoiseJavascript::Resources::NodePackage::Resource

Inherits:
Chef::Resource::Package
  • Object
show all
Includes:
JavascriptCommandMixin
Defined in:
lib/poise_javascript/resources/node_package.rb

Overview

A node_package resource to manage Node.js packages using npm.

Examples:

node_package 'express' do
  javascript '0.10'
  version '1.8.3'
end

Since:

  • 1.0.0

Provides:

  • node_package

Actions:

  • install

  • upgrade

  • uninstall

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Resource

Returns a new instance of Resource.

Since:

  • 1.0.0



67
68
69
70
71
72
73
74
# File 'lib/poise_javascript/resources/node_package.rb', line 67

def initialize(*args)
  super
  # For older Chef.
  @resource_name = :node_package
  # We don't have these actions.
  @allowed_actions.delete(:purge)
  @allowed_actions.delete(:reconfig)
end

Instance Attribute Details

#groupString, ...

System group to install the package.

Returns:

  • (String, Integer, nil)


53
# File 'lib/poise_javascript/resources/node_package.rb', line 53

attribute(:group, kind_of: [String, Integer, NilClass])

#pathString, ...

Path to install the package in to. If unset install using --global.

Returns:

  • (String, nil, false)


57
# File 'lib/poise_javascript/resources/node_package.rb', line 57

attribute(:path, kind_of: [String, NilClass, FalseClass])

#unsafe_permBoolean?

Enable --unsafe-perm.

Returns:

  • (Boolean, nil)


61
# File 'lib/poise_javascript/resources/node_package.rb', line 61

attribute(:unsafe_perm, equal_to: [true, false, nil], default: true)

#userString, ...

System user to install the package.

Returns:

  • (String, Integer, nil)


65
# File 'lib/poise_javascript/resources/node_package.rb', line 65

attribute(:user, kind_of: [String, Integer, NilClass])