Sha256: 3900646060ee89c4395dc5413a783e004d056c3f26b62b5a589643513f30a079

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

# encoding: UTF-8
require 'rake_check/rbp_checker'
require 'rake_check/rspec_checker'
require 'rake_check/reek_checker'
require 'rake_check/yard_checker'
require 'rake_check/cane_checker'
##
# Do exakt what it is called
#
# @param [String] string The string to print
# @author dmasur
def puts_unless_empty string
  puts string unless string.empty?
end

##
# Print the check results
#
# @param [Array / Hash] results Array of Results or Hashresult
# @author dmasur
def print_check_result results
  print_outputs results
  print_summary results
end

##
# Print Outputs of each result
#
# @author dmasur
def print_outputs results
  results.each do |result|
    puts_unless_empty result[:check_output]
  end
end

##
# Print Summary of all Outputs
#
# @author dmasur
def print_summary results
  results.each do |result|
    puts "#{result[:type]}:\t#{result[:status]}"
  end
end

desc "Check all Metric tools"
task :check do
  results  ||= []
  Dir["spec*"].each do |spec_dir|
    results << RspecChecker.new.result(spec_dir)
  end
  results << RbpChecker.new.result
  results << YardChecker.new.result
  results << ReekChecker.new.result
  results << CaneChecker.new.result
  print_check_result results
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rake_check-0.1.3 lib/rake_check/tasks/check.rake