Sha256: 5c2c239d1389dbba98b4fd1dd39115dcf5c501aa0f00e9807fe65551764001fd

Contents?: true

Size: 1.66 KB

Versions: 3

Compression:

Stored size: 1.66 KB

Contents

# ==========================================================================
#  Construction de la tache roodi (problemes de conception dans le code)
#  author: Vincent Dubois
#  date: 08 fevrier 2009
# ==========================================================================
class RoodiBuilder
  include Utils

  # Implementation de la construction de la tache
  def build(project_name, auto_install, proxy_option)
    # On verifie la presence de roodi
    Utils.verify_gem_presence("roodi", auto_install, proxy_option)
    # On lance la generation
    puts " Building roodi report..."
    files = Array.new
    files << Dir.glob("app/**/*.rb")
    files << Dir.glob("lib/**/*.rb")
    files << Dir.glob("test/**/*.rb")
    files.flatten!
    roodi_command = "roodi"
    files.each do |file|
      roodi_command += " '#{file}'"
    end
    roodi_result = Utils.run_command(roodi_command)
    matches = roodi_result.chomp.split("\n").map{|m| m.split(" - ") }
    FileUtils.mkdir("#{Continuous4r::WORK_DIR}/roodi")
    roodi_file = File.open("#{Continuous4r::WORK_DIR}/roodi/index.html","w")
    matches.each_with_index do |match, count|
      roodi_file.write("<tr class='#{count % 2 == 0 ? "a" : "b"}'>")
      if match.first and match.first.index("Found ").nil?
        roodi_file.write("<td><a href='xdoclet/#{match.first.split(':').first.gsub(/\//,'_')}.html' target='_blank'>#{match.first.split(':').first}</a></td>")
      elsif match.first and !match.first.index("Found ").nil?
        roodi_file.write("<td><b>#{match.first}</b></td>")
      else
        roodi_file.write("<td>&#160;</td>")
      end
      roodi_file.write("<td>#{match[1]}</td></tr>")
    end
    roodi_file.close
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
continuous4r-0.0.2 lib/roodi_builder.rb
continuous4r-0.0.3 lib/roodi_builder.rb
continuous4r-0.0.4 lib/roodi_builder.rb