Class: SourceHelper

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/cocoapods-whitelist/helpers/source_helper.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSourceHelper

Returns a new instance of SourceHelper.



15
16
17
# File 'lib/cocoapods-whitelist/helpers/source_helper.rb', line 15

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

Instance Attribute Details

#specsObject

Returns the value of attribute specs.



13
14
15
# File 'lib/cocoapods-whitelist/helpers/source_helper.rb', line 13

def specs
  @specs
end

Instance Method Details

#is_filledObject



26
27
28
# File 'lib/cocoapods-whitelist/helpers/source_helper.rb', line 26

def is_filled
    return !@specs.empty?
end

#setup(sources, private_sources) ⇒ Object



19
20
21
22
23
24
# File 'lib/cocoapods-whitelist/helpers/source_helper.rb', line 19

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