Sha256: 30c33b6f9b33f3797229891576980b22051408d61bd882facd076ca65c1202b6

Contents?: true

Size: 719 Bytes

Versions: 5

Compression:

Stored size: 719 Bytes

Contents

require 'reek/source/core_extras'
require 'reek/source/source_code'
require 'reek/source/source_locator'

module Reek
  module Source
    class SourceRepository
      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

5 entries across 5 versions & 1 rubygems

Version Path
reek-1.3.6 lib/reek/source/source_repository.rb
reek-1.3.5 lib/reek/source/source_repository.rb
reek-1.3.4 lib/reek/source/source_repository.rb
reek-1.3.3 lib/reek/source/source_repository.rb
reek-1.3.2 lib/reek/source/source_repository.rb