Commit 25e76f42 authored by Daniel Tomlinson's avatar Daniel Tomlinson

[SourceManager] Update to setup Aggregate by Source

parent 436c0e2f
...@@ -468,14 +468,25 @@ module Pod ...@@ -468,14 +468,25 @@ module Pod
private private
# @return [Source] The Source at a given path.
#
# @param [Pathname] path
# The local file path to one podspec repo.
#
def source_from_path(path)
return Source.new(path) unless path.basename.to_s == 'master'
return MasterSource.new(path)
end
# @return [Source::Aggregate] The aggregate of the sources from repos. # @return [Source::Aggregate] The aggregate of the sources from repos.
# #
# @param [Array<Pathname>] repos # @param [Array<Pathname>] repos
# The local file paths to one or more podspec repo caches. # The local file paths to one or more podspec repo caches.
# #
def aggregate_with_repos(repos) def aggregate_with_repos(repos)
sources = repos.map { |path| source_from_path(path) }
@aggregates_by_repos ||= {} @aggregates_by_repos ||= {}
@aggregates_by_repos[repos] ||= Source::Aggregate.new(repos) @aggregates_by_repos[repos] ||= Source::Aggregate.new(sources)
end end
# @return [Bool] Whether the given path is writable by the current user. # @return [Bool] Whether the given path is writable by the current user.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment