Commit 8aba4ca8 authored by Fabio Pelosin's avatar Fabio Pelosin

[#197] Using escape gem

parent da8b99e3
...@@ -2,6 +2,7 @@ source "http://rubygems.org" ...@@ -2,6 +2,7 @@ source "http://rubygems.org"
gem "open4" gem "open4"
gem "colored" gem "colored"
gem "escape"
group :development do group :development do
gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git" gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git"
......
...@@ -11,6 +11,7 @@ GEM ...@@ -11,6 +11,7 @@ GEM
bacon (1.1.0) bacon (1.1.0)
colored (1.2) colored (1.2)
crack (0.3.1) crack (0.3.1)
escape (0.0.4)
kicker (2.5.0) kicker (2.5.0)
rb-fsevent rb-fsevent
metaclass (0.0.1) metaclass (0.0.1)
...@@ -32,6 +33,7 @@ PLATFORMS ...@@ -32,6 +33,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
bacon bacon
colored colored
escape
kicker kicker
mocha-on-bacon mocha-on-bacon
open4 open4
......
...@@ -31,6 +31,7 @@ Gem::Specification.new do |s| ...@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'xcodeproj', '~> 0.1.0' s.add_runtime_dependency 'xcodeproj', '~> 0.1.0'
s.add_runtime_dependency 'popen4', '~> 0.1.2' s.add_runtime_dependency 'popen4', '~> 0.1.2'
s.add_runtime_dependency 'colored', '~> 1.2' s.add_runtime_dependency 'colored', '~> 1.2'
s.add_runtime_dependency 'escape', '~> 0.0.4'
s.add_development_dependency 'bacon', '~> 1.1' s.add_development_dependency 'bacon', '~> 1.1'
## Make sure you can build the gem on older versions of RubyGems too: ## Make sure you can build the gem on older versions of RubyGems too:
......
require 'escape'
module Pod module Pod
module Generator module Generator
...@@ -76,11 +77,16 @@ module Pod ...@@ -76,11 +77,16 @@ module Pod
options += ['--output', @target_path.to_s] options += ['--output', @target_path.to_s]
options += install ? ['--create-docset'] : ['--no-create-docset'] options += install ? ['--create-docset'] : ['--no-create-docset']
options += files options += files
options.map!{|s| s !~ /-.*|".*"/ ? %Q["#{s}"] : s }
@target_path.mkpath @target_path.mkpath
@pod.chdir do @pod.chdir do
appledoc options.join(' ') appledoc Escape.shell_command(options)
end
# appledoc exits with 1 if a warning was logged
if $?.exitstatus >= 2
raise "Appledoc encountered an error (exitstatus: #{$?.exitstatus})."
end end
rescue Exception => e rescue Exception => e
if e.is_a?(Informative) if e.is_a?(Informative)
puts "[!] Skipping documentation generation because appledoc can't be found." if config.verbose? puts "[!] Skipping documentation generation because appledoc can't be found." if config.verbose?
......
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