Module: CBin::SourcesHelper

Included in:
Upload::Helper, Pod::Command::Bin
Defined in:
lib/cocoapods-imy-bin/helpers/sources_helper.rb

Instance Method Summary collapse

Instance Method Details

#binary_sourceObject



11
12
13
# File 'lib/cocoapods-imy-bin/helpers/sources_helper.rb', line 11

def binary_source
  sources_manager.binary_source
end

#code_sourceObject



15
16
17
# File 'lib/cocoapods-imy-bin/helpers/sources_helper.rb', line 15

def code_source
  sources_manager.code_source
end

#sources_managerObject



7
8
9
# File 'lib/cocoapods-imy-bin/helpers/sources_helper.rb', line 7

def sources_manager
  Pod::Config.instance.sources_manager
end

#sources_option(code_dependencies, additional_sources) ⇒ Object



32
33
34
# File 'lib/cocoapods-imy-bin/helpers/sources_helper.rb', line 32

def sources_option(code_dependencies, additional_sources)
  (valid_sources(code_dependencies).map(&:url) + Array(additional_sources)).join(',')
end

#valid_sources(code_dependencies = false) ⇒ Object

优先采用对应依赖的 source cocoapods 内部会先匹配前面符合的 specification 只允许二进制的 specification subspec 比源码的 specification subspec 多



23
24
25
26
27
28
29
30
# File 'lib/cocoapods-imy-bin/helpers/sources_helper.rb', line 23

def valid_sources(code_dependencies = false)
  sources = [code_source]
  unless code_dependencies
    sources << binary_source
    sources.reverse!
  end
  sources
end