lib/jazzy/podspec_documenter.rb in jazzy-0.13.2 vs lib/jazzy/podspec_documenter.rb in jazzy-0.13.3
- old
+ new
@@ -16,12 +16,11 @@
installation_root = Pathname(Dir.mktmpdir(['jazzy', podspec.name]))
installation_root.rmtree if installation_root.exist?
Pod::Config.instance.with_changes(installation_root: installation_root,
verbose: false) do
sandbox = Pod::Sandbox.new(Pod::Config.instance.sandbox_root)
- swift_version = compiler_swift_version(config.swift_version)
- installer = Pod::Installer.new(sandbox, podfile(swift_version))
+ installer = Pod::Installer.new(sandbox, podfile(config))
installer.install!
stdout = Dir.chdir(sandbox.root) do
targets = installer.pod_targets
.select { |pt| pt.pod_name == podspec.root.name }
.map(&:label)
@@ -43,35 +42,43 @@
end
end
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
+ # rubocop:disable Metrics/MethodLength
def self.apply_config_defaults(podspec, config)
return unless podspec
unless config.author_name_configured
config.author_name = author_name(podspec)
+ config.author_name_configured = true
end
unless config.module_name_configured
config.module_name = podspec.module_name
+ config.module_name_configured = true
end
unless config.author_url_configured
config.author_url = podspec.homepage || github_file_prefix(podspec)
+ config.author_url_configured = true
end
unless config.version_configured
config.version = podspec.version.to_s
+ config.version_configured = true
end
unless config.github_file_prefix_configured
config.github_file_prefix = github_file_prefix(podspec)
+ config.github_file_prefix_configured = true
end
unless config.swift_version_configured
trunk_swift_build = podspec.attributes_hash['pushed_with_swift_version']
config.swift_version = trunk_swift_build if trunk_swift_build
+ config.swift_version_configured = true
end
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
+ # rubocop:enable Metrics/MethodLength
private
# @!group Config helper methods
@@ -133,13 +140,18 @@
config.source_directory
end
end
# rubocop:disable Metrics/MethodLength
- def podfile(swift_version)
+ def podfile(config)
+ swift_version = compiler_swift_version(config.swift_version)
podspec = @podspec
path = pod_path
@podfile ||= Pod::Podfile.new do
+ config.pod_sources.each do |src|
+ source src
+ end
+
install! 'cocoapods',
integrate_targets: false,
deterministic_uuids: false
[podspec, *podspec.recursive_subspecs].each do |ss|