lib/reek/source/source_code.rb in reek-1.3.8 vs lib/reek/source/source_code.rb in reek-1.4.0
- old
+ new
@@ -2,40 +2,30 @@
require 'reek/source/config_file'
require 'reek/source/tree_dresser'
module Reek
module Source
-
#
# A +Source+ object represents a chunk of Ruby source code.
#
class SourceCode
-
- @@err_io = $stderr
-
- class << self
- def err_io=(io)
- original = @@err_io
- @@err_io = io
- original
- end
- end
-
attr_reader :desc
def initialize(code, desc, parser = RubyParser.new)
@source = code
@desc = desc
@parser = parser
end
- def configure(sniffer) end
+ def relevant_config_files
+ []
+ end
def syntax_tree
begin
ast = @parser.parse(@source, @desc)
rescue Racc::ParseError, RubyParser::SyntaxError => error
- @@err_io.puts "#{desc}: #{error.class.name}: #{error}"
+ $stderr.puts "#{desc}: #{error.class.name}: #{error}"
end
ast ||= s()
TreeDresser.new.dress(ast)
end
end