Commit 65009432 authored by Eloy Duran's avatar Eloy Duran

Only actually run appledoc from specs if it's installed.

Which one should normally do, but it won't be available on Travis.
parent 7b68080f
module Pod
class DocsGenerator
def self.appledoc_installed?
!`which appledoc`.strip.empty?
end
attr_reader :pod, :specification, :target_path, :options
def initialize(pod)
......@@ -78,9 +82,8 @@ module Pod
end
def appledoc (options)
bin = `which appledoc`.strip
if bin.empty?
puts "\n[!] Skipping documenation generation because appledoc can't be found." if Config.instance.verbose?
unless self.class.appledoc_installed?
puts "\n[!] Skipping documentation generation because appledoc can't be found." if Config.instance.verbose?
return
end
arguments = []
......
......@@ -129,6 +129,7 @@ else
change_log.should.not.include '1.3'
end
if Pod::DocsGenerator.appledoc_installed?
it "generates documentation of all pods by default" do
podfile = Pod::Podfile.new do
self.platform :ios
......@@ -142,8 +143,9 @@ else
File.directory?(config.project_pods_root + 'Documentation/JSONKit/html/')
doc = (config.project_pods_root + 'Documentation/SSToolkit/html/index.html').read
doc.should.include?('SSToolkit')
end
else
puts "[!] Skipping documentation generation specs, because appledoc can't be found."
end
end
......
......@@ -44,6 +44,7 @@ describe Pod::DocsGenerator do
]
end
if Pod::DocsGenerator.appledoc_installed?
it 'it creates the documenation directory' do
File.directory?(@sandbox.root + "Documentation").should.be.true
end
......@@ -55,5 +56,8 @@ describe Pod::DocsGenerator do
index = (@sandbox.root + 'Documentation/BananaLib/html/Classes/BananaObj.html').read
index.should.include?('Bananas are cool')
end
else
puts "[!] Skipping documentation generation specs, because appledoc can't be found."
end
end
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