Class: Pod::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-soul-component-plugin/command/soul-component-plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, *requirements) ⇒ Dependency

Returns a new instance of Dependency.



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/cocoapods-soul-component-plugin/command/soul-component-plugin.rb', line 283

def initialize(name = nil, *requirements)
  if requirements.nil?
    old_initialize(name)
    return
  end

  # 当使用本地Flutter并且json中有SOFEngine项时会报奇怪的错误
  # if name == 'SOFEngine'
  #   puts 1
  #   puts name, requirements
  # end

  CocoapodsSoulComponentPlugin.components.each do |each|
    next unless each.name == name

    requirements = if each.local == true
                     [{ name: each.name, path: each.path }]
                   else
                     [each.version]
                   end
  end
  # if name == 'SOFEngine'
  #   puts 2
  #   puts name, requirements
  # end
  old_initialize(name, *requirements)
end

Instance Method Details

#old_initializeObject



281
# File 'lib/cocoapods-soul-component-plugin/command/soul-component-plugin.rb', line 281

alias old_initialize initialize