lib/bundler/stats/remover.rb
# TODO: woo naive algorithm
# TODO: circular dependencies would be an issue here
# TODO: also probably use something like transitive_dependencies
# to leverage the abilities in tree...
woo naive algorithm
TODO: circular dependencies would be an issue here
TODO: also probably use something like transitive_dependencies
to leverage the abilities in tree
woo naive algorithm TODO : circular dependencies would be an issue here TODO : also probably use something like transitive_dependencies to leverage the abilities in tree
def still_used?(target, deleted: nil)
    modified_tree = @tree.tree.clone
    modified_tree.delete(deleted)
    deps_to_check = (@top_level - [Gem::Dependency.new(deleted)])
    while !deps_to_check.empty? do
      candidate = deps_to_check.pop.name
      next if candidate == deleted
      next if candidate == "bundler"
      return true if candidate == target
      if modified_tree[candidate].nil?
        warn_of_bad_tracing(candidate)
      else
        deps_to_check += modified_tree[candidate].dependencies
      end
    end
    false
  end
def still_used? ( target , deleted : nil ) modified_tree = @tree . tree . clone modified_tree . delete ( deleted ) deps_to_check = ( @top_level - [ Gem :: Dependency . new ( deleted ) ] ) while ! deps_to_check . empty? do candidate = deps_to_check . pop . name next if candidate == deleted next if candidate == "bundler" return true if candidate == target if modified_tree [ candidate ] . nil? warn_of_bad_tracing ( candidate ) else deps_to_check += modified_tree [ candidate ] . dependencies end end false end
TODO: woo naive algorithm
TODO: circular dependencies would be an issue here
TODO: also probably use something like transitive_dependencies
to leverage the abilities in tree...
TODO : woo naive algorithm TODO : circular dependencies would be an issue here TODO : also probably use something like transitive_dependencies to leverage the abilities in tree ...
target
<not_specific>
deleted
<not_specific>