From 69e0547321bee33deab45dfbfd314c46c361e322 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Fri, 2 Aug 2013 15:58:22 -0500 Subject: [PATCH] Ensure dirs to flog is an array Conflicts: lib/metric_fu/metrics/flay/init.rb --- lib/metric_fu/metrics/flay/init.rb | 3 +-- lib/metric_fu/metrics/flog/flog.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/metric_fu/metrics/flay/init.rb b/lib/metric_fu/metrics/flay/init.rb index 0f6cd73ee..bc5c4b837 100644 --- a/lib/metric_fu/metrics/flay/init.rb +++ b/lib/metric_fu/metrics/flay/init.rb @@ -6,8 +6,7 @@ def name end def default_run_options - { :dirs_to_flay => MetricFu::Io::FileSystem.directory('code_dirs'), # was @code_dirs - + { :dirs_to_flay => MetricFu::Io::FileSystem.directory('code_dirs'), # MetricFu has been setting the minimum score as 100 for # a long time. This is a really big number, considering # the default is 16. Setting it to nil to use the Flay default. diff --git a/lib/metric_fu/metrics/flog/flog.rb b/lib/metric_fu/metrics/flog/flog.rb index ecd449e3a..2fdfe787c 100644 --- a/lib/metric_fu/metrics/flog/flog.rb +++ b/lib/metric_fu/metrics/flog/flog.rb @@ -5,7 +5,7 @@ class Flog < Generator def emit files = [] - options[:dirs_to_flog].each do |directory| + Array(options[:dirs_to_flog]).each do |directory| directory = "." if directory=='./' dir_files = Dir.glob("#{directory}/**/*.rb") dir_files = remove_excluded_files(dir_files)