Sha256: ae5d444daa028a311e3fe6510453d364fa42ccaf251b03fc9fdb3a690cd48a12

Contents?: true

Size: 681 Bytes

Versions: 15

Compression:

Stored size: 681 Bytes

Contents

module MetricFu
  class Roodi < Generator
    def emit
      files_to_analyze = MetricFu.roodi[:dirs_to_roodi].map{|dir| Dir[File.join(dir, "**/*.rb")] }
      @output = `roodi #{files_to_analyze.join(" ")}`
    end

    def analyze
      @matches = @output.chomp.split("\n").map{|m| m.split(" - ") }
      total = @matches.pop
      @matches.reject! {|array| array.empty? }
      @matches.map! do |match|
        file, line = match[0].split(':')
        problem = match[1]
        {:file => file, :line => line, :problem => problem}
      end
      @roodi_results = {:total => total, :problems => @matches}
    end

    def to_h
      {:roodi => @roodi_results}
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
edouard-metric_fu-1.0.3.3 lib/generators/roodi.rb
edouard-metric_fu-1.0.3.4 lib/generators/roodi.rb
edouard-metric_fu-1.0.3.5 lib/generators/roodi.rb
edouard-metric_fu-1.0.3.6 lib/generators/roodi.rb
edouard-metric_fu-1.0.3.7 lib/generators/roodi.rb
edouard-metric_fu-1.0.3.8 lib/generators/roodi.rb
edouard-metric_fu-1.0.4.1 lib/generators/roodi.rb
edouard-metric_fu-1.0.4.2 lib/generators/roodi.rb
edouard-metric_fu-1.0.4.3 lib/generators/roodi.rb
edouard-metric_fu-1.0.4.4 lib/generators/roodi.rb
edouard-metric_fu-1.0.4.5 lib/generators/roodi.rb
edouard-metric_fu-1.0.4 lib/generators/roodi.rb
jscruggs-metric_fu-1.0.2 lib/generators/roodi.rb
khall-metric_fu-1.0.2.1 lib/generators/roodi.rb
khall-metric_fu-1.0.2.2 lib/generators/roodi.rb