Class: Pod::Specification

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-cafswitcher/podfile_switch.rb

Class Method Summary collapse

Class Method Details

.addDependency(spec, subspec) ⇒ Object



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/cocoapods-cafswitcher/podfile_switch.rb', line 191

def self.addDependency(spec, subspec)
  dependence_note = []
  if subspec.dependencies
    subspec.dependencies.each do |dependency|
      next unless dependency.name =~ /^(?i)#{spec.name}\//
      dependency_subspec = nil?
      spec.subspecs.each do |temSubspec|
        if temSubspec.name == dependency.name
          dependency_subspec = temSubspec
        end
      end
      if dependency_subspec
        dependence_note = dependence_note + addDependency(spec, dependency_subspec)
      end
      dependence_note << dependency.name
    end
  end
  dependence_note.uniq
end