Class: Avm::Launcher::Context
- Includes:
- EacRubyUtils::SimpleCache
- Defined in:
- lib/avm/launcher/context.rb,
lib/avm/launcher/context/settings.rb,
lib/avm/launcher/context/instance_manager.rb,
lib/avm/launcher/context/instance_discovery.rb,
lib/avm/launcher/context/instance_manager/cached_instance.rb,
lib/avm/launcher/context/instance_manager/cached_instances.rb
Defined Under Namespace
Classes: InstanceDiscovery, InstanceManager, Settings
Constant Summary collapse
- DEFAULT_PROJECTS_ROOT =
'.'
- DEFAULT_SETTINGS_FILE =
::File.join(ENV['HOME'], '.config', 'eac_launcher', 'settings.yml')
- DEFAULT_CACHE_ROOT =
::File.join(ENV['HOME'], '.cache', 'eac_launcher')
Class Attribute Summary collapse
Instance Attribute Summary collapse
-
#cache_root ⇒ Object
readonly
Returns the value of attribute cache_root.
-
#instance_manager ⇒ Object
Returns the value of attribute instance_manager.
-
#publish_options ⇒ Object
Returns the value of attribute publish_options.
-
#recache ⇒ Object
Returns the value of attribute recache.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Context
constructor
A new instance of Context.
- #instance(name) ⇒ Object
- #instances ⇒ Object
- #pending_instances ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Context
Returns a new instance of Context.
37 38 39 40 41 42 43 44 45 |
# File 'lib/avm/launcher/context.rb', line 37 def initialize( = {}) @options = .with_indifferent_access @root = ::Avm::Launcher::Paths::Logical.new(self, nil, build_option(:projects_root), '/') @settings = ::Avm::Launcher::Context::Settings.new(build_option(:settings_file)) @cache_root = build_option(:cache_root) @publish_options = { new: false, confirm: false, stereotype: nil } @instance_manager = ::Avm::Launcher::Context::InstanceManager.new(self) @recache = false end |
Class Attribute Details
.current ⇒ Object
25 26 27 |
# File 'lib/avm/launcher/context.rb', line 25 def current @current ||= default end |
Instance Attribute Details
#cache_root ⇒ Object (readonly)
Returns the value of attribute cache_root.
34 35 36 |
# File 'lib/avm/launcher/context.rb', line 34 def cache_root @cache_root end |
#instance_manager ⇒ Object
Returns the value of attribute instance_manager.
35 36 37 |
# File 'lib/avm/launcher/context.rb', line 35 def instance_manager @instance_manager end |
#publish_options ⇒ Object
Returns the value of attribute publish_options.
35 36 37 |
# File 'lib/avm/launcher/context.rb', line 35 def @publish_options end |
#recache ⇒ Object
Returns the value of attribute recache.
35 36 37 |
# File 'lib/avm/launcher/context.rb', line 35 def recache @recache end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
34 35 36 |
# File 'lib/avm/launcher/context.rb', line 34 def root @root end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
34 35 36 |
# File 'lib/avm/launcher/context.rb', line 34 def settings @settings end |
Class Method Details
Instance Method Details
#instance(name) ⇒ Object
47 48 49 |
# File 'lib/avm/launcher/context.rb', line 47 def instance(name) instances.find { |i| i.name == name } end |
#instances ⇒ Object
51 52 53 |
# File 'lib/avm/launcher/context.rb', line 51 def instances @instance_manager.instances end |
#pending_instances ⇒ Object
55 56 57 |
# File 'lib/avm/launcher/context.rb', line 55 def pending_instances @instance_manager.pending_instances end |