Module: CBin::SourcesHelper

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

Instance Method Summary collapse

Instance Method Details

#abc_sourceObject

ABC产品线源



35
36
37
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 35

def abc_source
  sources_manager.abc_source
end

#binary_sourceObject



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

def binary_source
  sources_manager.binary_source
end

#br_sourceObject

br产品线源



19
20
21
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 19

def br_source
  sources_manager.br_source
end

#bw_sourceObject

bw产品线源



23
24
25
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 23

def bw_source
  sources_manager.bw_source
end

#code_sourceObject



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

def code_source
  sources_manager.code_source
end

#custom_business_source(source_spec) ⇒ Object

自定义产品线源



39
40
41
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 39

def custom_business_source(source_spec)
  sources_manager.custom_business_source(source_spec)
end

#math_sourceObject

思维产品线源



27
28
29
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 27

def math_source
  sources_manager.math_source
end

#science_sourceObject

科学产品线源



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

def science_source
  sources_manager.science_source
end

#sources_managerObject



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

def sources_manager
  Pod::Config.instance.sources_manager
end

#sources_option(code_dependencies, additional_sources) ⇒ Object

二进制优先



66
67
68
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 66

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

#sources_optionV2(code_dependencies, additional_sources) ⇒ Object

源码优先



71
72
73
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 71

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

#valid_sources(code_dependencies = false) ⇒ Object

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



47
48
49
50
51
52
53
54
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 47

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

#valid_sourcesV2(code_dependencies = false) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 56

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