ruby-watchr 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ module Watchr
13
13
  #
14
14
  # Analysed file data.
15
15
  #
16
- attr_reader :files
16
+ attr_reader :files, :path
17
17
 
18
18
  #
19
19
  # Run the analyse.
@@ -35,6 +35,8 @@ module Watchr
35
35
  file.flay(flay.duplications_by_file(file))
36
36
  }
37
37
  end
38
+
39
+ @path = path
38
40
  end
39
41
  end
40
42
  end
@@ -5,6 +5,9 @@ require 'watchr/location'
5
5
 
6
6
  module Watchr
7
7
  module FlayMetric
8
+ #
9
+ # Adapted Flay report metric.
10
+ #
8
11
  class Report < Flay
9
12
  attr_reader :duplications
10
13
 
@@ -1,4 +1,7 @@
1
1
  module Watchr
2
+ #
3
+ # Flog report class information.
4
+ #
2
5
  class FlogReportClass
3
6
  attr_reader :name, :methods, :total_score, :location
4
7
 
@@ -13,7 +16,7 @@ module Watchr
13
16
  end
14
17
 
15
18
  def total_methods_score
16
- @methods.reduce(0) {|sum, i| sum += i.total_score}
19
+ @methods.reduce(0) {|sum, method| sum += method.total_score}
17
20
  end
18
21
 
19
22
  def add_method(method_report)
data/lib/watchr/rating.rb CHANGED
@@ -1,14 +1,17 @@
1
1
  require 'watchr/smell_types'
2
2
 
3
3
  module Watchr
4
+ #
5
+ # Component responsible to rate a file considering found smells.
6
+ #
4
7
  module Rating
5
8
  include SmellTypes
6
9
 
7
10
  def rating
8
11
  total = smells.reduce(0) {|total, smell| total += rate(smell)}
9
12
 
10
- [200, 140, 90, 50, 20, 0].each_with_index do |limit, i|
11
- return %w(F E D C B A)[i] if total >= limit
13
+ [200, 140, 90, 50, 20, 0].each_with_index do |limit, index|
14
+ return %w(F E D C B A)[index] if total >= limit
12
15
  end
13
16
  end
14
17
 
@@ -1,3 +1,3 @@
1
1
  module Watchr
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -10,4 +10,10 @@ describe Watchr::Analyse do
10
10
  its(:count) { should == 2 }
11
11
  its(:first) { subject.class.should == Watchr::FileAnalyse }
12
12
  end
13
+
14
+ describe '#path' do
15
+ subject { analyse.path }
16
+
17
+ it { should == 'spec/fixtures/' }
18
+ end
13
19
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 8
9
- version: 0.1.8
8
+ - 9
9
+ version: 0.1.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Petr Janda
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-07-28 00:00:00 +02:00
17
+ date: 2012-08-07 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency