Sha256: 7d6b32af219d8d3b58cf82e21895c8c94cee3454c3026a7873b77c7b2737ae53
Contents?: true
Size: 1.24 KB
Versions: 12
Compression:
Stored size: 1.24 KB
Contents
require 'reek/source/core_extras' require 'reek/source/source_code' require 'reek/source/source_locator' module Reek module Source # # A collection of source code. If the collection is initialized with an array # it is assumed to be a list of file paths. Otherwise it is assumed to be a # single unit of Ruby source code. # class SourceRepository # TODO: This method is a least partially broken. # Regardless of how you call reek, be it: # reek lib/ # reek lib/file_one.rb lib/file_two.rb # echo "def m; end" | reek # we *always* end up in the "when Source::SourceCode" branch. # So it seems like 80% of this method is never used. def self.parse(source) case source when Array new 'dir', Source::SourceLocator.new(source).all_sources when Source::SourceCode new source.desc, [source] else src = source.to_reek_source new src.desc, [src] end end include Enumerable attr_reader :description def initialize(description, sources) @description = description @sources = sources end def each(&block) @sources.each(&block) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems