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
- #binary_source ⇒ Object
- #code_source ⇒ Object
- #sources_manager ⇒ Object
-
#sources_option(code_dependencies, additional_sources) ⇒ Object
二进制优先.
-
#sources_optionV2(code_dependencies, additional_sources) ⇒ Object
源码优先.
-
#valid_sources(code_dependencies = false) ⇒ Object
优先采用对应依赖的 source cocoapods 内部会先匹配前面符合的 specification 只允许二进制的 specification subspec 比源码的 specification subspec 多.
- #valid_sourcesV2(code_dependencies = false) ⇒ Object
Instance Method Details
#binary_source ⇒ Object
11 12 13 |
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 11 def binary_source sources_manager.binary_source end |
#code_source ⇒ Object
15 16 17 |
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 15 def code_source sources_manager.code_source end |
#sources_manager ⇒ Object
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
二进制优先
42 43 44 |
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 42 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
源码优先
47 48 49 |
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 47 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 多
23 24 25 26 27 28 29 30 |
# File 'lib/cocoapods-bb-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 |
#valid_sourcesV2(code_dependencies = false) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/cocoapods-bb-bin/helpers/sources_helper.rb', line 32 def valid_sourcesV2(code_dependencies = false) sources = [binary_source] unless code_dependencies sources << code_source sources.reverse! end sources end |