Sha256: 3fafa1ec26027d0b0490c8522a4febcda3258d4dc12592e604b792512a46b646

Contents?: true

Size: 789 Bytes

Versions: 10

Compression:

Stored size: 789 Bytes

Contents

require "rubygems"
require 'dep_analyzer'

# :stopdoc:

class RakeAnalyzer < DepAnalyzer
  def run
    digraph do
      rotate
      boxes

      current = nil
      rake = Gem.bin_path('rake', 'rake') rescue 'rake'
      path = $:.join File::PATH_SEPARATOR

      content =
        if $stdin.tty? then
          `#{Gem.ruby} -I#{path} -S #{rake} -P -s`
        else
          $stdin.read
        end

      content.each_line do |line|
        case line
        when /^rake (.+)/
          name = $1
          current = name
          node current if current
        when /^\s+(.+)/
          dep = $1
          next if current =~ /pkg/ and File.file? dep
          edge current, dep if current
        else
          warn "unparsed: #{line.chomp}"
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
graph-2.9.1 lib/rake_analyzer.rb
graph-2.9.0 lib/rake_analyzer.rb
graph-2.8.2 lib/rake_analyzer.rb
graph-2.8.1 lib/rake_analyzer.rb
graph-2.8.0 lib/rake_analyzer.rb
graph-2.7.1 lib/rake_analyzer.rb
graph-2.7.0 lib/rake_analyzer.rb
graph-2.6.0 lib/rake_analyzer.rb
graph-2.5.3 lib/rake_analyzer.rb
graph-2.5.2 lib/rake_analyzer.rb