require_relative '../validator/source_validator' require_relative '../model/sources' module Pod class Resolver alias original_search_for search_for ## Filter specifications def search_for(dependency) specifications = original_search_for(dependency) validator = SourceValidator.new(get_sources()) filtered = validator.filter_dependency(dependency.root_name, specifications) if filtered.empty? && specifications.first ## If you have a dependency problem, then no specification is returned from :search_for Pod::UI.puts "Dependency #{dependency.root_name} comes from source #{specifications.first.spec_source.url} is NOT allowed".red Pod::UI.puts "If you thing this is a mistake, please check the whitelist".red raise Informative.new() end specifications end end end