ruby-watchr 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  require 'watchr/smell'
2
+ require 'watchr/smell_types'
2
3
 
3
4
  module Watchr
4
5
  module Analysers
data/lib/watchr/smell.rb CHANGED
@@ -1,8 +1,7 @@
1
- require 'watchr/smell_types'
2
-
3
1
  module Watchr
4
2
  class Smell
5
- include SmellTypes
3
+ attr_reader :type, :locations, :description, :context
4
+ attr_accessor :details
6
5
 
7
6
  def initialize(type, context, description)
8
7
  @type = type
@@ -11,30 +10,6 @@ module Watchr
11
10
  @locations = []
12
11
  end
13
12
 
14
- def type
15
- @type
16
- end
17
-
18
- def locations
19
- @locations
20
- end
21
-
22
- def description
23
- @description
24
- end
25
-
26
- def context
27
- @context
28
- end
29
-
30
- def details
31
- @details
32
- end
33
-
34
- def details=(details)
35
- @details = details
36
- end
37
-
38
13
  def add_location(location)
39
14
  @locations << location
40
15
  end
@@ -8,7 +8,7 @@ module Watchr
8
8
  attr_reader :smell
9
9
 
10
10
  def initialize(type, context, description)
11
- assert_smell_type(type)
11
+ assert_valid_smell_type(type)
12
12
 
13
13
  @smell = Smell.new(type, context, description)
14
14
  end
@@ -23,7 +23,7 @@ module Watchr
23
23
 
24
24
  private
25
25
 
26
- def assert_smell_type(type)
26
+ def assert_valid_smell_type(type)
27
27
  raise "Invalid smell type '#{type}'" \
28
28
  unless ALL_SMELLS.include?(type)
29
29
  end
@@ -15,6 +15,7 @@ module Watchr
15
15
  :control_couple,
16
16
  :data_clump,
17
17
  :duplication,
18
+ :duplicate_method_call,
18
19
  :feature_envy,
19
20
  :irresponsible_module,
20
21
  :large_class,
@@ -1,3 +1,3 @@
1
1
  module Watchr
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Petr Janda