Stats generator was crashing if 'rake stats' outputted any blank lines #59

Closed
wants to merge 1 commit into
from
View
@@ -26,8 +26,7 @@ def to_h
def remove_noise(output)
lines = output.split("\n")
- lines = lines.find_all {|line| line[0].chr != "+" }
- lines = lines.find_all {|line| line[0].chr != "(" }
+ lines.reject! { |line| line.empty? || ['+', '('].include?(line[0].chr) }
lines.shift
lines
end
@@ -13,7 +13,17 @@
describe "analyze method" do
before :each do
- @lines = <<-HERE.gsub(/^\s*/, "")
+ @lines = <<-HERE
+ The 'run' provides a unified access point for all the default Rails' commands.
+
+ Usage: ./script/run <command> [OPTIONS]
+
+ Examples:
+ ./script/run generate controller Admin
+ ./script/run process reaper
+
+ Choose: about, console, dbconsole, destroy, generate, plugin, runner, server, update
+
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+