Class: PoiseApplicationPython::Resources::Virtualenv::Resource

Inherits:
PoisePython::Resources::PythonVirtualenv::Resource
  • Object
show all
Includes:
AppMixin
Defined in:
lib/poise_application_python/resources/virtualenv.rb

Overview

An application_virtualenv resource to manage Python virtual environments inside an Application cookbook deployment.

Examples:

application '/app' do
  virtualenv
end

Since:

  • 4.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathString

Override the normal path property to use name/.virtualenv for better compatibility with the application resource DSL.

Returns:

  • (String)


49
# File 'lib/poise_application_python/resources/virtualenv.rb', line 49

attribute(:path, kind_of: String, default: lazy { default_path })

Instance Method Details

#after_createdObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Set this resource as the app_state's parent python.

Since:

  • 4.0.0



54
55
56
57
58
59
60
# File 'lib/poise_application_python/resources/virtualenv.rb', line 54

def after_created
  super.tap do |val|
    # Force evaluation so we get any current parent if set.
    parent_python
    app_state_python(self)
  end
end