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