reek 1.0.0 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/History.txt +56 -22
  2. data/config/defaults.reek +3 -5
  3. data/lib/reek.rb +1 -1
  4. data/lib/reek/block_context.rb +27 -5
  5. data/lib/reek/class_context.rb +5 -9
  6. data/lib/reek/code_parser.rb +23 -50
  7. data/lib/reek/method_context.rb +18 -12
  8. data/lib/reek/module_context.rb +1 -1
  9. data/lib/reek/name.rb +8 -1
  10. data/lib/reek/object_refs.rb +2 -3
  11. data/lib/reek/object_source.rb +53 -0
  12. data/lib/reek/report.rb +41 -2
  13. data/lib/reek/sexp_formatter.rb +4 -46
  14. data/lib/reek/smells/large_class.rb +27 -8
  15. data/lib/reek/smells/long_parameter_list.rb +1 -1
  16. data/lib/reek/smells/smells.rb +4 -8
  17. data/lib/reek/source.rb +19 -8
  18. data/lib/reek/stop_context.rb +4 -16
  19. data/lib/reek/yield_call_context.rb +1 -3
  20. data/reek.gemspec +11 -9
  21. data/spec/reek/block_context_spec.rb +40 -0
  22. data/spec/reek/class_context_spec.rb +11 -40
  23. data/spec/reek/code_context_spec.rb +2 -1
  24. data/spec/reek/code_parser_spec.rb +0 -10
  25. data/spec/reek/config_spec.rb +2 -2
  26. data/spec/reek/method_context_spec.rb +14 -0
  27. data/spec/reek/name_spec.rb +13 -0
  28. data/spec/reek/object_refs_spec.rb +11 -9
  29. data/spec/reek/report_spec.rb +1 -1
  30. data/spec/reek/singleton_method_context_spec.rb +1 -1
  31. data/spec/reek/smells/duplication_spec.rb +2 -2
  32. data/spec/reek/smells/feature_envy_spec.rb +132 -36
  33. data/spec/reek/smells/large_class_spec.rb +48 -47
  34. data/spec/reek/smells/long_method_spec.rb +1 -1
  35. data/spec/reek/smells/long_parameter_list_spec.rb +4 -11
  36. data/spec/reek/smells/uncommunicative_name_spec.rb +6 -1
  37. data/spec/reek/smells/utility_function_spec.rb +6 -9
  38. data/spec/{samples → slow}/inline_spec.rb +13 -10
  39. data/spec/{samples → slow}/optparse_spec.rb +20 -12
  40. data/spec/{samples → slow}/redcloth_spec.rb +16 -8
  41. data/spec/{integration → slow}/reek_source_spec.rb +0 -0
  42. data/spec/{samples → slow/samples}/inline.rb +0 -0
  43. data/spec/{samples → slow/samples}/optparse.rb +0 -0
  44. data/spec/{samples → slow/samples}/redcloth.rb +0 -0
  45. data/spec/{integration → slow}/script_spec.rb +0 -0
  46. data/spec/slow/source_list_spec.rb +40 -0
  47. data/spec/spec_helper.rb +2 -0
  48. data/tasks/rspec.rake +1 -1
  49. metadata +30 -15
  50. data/spec/reek/sexp_formatter_spec.rb +0 -31
@@ -20,7 +20,7 @@ module Reek
20
20
  def find_module(modname)
21
21
  return nil unless myself
22
22
  sym = modname.to_s
23
- myself.const_defined?(sym) ? myself.const_get(sym) : nil
23
+ @myself.const_defined?(sym) ? @myself.const_get(sym) : nil
24
24
  end
25
25
 
26
26
  def outer_name
@@ -3,7 +3,9 @@ module Reek
3
3
  include Comparable
4
4
 
5
5
  def self.resolve(exp, context)
6
- return [context, new(exp)] unless Array === exp
6
+ unless Array === exp
7
+ return resolve_string(exp.to_s, context)
8
+ end
7
9
  name = exp[1]
8
10
  case exp[0]
9
11
  when :colon2
@@ -17,6 +19,11 @@ module Reek
17
19
  end
18
20
  end
19
21
 
22
+ def self.resolve_string(str, context)
23
+ return [context, new(str)] unless str =~ /::/
24
+ resolve(RubyParser.new.parse(str), context)
25
+ end
26
+
20
27
  def initialize(sym)
21
28
  @name = sym.to_s
22
29
  end
@@ -6,7 +6,6 @@ module Reek
6
6
  class ObjectRefs # :nodoc:
7
7
  def initialize
8
8
  @refs = Hash.new(0)
9
- record_reference_to_self
10
9
  end
11
10
 
12
11
  def record_reference_to_self
@@ -34,8 +33,8 @@ module Reek
34
33
  end
35
34
 
36
35
  # TODO
37
- # Should be moved to Hash; but Hash has 58 methods, and there's currently
38
- # no way to turn off that report; which would therefore make the tests fail
36
+ # Should be moved to Hash
37
+ #
39
38
  def max_keys
40
39
  max = max_refs
41
40
  @refs.reject {|key,val| val != max}.keys
@@ -0,0 +1,53 @@
1
+ module Reek
2
+ class Source
3
+ #
4
+ # Factory method: creates a +Source+ from obj.
5
+ # The code is not parsed until +report+ is called.
6
+ # (This feature is only enabled if you have the ParseTree gem installed.)
7
+ #
8
+ def self.from_object(obj)
9
+ return ObjectSource.new(obj, obj.to_s)
10
+ end
11
+ end
12
+
13
+ class ObjectSource < Source # :nodoc:
14
+
15
+ def self.unify(sexp) # :nodoc:
16
+ unifier = Unifier.new
17
+ unifier.processors.each do |proc|
18
+ proc.unsupported.delete :cfunc # HACK
19
+ end
20
+ return unifier.process(sexp[0])
21
+ end
22
+
23
+ def can_parse_objects?
24
+ return true if Object.const_defined?(:ParseTree)
25
+ begin
26
+ require 'parse_tree'
27
+ true
28
+ rescue LoadError
29
+ false
30
+ end
31
+ end
32
+
33
+ def generate_syntax_tree
34
+ if can_parse_objects?
35
+ ObjectSource.unify(ParseTree.new.parse_tree(@source))
36
+ else
37
+ throw ArgumentError.new('You must install the ParseTree gem to use this feature')
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ class Object
44
+ #
45
+ # Constructs a Source representing this object; the source can then be used
46
+ # to generate an abstract syntax tree for the object, which can in turn then
47
+ # be examined for code smells.
48
+ # (This feature is only enabled if you have the ParseTree gem installed.)
49
+ #
50
+ def to_source
51
+ Reek::Source.from_object(self)
52
+ end
53
+ end
@@ -9,6 +9,9 @@ module Reek
9
9
  @report = SortedSet.new
10
10
  end
11
11
 
12
+ #
13
+ # Yields, in turn, each SmellWarning in this report.
14
+ #
12
15
  def each
13
16
  @report.each { |smell| yield smell }
14
17
  end
@@ -18,11 +21,11 @@ module Reek
18
21
  true
19
22
  end
20
23
 
21
- def empty? # :nodoc:
24
+ def empty?
22
25
  @report.empty?
23
26
  end
24
27
 
25
- def length # :nodoc:
28
+ def length
26
29
  @report.length
27
30
  end
28
31
 
@@ -32,6 +35,12 @@ module Reek
32
35
  @report.to_a[index]
33
36
  end
34
37
 
38
+ # Creates a formatted report of all the +Smells::SmellWarning+ objects recorded in
39
+ # this report, with a heading.
40
+ def full_report(desc)
41
+ "\"#{desc}\" -- #{length} warnings:\n#{to_s}\n"
42
+ end
43
+
35
44
  # Creates a formatted report of all the +Smells::SmellWarning+ objects recorded in
36
45
  # this report.
37
46
  def to_s
@@ -39,4 +48,34 @@ module Reek
39
48
  end
40
49
  end
41
50
 
51
+ class ReportList
52
+ include Enumerable
53
+
54
+ def initialize(sources)
55
+ @sources = sources
56
+ end
57
+
58
+ #
59
+ # Yields, in turn, each SmellWarning in every report in this report.
60
+ #
61
+ def each(&blk)
62
+ @sources.each {|src| src.report.each(&blk) }
63
+ end
64
+
65
+ def empty?
66
+ length == 0
67
+ end
68
+
69
+ def length
70
+ @sources.inject(0) {|sum, src| sum + src.report.length }
71
+ end
72
+
73
+ def smelly_sources
74
+ @sources.select {|src| src.smelly? }
75
+ end
76
+
77
+ def to_s
78
+ smelly_sources.map { |src| src.full_report }.join("\n")
79
+ end
80
+ end
42
81
  end
@@ -1,52 +1,10 @@
1
+ require 'ruby2ruby'
2
+
1
3
  module Reek
2
4
  class SexpFormatter
3
5
  def self.format(sexp)
4
- return sexp.to_s unless Array === sexp
5
- first = sexp[1]
6
- case sexp[0]
7
- when :array
8
- format_all(sexp, ', ')
9
- when :call
10
- meth, args = sexp[2..3]
11
- result = format(first)
12
- if meth.to_s == '[]'
13
- result += (args.nil? ? '[]' : "[#{format(args)}]")
14
- else
15
- result += ".#{meth}" + (args ? "(#{format(args)})" : '')
16
- end
17
- result
18
- when :colon2
19
- format_all(sexp, '::')
20
- when :const, :cvar, :dvar
21
- format(first)
22
- when :dot2
23
- format_all(sexp, '..')
24
- when :dstr
25
- '"' + format_all(sexp, '') + '"'
26
- when :evstr
27
- "\#\{#{format(first)}\}"
28
- when :fcall, :vcall
29
- args = sexp[2]
30
- result = first.to_s
31
- result += "(#{format(args)})" if args
32
- result
33
- when :iter
34
- 'block'
35
- when :lasgn
36
- format_all(sexp, '=')
37
- when :nth_ref
38
- "$#{first}"
39
- when :str
40
- first
41
- when :xstr
42
- "`#{first}`"
43
- else
44
- sexp[-1].to_s
45
- end
46
- end
47
-
48
- def self.format_all(sexp, glue)
49
- sexp[1..-1].map {|arg| format(arg)}.join(glue)
6
+ sexp = YAML::load(YAML::dump(sexp))
7
+ Ruby2Ruby.new.process(sexp)
50
8
  end
51
9
  end
52
10
  end
@@ -9,8 +9,9 @@ module Reek
9
9
  # instance variables, methods or lines of code.
10
10
  #
11
11
  # Currently +LargeClass+ only reports classes having more than a
12
- # configurable number of methods. This includes public, protected and
13
- # private methods, but excludes methods inherited from superclasses or
12
+ # configurable number of methods or instance variables. The method count
13
+ # includes public, protected and
14
+ # private methods, and excludes methods inherited from superclasses or
14
15
  # included modules.
15
16
  #
16
17
  class LargeClass < SmellDetector
@@ -19,6 +20,10 @@ module Reek
19
20
  # permitted in a class.
20
21
  MAX_ALLOWED_METHODS_KEY = 'max_methods'
21
22
 
23
+ # The name of the config field that sets the maximum number of instance
24
+ # variables permitted in a class.
25
+ MAX_ALLOWED_IVARS_KEY = 'max_instance_variables'
26
+
22
27
  def self.contexts # :nodoc:
23
28
  [:class]
24
29
  end
@@ -26,24 +31,38 @@ module Reek
26
31
  def self.default_config
27
32
  super.adopt(
28
33
  MAX_ALLOWED_METHODS_KEY => 25,
29
- EXCLUDE_KEY => ['Array', 'Hash', 'Module', 'String']
34
+ MAX_ALLOWED_IVARS_KEY => 9,
35
+ EXCLUDE_KEY => []
30
36
  )
31
37
  end
32
38
 
33
39
  def initialize(config = LargeClass.default_config)
34
40
  super
35
41
  @max_methods = config[MAX_ALLOWED_METHODS_KEY]
42
+ @max_instance_variables = config[MAX_ALLOWED_IVARS_KEY]
43
+ end
44
+
45
+ def check_num_methods(klass, report) # :nodoc:
46
+ count = klass.num_methods
47
+ return if count <= @max_methods
48
+ report << SmellWarning.new(self, klass,
49
+ "has at least #{count} methods")
50
+ end
51
+
52
+ def check_num_ivars(klass, report) # :nodoc:
53
+ count = klass.variable_names.length
54
+ return if count <= @max_instance_variables
55
+ report << SmellWarning.new(self, klass,
56
+ "has at least #{count} instance variables")
36
57
  end
37
58
 
38
59
  #
39
- # Checks the length of the given +klass+.
60
+ # Checks +klass+ for too many methods or too many instance variables.
40
61
  # Any smells found are added to the +report+.
41
62
  #
42
63
  def examine_context(klass, report)
43
- num_methods = klass.num_methods
44
- return false if num_methods <= @max_methods
45
- report << SmellWarning.new(self, klass,
46
- "has at least #{num_methods} methods")
64
+ check_num_methods(klass, report)
65
+ check_num_ivars(klass, report)
47
66
  end
48
67
  end
49
68
  end
@@ -27,7 +27,7 @@ module Reek
27
27
  @max_params = config['max_params']
28
28
  @action = 'has'
29
29
  end
30
-
30
+
31
31
  #
32
32
  # Checks the number of parameters in the given scope.
33
33
  # Any smells found are added to the +report+.
@@ -11,13 +11,10 @@ require 'reek/smells/utility_function'
11
11
  require 'yaml'
12
12
 
13
13
  class Hash
14
- def value_merge!(other)
15
- other.keys.each do |key|
16
- self[key].adopt!(other[key])
17
- end
18
- self
14
+ def push_keys(hash)
15
+ keys.each {|key| hash[key].adopt!(self[key]) }
19
16
  end
20
-
17
+
21
18
  def adopt!(other)
22
19
  other.keys.each do |key|
23
20
  ov = other[key]
@@ -69,8 +66,7 @@ module Reek
69
66
  def load_local(file)
70
67
  path = File.expand_path(file)
71
68
  all_reekfiles(path).each do |rfile|
72
- cf = YAML.load_file(rfile)
73
- @config.value_merge!(cf)
69
+ YAML.load_file(rfile).push_keys(@config)
74
70
  end
75
71
  self
76
72
  end
@@ -1,6 +1,7 @@
1
1
  require 'reek/code_parser'
2
2
  require 'reek/report'
3
3
  require 'reek/smells/smells'
4
+ require 'ruby_parser'
4
5
 
5
6
  module Reek
6
7
 
@@ -57,10 +58,15 @@ module Reek
57
58
  SourceList.new(sources)
58
59
  end
59
60
 
60
- def initialize(code, desc, dir = '.') # :nodoc:
61
+ def initialize(code, desc, dir = nil) # :nodoc:
61
62
  @source = code
62
- @dir = dir
63
63
  @desc = desc
64
+ @cf = SmellConfig.new
65
+ @cf = @cf.load_local(dir) if dir
66
+ end
67
+
68
+ def generate_syntax_tree
69
+ RubyParser.new.parse(@source, @desc) || s()
64
70
  end
65
71
 
66
72
  #
@@ -71,8 +77,8 @@ module Reek
71
77
  def report
72
78
  unless @report
73
79
  @report = Report.new
74
- smells = SmellConfig.new.load_local(@dir).smell_listeners
75
- CodeParser.new(@report, smells).check_source(@source)
80
+ parser = CodeParser.new(@report, @cf.smell_listeners)
81
+ parser.process(generate_syntax_tree)
76
82
  end
77
83
  @report
78
84
  end
@@ -89,6 +95,12 @@ module Reek
89
95
  report.any? { |smell| smell.matches?(smell_class, patterns) }
90
96
  end
91
97
 
98
+ # Creates a formatted report of all the +Smells::SmellWarning+ objects recorded in
99
+ # this report, with a heading.
100
+ def full_report
101
+ report.full_report(@desc)
102
+ end
103
+
92
104
  def to_s
93
105
  @desc
94
106
  end
@@ -107,10 +119,9 @@ module Reek
107
119
  end
108
120
 
109
121
  def report
110
- @sources.select {|src| src.smelly? }.map do |src|
111
- warnings = src.report
112
- "\"#{src}\" -- #{warnings.length} warnings:\n#{warnings.to_s}\n"
113
- end.join("\n")
122
+ ReportList.new(@sources)
114
123
  end
115
124
  end
116
125
  end
126
+
127
+ require 'reek/object_source'
@@ -5,6 +5,10 @@ module Reek
5
5
  @refs = ObjectRefs.new
6
6
  @myself = Object
7
7
  end
8
+ def method_missing(method, *args)
9
+ nil
10
+ end
11
+
8
12
 
9
13
  def count_statements(num)
10
14
  0
@@ -39,22 +43,6 @@ module Reek
39
43
  false
40
44
  end
41
45
 
42
- def record_call_to(exp)
43
- nil
44
- end
45
-
46
- def record_method(name)
47
- end
48
-
49
- def record_parameter(sym)
50
- end
51
-
52
- def record_instance_variable(sym)
53
- end
54
-
55
- def record_local_variable(sym)
56
- end
57
-
58
46
  def outer_name
59
47
  ''
60
48
  end
@@ -6,9 +6,7 @@ module Reek
6
6
 
7
7
  def initialize(outer, exp)
8
8
  super
9
- @parameters = []
10
- args = exp[1]
11
- @parameters = args[0...-1] if args
9
+ @parameters = exp[1..-1]
12
10
  end
13
11
  end
14
12
  end
@@ -2,18 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{reek}
5
- s.version = "0.3.1.6"
5
+ s.version = "1.1.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Kevin Rutherford"]
9
- s.date = %q{2009-04-03}
9
+ s.date = %q{2009-05-19}
10
10
  s.default_executable = %q{reek}
11
11
  s.description = %q{Code smell detector for Ruby}
12
12
  s.email = ["kevin@rutherford-software.com"]
13
13
  s.executables = ["reek"]
14
14
  s.extra_rdoc_files = ["History.txt", "README.txt"]
15
- s.files = ["History.txt", "README.txt", "Rakefile", "bin/reek", "config/defaults.reek", "lib/reek.rb", "lib/reek/block_context.rb", "lib/reek/class_context.rb", "lib/reek/code_context.rb", "lib/reek/code_parser.rb", "lib/reek/exceptions.reek", "lib/reek/if_context.rb", "lib/reek/method_context.rb", "lib/reek/module_context.rb", "lib/reek/name.rb", "lib/reek/object_refs.rb", "lib/reek/options.rb", "lib/reek/rake_task.rb", "lib/reek/report.rb", "lib/reek/sexp_formatter.rb", "lib/reek/singleton_method_context.rb", "lib/reek/smell_warning.rb", "lib/reek/smells/control_couple.rb", "lib/reek/smells/duplication.rb", "lib/reek/smells/feature_envy.rb", "lib/reek/smells/large_class.rb", "lib/reek/smells/long_method.rb", "lib/reek/smells/long_parameter_list.rb", "lib/reek/smells/long_yield_list.rb", "lib/reek/smells/nested_iterators.rb", "lib/reek/smells/smell_detector.rb", "lib/reek/smells/smells.rb", "lib/reek/smells/uncommunicative_name.rb", "lib/reek/smells/utility_function.rb", "lib/reek/source.rb", "lib/reek/spec.rb", "lib/reek/stop_context.rb", "lib/reek/yield_call_context.rb", "reek.gemspec", "spec/integration/reek_source_spec.rb", "spec/integration/script_spec.rb", "spec/reek/class_context_spec.rb", "spec/reek/code_context_spec.rb", "spec/reek/code_parser_spec.rb", "spec/reek/config_spec.rb", "spec/reek/if_context_spec.rb", "spec/reek/method_context_spec.rb", "spec/reek/module_context_spec.rb", "spec/reek/object_refs_spec.rb", "spec/reek/options_spec.rb", "spec/reek/report_spec.rb", "spec/reek/sexp_formatter_spec.rb", "spec/reek/singleton_method_context_spec.rb", "spec/reek/smells/control_couple_spec.rb", "spec/reek/smells/duplication_spec.rb", "spec/reek/smells/feature_envy_spec.rb", "spec/reek/smells/large_class_spec.rb", "spec/reek/smells/long_method_spec.rb", "spec/reek/smells/long_parameter_list_spec.rb", "spec/reek/smells/nested_iterators_spec.rb", "spec/reek/smells/smell_spec.rb", "spec/reek/smells/uncommunicative_name_spec.rb", "spec/reek/smells/utility_function_spec.rb", "spec/samples/inline.rb", "spec/samples/inline_spec.rb", "spec/samples/optparse.rb", "spec/samples/optparse_spec.rb", "spec/samples/redcloth.rb", "spec/samples/redcloth_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/reek.rake", "tasks/rspec.rake"]
16
- s.has_rdoc = true
15
+ s.files = ["History.txt", "README.txt", "Rakefile", "bin/reek", "config/defaults.reek", "lib/reek.rb", "lib/reek/block_context.rb", "lib/reek/class_context.rb", "lib/reek/code_context.rb", "lib/reek/code_parser.rb", "lib/reek/exceptions.reek", "lib/reek/if_context.rb", "lib/reek/method_context.rb", "lib/reek/module_context.rb", "lib/reek/name.rb", "lib/reek/object_refs.rb", "lib/reek/object_source.rb", "lib/reek/options.rb", "lib/reek/rake_task.rb", "lib/reek/report.rb", "lib/reek/sexp_formatter.rb", "lib/reek/singleton_method_context.rb", "lib/reek/smell_warning.rb", "lib/reek/smells/control_couple.rb", "lib/reek/smells/duplication.rb", "lib/reek/smells/feature_envy.rb", "lib/reek/smells/large_class.rb", "lib/reek/smells/long_method.rb", "lib/reek/smells/long_parameter_list.rb", "lib/reek/smells/long_yield_list.rb", "lib/reek/smells/nested_iterators.rb", "lib/reek/smells/smell_detector.rb", "lib/reek/smells/smells.rb", "lib/reek/smells/uncommunicative_name.rb", "lib/reek/smells/utility_function.rb", "lib/reek/source.rb", "lib/reek/spec.rb", "lib/reek/stop_context.rb", "lib/reek/yield_call_context.rb", "reek.gemspec", "spec/reek/block_context_spec.rb", "spec/reek/class_context_spec.rb", "spec/reek/code_context_spec.rb", "spec/reek/code_parser_spec.rb", "spec/reek/config_spec.rb", "spec/reek/if_context_spec.rb", "spec/reek/method_context_spec.rb", "spec/reek/module_context_spec.rb", "spec/reek/name_spec.rb", "spec/reek/object_refs_spec.rb", "spec/reek/options_spec.rb", "spec/reek/report_spec.rb", "spec/reek/singleton_method_context_spec.rb", "spec/reek/smells/control_couple_spec.rb", "spec/reek/smells/duplication_spec.rb", "spec/reek/smells/feature_envy_spec.rb", "spec/reek/smells/large_class_spec.rb", "spec/reek/smells/long_method_spec.rb", "spec/reek/smells/long_parameter_list_spec.rb", "spec/reek/smells/nested_iterators_spec.rb", "spec/reek/smells/smell_spec.rb", "spec/reek/smells/uncommunicative_name_spec.rb", "spec/reek/smells/utility_function_spec.rb", "spec/slow/inline_spec.rb", "spec/slow/optparse_spec.rb", "spec/slow/redcloth_spec.rb", "spec/slow/reek_source_spec.rb", "spec/slow/samples/inline.rb", "spec/slow/samples/optparse.rb", "spec/slow/samples/redcloth.rb", "spec/slow/script_spec.rb", "spec/slow/source_list_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/reek.rake", "tasks/rspec.rake"]
17
16
  s.homepage = %q{http://wiki.github.com/kevinrutherford/reek}
18
17
  s.post_install_message = %q{
19
18
  For more information on reek, see http://wiki.github.com/kevinrutherford/reek
@@ -21,22 +20,25 @@ For more information on reek, see http://wiki.github.com/kevinrutherford/reek
21
20
  s.rdoc_options = ["--main", "README.txt"]
22
21
  s.require_paths = ["lib"]
23
22
  s.rubyforge_project = %q{reek}
24
- s.rubygems_version = %q{1.3.1}
23
+ s.rubygems_version = %q{1.3.3}
25
24
  s.summary = %q{Code smell detector for Ruby}
26
25
 
27
26
  if s.respond_to? :specification_version then
28
27
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
29
- s.specification_version = 2
28
+ s.specification_version = 3
30
29
 
31
30
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
32
- s.add_runtime_dependency(%q<ParseTree>, ["~> 3.0"])
31
+ s.add_runtime_dependency(%q<ruby_parser>, ["~> 2.0"])
32
+ s.add_runtime_dependency(%q<ruby2ruby>, ["~> 1.2"])
33
33
  s.add_runtime_dependency(%q<sexp_processor>, ["~> 3.0"])
34
34
  else
35
- s.add_dependency(%q<ParseTree>, ["~> 3.0"])
35
+ s.add_dependency(%q<ruby_parser>, ["~> 2.0"])
36
+ s.add_dependency(%q<ruby2ruby>, ["~> 1.2"])
36
37
  s.add_dependency(%q<sexp_processor>, ["~> 3.0"])
37
38
  end
38
39
  else
39
- s.add_dependency(%q<ParseTree>, ["~> 3.0"])
40
+ s.add_dependency(%q<ruby_parser>, ["~> 2.0"])
41
+ s.add_dependency(%q<ruby2ruby>, ["~> 1.2"])
40
42
  s.add_dependency(%q<sexp_processor>, ["~> 3.0"])
41
43
  end
42
44
  end