Sha256: bf813bb5a8e1a7399d2a89e3bab0175ac193a22f0d67e464979a5b6b7eb786ab

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

# frozen_string_literal: true

module Bundler
  module Dependencies
    module Visitors
      class ShellTree
        def walk(graph, shell = nil)
          Visitor.walk(graph) do |gem, depth|
            if depth > 0
              print '  ' * depth
              print '- '
            end

            say(shell, gem.name, (:bold if depth == 0))
          end

          nil
        end

        private

        def say(shell, message, opts)
          if shell
            shell.say(message, opts)
          else
            puts message
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bundler-dependencies-1.0.0 lib/bundler/dependencies/visitors/shell_tree.rb