lib/gem_leaves.rb
def diagrammatical_output
    diagram = "digraph leaves_diagram {\n"
    Gem::Specification.all.each do |g|
      if @options[:reverse]
        g.dependent_gems.each {|d| diagram << %Q(  "#{d[0].full_name}" -> "#{g.full_name}"\n)}
      else
        g.dependent_gems.each {|d| diagram << %Q(  "#{g.full_name}" -> "#{d[0].full_name}"\n)}
      end
      if g.dependent_gems.empty?
        str = %Q(  "#{g.full_name}")
        if @leaves.include?(g)
          str += %Q( [color="##{@options[:color]}", style=filled]\n)
        else
          str += "\n"
        end
        diagram << str
      end
    end
    diagram << "}"
    puts diagram
  end
# Build a DOT diagram of the installed gems, highlighting the leaves with
# a customizable color, leaving those gems that *must* be kept according
# to the current configuration in the standard color.
Build a DOT diagram of the installed gems, highlighting the leaves with
a customizable color, leaving those gems that *must* be kept according
to the current configuration in the standard color.
Build a DOT diagram of the installed gems highlighting the leaves with a customizable color leaving those gems that * must * be kept according to the current configuration in the standard color .
def diagrammatical_output
    diagram = "digraph leaves_diagram {\n"
    Gem::Specification.all.each do |g|
      if @options[:reverse]
        g.dependent_gems.each {|d| diagram << %Q(  "#{d[0].full_name}" -> "#{g.full_name}"\n)}
      else
        g.dependent_gems.each {|d| diagram << %Q(  "#{g.full_name}" -> "#{d[0].full_name}"\n)}
      end
      if g.dependent_gems.empty?
        str = %Q(  "#{g.full_name}")
        if @leaves.include?(g)
          str += %Q( [color="##{@options[:color]}", style=filled]\n)
        else
          str += "\n"
        end
        diagram << str
      end
    end
    diagram << "}"
    puts diagram
  end
def diagrammatical_output diagram = "digraph leaves_diagram {\n" Gem :: Specification . all . each do | g | if @options [ :reverse ] g . dependent_gems . each { | d | diagram << %Q(  "#{d[0].full_name}" -> "#{g.full_name}"\n) } else g . dependent_gems . each { | d | diagram << %Q(  "#{g.full_name}" -> "#{d[0].full_name}"\n) } end if g . dependent_gems . empty? str = %Q(  "#{g.full_name}") if @leaves . include? ( g ) str += %Q( [color="##{@options[:color]}", style=filled]\n) else str += "\n" end diagram << str end end diagram << "}" puts diagram end
Build a DOT diagram of the installed gems, highlighting the leaves with
a customizable color, leaving those gems that *must* be kept according
to the current configuration in the standard color.
Build a DOT diagram of the installed gems highlighting the leaves with a customizable color leaving those gems that * must * be kept according to the current configuration in the standard color .