class PoiseJavascript::JavascriptProviders::Base

Public Class Methods

default_inversion_options(node, new_resource) click to toggle source

Set default inversion options.

@api private

Calls superclass method
# File lib/poise_javascript/javascript_providers/base.rb, line 29
def self.default_inversion_options(node, new_resource)
  super.merge({
    version: new_resource.version,
  })
end

Public Instance Methods

action_install() click to toggle source

The `install` action for the `javascript_runtime` resource.

@return [void]

# File lib/poise_javascript/javascript_providers/base.rb, line 38
def action_install
  notifying_block do
    install_javascript
  end
end
action_uninstall() click to toggle source

The `uninstall` action for the `javascript_runtime` resource.

@abstract @return [void]

# File lib/poise_javascript/javascript_providers/base.rb, line 48
def action_uninstall
  notifying_block do
    uninstall_javascript
  end
end
javascript_binary() click to toggle source

The path to the `javascript` binary. This is an output property.

@abstract @return [String]

# File lib/poise_javascript/javascript_providers/base.rb, line 58
def javascript_binary
  raise NotImplementedError
end
javascript_environment() click to toggle source

The environment variables for this Javascript. This is an output property.

@return [Hash<String, String>]

# File lib/poise_javascript/javascript_providers/base.rb, line 65
def javascript_environment
  {}
end
npm_binary() click to toggle source

The path to the `npm` binary. This is an output property.

@abstract @return [String]

# File lib/poise_javascript/javascript_providers/base.rb, line 73
def npm_binary
  ::File.expand_path(::File.join('..', 'npm'), javascript_binary)
end

Private Instance Methods

install_javascript() click to toggle source

Install the Javascript runtime. Must be implemented by subclass.

@abstract @return [void]

# File lib/poise_javascript/javascript_providers/base.rb, line 83
def install_javascript
  raise NotImplementedError
end
uninstall_javascript() click to toggle source

Uninstall the Javascript runtime. Must be implemented by subclass.

@abstract @return [void]

# File lib/poise_javascript/javascript_providers/base.rb, line 91
def uninstall_javascript
  raise NotImplementedError
end