class PoiseJavascript::Resources::JavascriptExecute::Provider

The default provider for `javascript_execute`.

@see Resource @provides javascript_execute

Private Instance Methods

command() click to toggle source

Command to pass to shell_out.

@return [String, Array<String>]

# File lib/poise_javascript/resources/javascript_execute.rb, line 57
def command
  if new_resource.command.is_a?(Array)
    [new_resource.javascript] + new_resource.command
  else
    "#{new_resource.javascript} #{new_resource.command}"
  end
end
environment() click to toggle source

Environment variables to pass to shell_out.

@return [Hash]

# File lib/poise_javascript/resources/javascript_execute.rb, line 68
def environment
  if new_resource.parent_javascript
    environment = new_resource.parent_javascript.javascript_environment
    if new_resource.environment
      environment = environment.merge(new_resource.environment)
    end
    environment
  else
    new_resource.environment
  end
end