code_statistics 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{code_statistics}
8
- s.version = "0.2.4"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Mayer"]
@@ -146,8 +146,9 @@ module CodeStatistics
146
146
 
147
147
  def print_line(name, statistics)
148
148
  m_over_c = (statistics["methods"] / statistics["classes"]) rescue m_over_c = 0
149
- loc_over_m = (statistics["codelines"] / statistics["methods"]) - 2 rescue loc_over_m = 0
150
-
149
+ loc_over_m = (statistics["codelines"] / statistics["methods"]) rescue loc_over_m = 0
150
+ loc_over_m = love_over_m - 2 if loc_over_m >= 2
151
+
151
152
  start = if test_types.include? name
152
153
  "| #{name.ljust(20)} "
153
154
  else
@@ -22,7 +22,7 @@ class CodeStatisticsTest < Test::Unit::TestCase
22
22
  controllers_dir = dir.directory("controllers")
23
23
  file = controllers_dir.file("fake.rb", "this\nis\n\lame\n")
24
24
  code_stats = CodeStatistics::CodeStatistics.new([])
25
- assert code_stats.to_s.match(/App\/controllers/)
25
+ assert code_stats.to_s.match(/app\/controllers/)
26
26
  assert code_stats.to_s.match(/Code LOC: 3/)
27
27
  end
28
28
  end
@@ -33,7 +33,7 @@ class CodeStatisticsTest < Test::Unit::TestCase
33
33
  sub_dir = dir.directory("servers")
34
34
  file = sub_dir.file("fake.rb", "this\nis\n\lame\n")
35
35
  code_stats = CodeStatistics::CodeStatistics.new([])
36
- assert code_stats.to_s.match(/App\/servers/)
36
+ assert code_stats.to_s.match(/app\/servers/)
37
37
  assert code_stats.to_s.match(/Code LOC: 3/)
38
38
  end
39
39
  end
@@ -46,8 +46,8 @@ class CodeStatisticsTest < Test::Unit::TestCase
46
46
  sub_dir2 = dir.directory("controllers")
47
47
  file = sub_dir2.file("fake.rb", "this\nis\n\lame\n")
48
48
  code_stats = CodeStatistics::CodeStatistics.new([])
49
- assert code_stats.to_s.match(/Spec\/models/)
50
- assert code_stats.to_s.match(/Spec\/controllers/)
49
+ assert code_stats.to_s.match(/spec\/models/)
50
+ assert code_stats.to_s.match(/spec\/controllers/)
51
51
  assert code_stats.to_s.match(/Test LOC: 6/)
52
52
  end
53
53
  end
@@ -57,7 +57,7 @@ class CodeStatisticsTest < Test::Unit::TestCase
57
57
  dir = construct.directory("spec")
58
58
  file = dir.file("fake.rb", "this\nis\n\lame\n")
59
59
  code_stats = CodeStatistics::CodeStatistics.new([])
60
- assert code_stats.to_s.match(/Spec/)
60
+ assert code_stats.to_s.match(/spec/)
61
61
  assert code_stats.to_s.match(/Test LOC: 3/)
62
62
  end
63
63
  end
@@ -70,8 +70,8 @@ class CodeStatisticsTest < Test::Unit::TestCase
70
70
  sub_dir2 = dir.directory("controllers")
71
71
  file = sub_dir2.file("fake.rb", "this\nis\n\lame\n")
72
72
  code_stats = CodeStatistics::CodeStatistics.new([])
73
- assert code_stats.to_s.match(/Test\/models/)
74
- assert code_stats.to_s.match(/Test\/controllers/)
73
+ assert code_stats.to_s.match(/test\/models/)
74
+ assert code_stats.to_s.match(/test\/controllers/)
75
75
  assert code_stats.to_s.match(/Test LOC: 6/)
76
76
  end
77
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_statistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Mayer