Sha256: b17ef98bfadaa382fb5f465715190ad4c9931d17a9c5c5f7c740ab3942f2bc23

Contents?: true

Size: 818 Bytes

Versions: 7

Compression:

Stored size: 818 Bytes

Contents

require_relative '../model/sources'
require 'singleton'

# In charge of host the Pods names that comes from our private sources
#
# NOTE: The safest way to handle this was to host the complete specification and not only the pods 
#       names as rubydocs specified
#       (https://www.rubydoc.info/github/CocoaPods/Core/Pod/Source#all_specs-instance_method)
#        However, the execution time was considerably slower. 
#
class SourceHelper
    include Singleton
    attr_accessor :specs

    def initialize()
        @specs ||= []
    end

    def setup(sources, private_sources)      
        private_sources = sources.select {|s| private_sources.include? s.url}
        private_sources.each do |s| 
            @specs.concat s.pods
        end
    end

    def is_filled
        return !@specs.empty?
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cocoapods-whitelist-0.5.5 lib/cocoapods-whitelist/helpers/source_helper.rb
cocoapods-whitelist-0.5.4 lib/cocoapods-whitelist/helpers/source_helper.rb
cocoapods-whitelist-0.5.3 lib/cocoapods-whitelist/helpers/source_helper.rb
cocoapods-whitelist-0.4.0 lib/cocoapods-whitelist/helpers/source_helper.rb
cocoapods-whitelist-0.3.0 lib/cocoapods-whitelist/helpers/source_helper.rb
cocoapods-whitelist-0.2.1 lib/cocoapods-whitelist/helpers/source_helper.rb
cocoapods-whitelist-0.2.0 lib/cocoapods-whitelist/helpers/source_helper.rb