Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
ce731f92
Commit
ce731f92
authored
Mar 17, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
force appledoc to show undocumented classes and other updates
parent
d2f5a70c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
49 deletions
+90
-49
Rakefile
Rakefile
+1
-1
docs_generator.rb
lib/cocoapods/docs_generator.rb
+71
-36
banana-lib.tar.gz
spec/fixtures/banana-lib.tar.gz
+0
-0
integration_spec.rb
spec/integration_spec.rb
+3
-3
docs_generator_spec.rb
spec/unit/docs_generator_spec.rb
+15
-9
No files found.
Rakefile
View file @
ce731f92
...
...
@@ -144,7 +144,7 @@ namespace :examples do
command
=
"xcodebuild -workspace '
#{
example
.
basename
}
.xcworkspace' -scheme '
#{
example
.
basename
}
'"
if
(
example
+
'Podfile'
).
read
.
include?
(
'platform :ios'
)
# Specifically build against the simulator SDK so we don't have to deal with code signing.
command
<<
" -sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk"
command
<<
" -sdk /
Applications/Xcode.app/Contents/
Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk"
end
sh
command
end
...
...
lib/cocoapods/docs_generator.rb
View file @
ce731f92
...
...
@@ -10,62 +10,97 @@ module Pod
@options
=
pod
.
specification
.
documentation
||
{}
end
def
appledoc
(
options
)
bin
=
`which appledoc`
.
strip
if
bin
.
empty?
return
end
arguments
=
[]
arguments
+=
options
arguments
<<
'--print-settings'
if
Config
.
instance
.
verbose?
arguments
+=
self
.
files
Open3
.
popen3
(
'appledoc'
,
*
arguments
)
do
|
i
,
o
,
e
|
if
Config
.
instance
.
verbose?
puts
o
.
read
.
chomp
puts
e
.
read
.
chomp
else
# TODO: This is needed otherwise appledoc will not install the doc set
# This is a work around related to poor understanding of the IO class.
o
.
read
e
.
read
end
def
name
@specification
.
to_s
end
def
company
if
@specification
.
authors
@specification
.
authors
.
keys
.
join
(
', '
)
else
'no-company'
end
end
def
generate_appledoc_options
project_company
=
@specification
.
authors
?
@specification
.
authors
.
keys
.
join
(
', '
)
:
'no-company'
options
=
[
'--project-name'
,
@specification
.
to_s
,
'--project-company'
,
project_company
,
'--docset-copyright'
,
project_company
,
'--company-id'
,
'org.cocoapods'
,
'--ignore'
,
'.m'
]
options
+=
[
'--docset-desc'
,
@specification
.
description
]
if
@specification
.
description
[
'README.md'
,
'README.mdown'
,
'README.markdown'
,
'README'
].
each
do
|
f
|
def
copyright
company
end
def
description
@specification
.
description
||
"Generated by CocoaPods."
end
def
docs_id
'org.cocoapods'
end
def
files
@pod
.
absolute_source_files
end
def
index_file
candidates
=
[
'README.md'
,
'README.mdown'
,
'README.markdown'
,
'README'
]
candidates
.
each
do
|
f
|
if
File
.
file?
(
@pod
.
root
+
f
)
options
+=
[
'--index-desc'
,
f
]
break
return
f
end
end
options
+=
@options
[
:appledoc
]
if
@options
[
:appledoc
]
options
nil
end
def
spec_appledoc_options
@options
[
:appledoc
]
||
[]
end
def
files
@pod
.
absolute_source_files
def
generate_appledoc_options
options
=
[
'--project-name'
,
name
,
'--docset-desc'
,
description
,
'--project-company'
,
company
,
'--docset-copyright'
,
copyright
,
'--company-id'
,
docs_id
,
'--ignore'
,
'.m'
,
'--keep-undocumented-objects'
,
'--keep-undocumented-members'
]
index
=
index_file
options
+=
[
'--index-desc'
,
index
]
if
index
options
+=
spec_appledoc_options
end
def
generate
(
install
=
false
)
options
=
generate_appledoc_options
options
+=
[
'--output'
,
@target_path
]
options
<<
'--keep-intermediate-files'
options
<<
'--no-create-docset'
unless
install
options
+=
[
'--keep-intermediate-files'
]
options
+=
[
'--no-create-docset'
]
unless
install
@target_path
.
mkpath
@pod
.
chdir
do
appledoc
(
options
)
end
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?
return
end
arguments
=
[]
arguments
+=
options
arguments
+=
[
'--print-settings'
]
if
Config
.
instance
.
verbose?
arguments
+=
files
Open3
.
popen3
(
'appledoc'
,
*
arguments
)
do
|
i
,
o
,
e
|
if
Config
.
instance
.
verbose?
puts
o
.
read
.
chomp
puts
e
.
read
.
chomp
else
# TODO: This is needed otherwise appledoc may not install the doc set
# This is a work around related to poor understanding of the IO class.
o
.
read
e
.
read
end
end
end
end
end
spec/fixtures/banana-lib.tar.gz
View file @
ce731f92
No preview for this file type
spec/integration_spec.rb
View file @
ce731f92
...
...
@@ -139,11 +139,11 @@ else
installer
=
SpecHelper
::
Installer
.
new
(
podfile
)
installer
.
install!
doc
=
(
config
.
project_pods_root
+
'Documentation/JSONKit/html/index.html'
).
read
doc
.
should
.
include?
(
'JSONKit (1.4)'
)
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
end
...
...
spec/unit/docs_generator_spec.rb
View file @
ce731f92
...
...
@@ -30,15 +30,17 @@ describe Pod::DocsGenerator do
it
'returns the Pod documentation options'
do
@doc_installer
.
generate_appledoc_options
.
should
==
[
"--project-name"
,
"BananaLib (1.0)"
,
"--project-company"
,
"Monkey Boy, Banana Corp"
,
"--docset-copyright"
,
"Monkey Boy, Banana Corp"
,
"--company-id"
,
"org.cocoapods"
,
"--ignore"
,
".m"
,
"--docset-desc"
,
"Full of chunky bananas."
,
"--index-desc"
,
"README"
,
"--project-company"
,
"Banana Corp"
,
"--company-id"
,
"com.banana"
'--project-name'
,
'BananaLib (1.0)'
,
'--docset-desc'
,
'Full of chunky bananas.'
,
'--project-company'
,
'Monkey Boy, Banana Corp'
,
'--docset-copyright'
,
'Monkey Boy, Banana Corp'
,
'--company-id'
,
'org.cocoapods'
,
'--ignore'
,
'.m'
,
'--keep-undocumented-objects'
,
'--keep-undocumented-members'
,
'--index-desc'
,
'README'
,
'--project-company'
,
'Banana Corp'
,
'--company-id'
,
'com.banana'
]
end
...
...
@@ -48,6 +50,10 @@ describe Pod::DocsGenerator do
it
'it creates the html'
do
File
.
directory?
(
@sandbox
.
root
+
"Documentation/BananaLib/html"
).
should
.
be
.
true
index
=
(
@sandbox
.
root
+
'Documentation/BananaLib/html/index.html'
).
read
index
.
should
.
include?
(
'BananaObj'
)
index
=
(
@sandbox
.
root
+
'Documentation/BananaLib/html/Classes/BananaObj.html'
).
read
index
.
should
.
include?
(
'Bananas are cool'
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment