Module: Ocean::SourcesHelper

Included in:
Upload::Helper, Pod::Command::Swordfish
Defined in:
lib/swordfish/helpers/sources_helper.rb

Instance Method Summary collapse

Instance Method Details

#binary_sourceObject



10
11
12
# File 'lib/swordfish/helpers/sources_helper.rb', line 10

def binary_source
  sources_manager.binary_source
end

#code_sourceObject



14
15
16
# File 'lib/swordfish/helpers/sources_helper.rb', line 14

def code_source
  sources_manager.code_source
end

#sources_managerObject



6
7
8
# File 'lib/swordfish/helpers/sources_helper.rb', line 6

def sources_manager
  Pod::Config.instance.sources_manager
end

#sources_option(code_dependencies, additional_sources) ⇒ Object



32
33
34
35
36
# File 'lib/swordfish/helpers/sources_helper.rb', line 32

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

#valid_sources(code_dependencies = false) ⇒ Object

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



22
23
24
25
26
27
28
29
30
# File 'lib/swordfish/helpers/sources_helper.rb', line 22

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