Sha256: 4b6f6cde69297442501a2f0d52f7b31baaf21513b117291467aed23b42da518b

Contents?: true

Size: 599 Bytes

Versions: 3

Compression:

Stored size: 599 Bytes

Contents

#!/usr/bin/env ruby
#
#  Created on 2008-2-17.
#  Copyright (c) 2008. All rights reserved.

begin
  require 'rubygems'
rescue LoadError
  # no rubygems to load, so we fail silently
end

require 'reek'

def classes_currently_loaded
  result = []
  ObjectSpace.each_object(Module) { |klass| result << klass }
  result
end

old_classes = classes_currently_loaded
files = ARGV
files = Dir['**/*.rb'] if files.empty?
files.each { |name| require name }
new_classes = classes_currently_loaded - old_classes
if new_classes.empty?
  puts 'Nothing to analyse!'
else
  puts Reek.analyse(*new_classes).to_s
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reek-0.0.1 bin/reek
reek-0.1.0 bin/reek
reek-0.1.1 bin/reek