Commit fcc94b68 authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Don't generate documenation if already installed

It checks that the documenation exist for a given version of a pod
and in that case it doesn't generate it again.
parent 5210cffc
......@@ -74,6 +74,10 @@ module Pod
options += spec_appledoc_options
end
def already_installed?
Pathname.new(File.expand_path("~/Library/Developer/Shared/Documentation/DocSets/org.cocoapods.#{name.gsub(/ /,'-')}.docset")).exist?
end
def generate(install = false)
options = appledoc_options
options += ['--output', @target_path.to_s]
......
......@@ -60,8 +60,13 @@ module Pod
end
if (should_install && config.generate_docs?) || config.force_doc?
doc_generator = Generator::Documentation.new(pod)
if doc_generator.already_installed?
puts "Using Existing Documentation for #{pod.specification}".green if config.verbose?
else
puts "Installing Documentation for #{pod.specification}".green if config.verbose?
Generator::Documentation.new(pod).generate(config.doc_install?)
doc_generator.generate(config.doc_install?)
end
end
end
end
......
......@@ -208,6 +208,8 @@ else
dependency 'SSToolkit'
end
Pod::Generator::Documentation.any_instance.stubs(:already_installed?).returns(false)
installer = SpecHelper::Installer.new(podfile)
installer.install!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment