Module: Fig::Command::Action::Role::ListWalkingDependencyTree

Instance Method Summary collapse

Instance Method Details

#configure(options) ⇒ Object


28
29
30
# File 'lib/fig/command/action/role/list_walking_dependency_tree.rb', line 28

def configure(options)
  @descriptor = options.descriptor
end

#gather_package_dependency_configurationsObject


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/fig/command/action/role/list_walking_dependency_tree.rb', line 32

def gather_package_dependency_configurations()
  packages = {}
  starting_config_names = base_display_config_names()
  base_package = @execution_context.base_package

  if ! base_package.name.nil?
    packages[base_package] = starting_config_names.to_set
  end

  do_walk_dependency_tree(base_package, starting_config_names, nil, 0, nil) do
    |package, config_name, depth|

    if (
          ! package.name.nil?           \
      &&  ! (
                ! list_all_configs?    \
            &&  @descriptor                     \
            &&  package.name == @descriptor.name
          )
    )
      packages[package] ||= Set.new
      packages[package] << config_name
    end
  end

  if ! list_all_configs? && @descriptor
    packages.reject! do |package, config_names|
      package.name == @descriptor.name
    end
  end

  return packages
end

#modifies_repository?Boolean

Returns:

  • (Boolean)

14
15
16
# File 'lib/fig/command/action/role/list_walking_dependency_tree.rb', line 14

def modifies_repository?()
  return false
end

#walk_dependency_tree(base_package, config_names, include_block = nil, &package_block) ⇒ Object


18
19
20
21
22
23
24
25
26
# File 'lib/fig/command/action/role/list_walking_dependency_tree.rb', line 18

def walk_dependency_tree(
  base_package, config_names, include_block = nil, &package_block
)
  do_walk_dependency_tree(
    base_package, config_names, nil, 0, include_block, &package_block
  )

  return
end