Module: PoiseApplicationPython::ServiceMixin::Provider
- Includes:
- PoiseApplication::ServiceMixin::Provider, AppMixin::Provider
- Defined in:
- lib/poise_application_python/service_mixin.rb
Overview
A helper mixin for Python service providers.
Instance Method Summary collapse
-
#service_options(resource) ⇒ Object
Set up the service for running Python stuff.
Instance Method Details
#service_options(resource) ⇒ Object
Set up the service for running Python stuff.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/poise_application_python/service_mixin.rb', line 43 def (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 |