module PoiseApplicationPython::ServiceMixin::Provider

A helper mixin for Python service providers.

Public Instance Methods

service_options(resource) click to toggle source

Set up the service for running Python stuff.

Calls superclass method
# File lib/poise_application_python/service_mixin.rb, line 43
def service_options(resource)
  super
  # Closure scoping for #python_command below.
  self_ = self
  # Create a new singleton method that fills in Python for you.
  resource.define_singleton_method(:python_command) do |val|
    resource.command("#{self_.new_resource.python} #{PoiseLanguages::Utils.absolute_command(val, path: self_.new_resource.app_state_environment_python['PATH'])}")
  end
  # Include env vars as needed.
  resource.environment.update(new_resource.parent_python.python_environment) if new_resource.parent_python
end