Class: Aspera::Cli::Bootstrapper
- Inherits:
-
Object
- Object
- Aspera::Cli::Bootstrapper
- Defined in:
- lib/aspera/cli/bootstrapper.rb
Overview
Performs one-time bootstrap of all shared services into Context. Called by Runner before instantiating Plugins::Config, so that Config acts only as a CLI plugin (option declaration + command handlers).
Responsibilities:
- resolve context.main_folder (option :home)
- populate context.persistency, context.presets, context.http_config, context.
- register plugin lookup folders
- register @preset / @vault extended-value handlers
- configure global singletons: RestParameters, OAuth::Factory, SSL, Transfer::Parameters,
RestErrorAnalyzer
- set up the PAC proxy executor (option :fpac)
Instance Attribute Summary collapse
-
#config_file_option ⇒ Object
Public accessor used as option handler for :config_file.
Instance Method Summary collapse
-
#initialize(context) ⇒ Bootstrapper
constructor
A new instance of Bootstrapper.
-
#run(gem_plugins_folder:, vault_value_cb:) ⇒ Object
Run the full bootstrap sequence.
Constructor Details
#initialize(context) ⇒ Bootstrapper
Returns a new instance of Bootstrapper.
68 69 70 71 72 |
# File 'lib/aspera/cli/bootstrapper.rb', line 68 def initialize(context) Aspera.assert_type(context, Context){'context'} @context = context @pac_exec = nil end |
Instance Attribute Details
#config_file_option ⇒ Object
Public accessor used as option handler for :config_file
92 93 94 |
# File 'lib/aspera/cli/bootstrapper.rb', line 92 def config_file_option @config_file_option end |
Instance Method Details
#run(gem_plugins_folder:, vault_value_cb:) ⇒ Object
Run the full bootstrap sequence. Must be called after context.options and context.formatter are set. On return, context.persistency, context.presets, context.http_config and context.progress_bar are populated and all global singletons are configured.
81 82 83 84 85 86 87 88 89 |
# File 'lib/aspera/cli/bootstrapper.rb', line 81 def run(gem_plugins_folder:, vault_value_cb:) setup_main_folder setup_persistency_and_plugin_folders(gem_plugins_folder) setup_config_file setup_extended_value_handlers(vault_value_cb) setup_pac_executor setup_rest_and_transfer_runtime end |