Sha256: d7c5d0b36c4934343588cb9d3e7cd99c7d44a5f3fe5d86fb72b63f85b2e60122

Contents?: true

Size: 1.27 KB

Versions: 30

Compression:

Stored size: 1.27 KB

Contents

require 'set'

require 'fig/command/action'
require 'fig/command/action/role/list_all_configs'
require 'fig/command/action/role/list_walking_dependency_tree'
require 'fig/statement/path'
require 'fig/statement/set'

module  Fig; end
class   Fig::Command; end
module  Fig::Command::Action; end
class   Fig::Command::Action::ListVariables; end

class Fig::Command::Action::ListVariables::AllConfigs
  include Fig::Command::Action
  include Fig::Command::Action::Role::ListAllConfigs
  include Fig::Command::Action::Role::ListWalkingDependencyTree

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

  def descriptor_requirement()
    return nil
  end

  def load_base_package?()
    return true
  end

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

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

  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
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
fig-1.10.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.9.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.8.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.7.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.6.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.5.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.4.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.3.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.2.0 lib/fig/command/action/list_variables/all_configs.rb
fig-1.1.0 lib/fig/command/action/list_variables/all_configs.rb