Sha256: e48dc4ddd25fb8d74d19774425370a15427a2afe373dcc849bd7da624025b85e

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

$:.unshift File.dirname(__FILE__)

require 'reek/file_checker'
require 'reek/report'

module Reek # :doc:

  #
  # Analyse the given source, looking for code smells.
  # The source can be a filename or a String containing Ruby code.
  # Returns a +Report+ listing the smells found.
  #
  def self.analyse(src)  # :doc:
    report = Report.new
    source = Reek.get_source(src)
    FileChecker.new(report).check_source(source)
    report
  end

private

  def self.get_source(src)
    File.exists?(src) ? IO.readlines(src).join : src
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reek-0.3.1 lib/reek.rb