Class: Fig::Command::Action::ListVariables::AllConfigs

Inherits:
Object
  • Object
show all
Includes:
Fig::Command::Action, Role::ListAllConfigs, Role::ListWalkingDependencyTree
Defined in:
lib/fig/command/action/list_variables/all_configs.rb

Constant Summary

Constants included from Fig::Command::Action

EXIT_FAILURE, EXIT_SUCCESS

Instance Attribute Summary

Attributes included from Fig::Command::Action

#execution_context

Instance Method Summary collapse

Methods included from Role::ListWalkingDependencyTree

#configure, #gather_package_dependency_configurations, #modifies_repository?, #walk_dependency_tree

Methods included from Role::ListAllConfigs

#base_display_config_names, #list_all_configs?

Methods included from Fig::Command::Action

#allow_both_descriptor_and_file?, #apply_base_config?, #base_package_can_come_from_descriptor?, #cares_about_asset_options?, #configure, #execute_immediately_after_command_line_parse?, #list_dependencies?, #list_variables?, #modifies_repository?, #prepare_repository, #primary_option, #publish?, #remote_operation_necessary?, #reset_environment?, #retrieves_should_happen?

Instance Method Details

#apply_config?Boolean

Returns:

  • (Boolean)

37
38
39
# File 'lib/fig/command/action/list_variables/all_configs.rb', line 37

def apply_config?()
  return nil # don't care
end

#descriptor_requirementObject


25
26
27
# File 'lib/fig/command/action/list_variables/all_configs.rb', line 25

def descriptor_requirement()
  return nil
end

#executeObject


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/fig/command/action/list_variables/all_configs.rb', line 41

def execute()
  variable_names = Set.new()

  walk_dependency_tree(
    @execution_context.base_package, base_display_config_names()
  ) do
    |package, config_name, depth|

    package[config_name].walk_statements() do |statement|
      if statement.is_environment_variable?
        variable_names << statement.name()
      end
    end
  end

  variable_names.sort.each { |name| puts name }

  return EXIT_SUCCESS
end

#load_base_package?Boolean

Returns:

  • (Boolean)

29
30
31
# File 'lib/fig/command/action/list_variables/all_configs.rb', line 29

def load_base_package?()
  return true
end

#optionsObject


21
22
23
# File 'lib/fig/command/action/list_variables/all_configs.rb', line 21

def options()
  return %w<--list-variables --list-all-configs>
end

#register_base_package?Boolean

Returns:

  • (Boolean)

33
34
35
# File 'lib/fig/command/action/list_variables/all_configs.rb', line 33

def register_base_package?()
  return nil # don't care
end