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
46ea3110
Commit
46ea3110
authored
Mar 15, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#149] removed atom support force appledoc
parent
75abdeda
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
36 deletions
+16
-36
install.rb
lib/cocoapods/command/install.rb
+2
-2
spec.rb
lib/cocoapods/command/spec.rb
+0
-2
config.rb
lib/cocoapods/config.rb
+1
-1
installer.rb
lib/cocoapods/installer.rb
+2
-3
local_pod.rb
lib/cocoapods/local_pod.rb
+9
-22
specification_spec.rb
spec/unit/specification_spec.rb
+2
-6
No files found.
lib/cocoapods/command/install.rb
View file @
46ea3110
...
@@ -20,8 +20,8 @@ module Pod
...
@@ -20,8 +20,8 @@ module Pod
def
self
.
options
def
self
.
options
" --no-clean Leave SCM dirs like `.git' and `.svn' in tact after downloading
\n
"
+
" --no-clean Leave SCM dirs like `.git' and `.svn' in tact after downloading
\n
"
+
" --no-update Skip running `pod repo update` before install
\n
"
+
" --no-update Skip running `pod repo update` before install
\n
"
+
" --doc-force Generate documentation for all pods with appledoc
\n
"
+
" --no-doc Skip documentation generation
\n
"
+
" --no-doc Skip documentation generation
\n
"
+
" --no-doc-force Generate documentation only for the pods that support it
\n
"
+
" --no-doc-install Skip documentation installation to Xcode
\n
"
+
" --no-doc-install Skip documentation installation to Xcode
\n
"
+
super
super
end
end
...
@@ -30,7 +30,7 @@ module Pod
...
@@ -30,7 +30,7 @@ module Pod
config
.
clean
=
!
argv
.
option
(
'--no-clean'
)
config
.
clean
=
!
argv
.
option
(
'--no-clean'
)
config
.
doc
=
!
argv
.
option
(
'--no-doc'
)
config
.
doc
=
!
argv
.
option
(
'--no-doc'
)
config
.
doc_install
=
!
argv
.
option
(
'--no-doc-install'
)
config
.
doc_install
=
!
argv
.
option
(
'--no-doc-install'
)
config
.
doc_force
=
argv
.
option
(
'-
-doc-force'
)
config
.
doc_force
=
!
argv
.
option
(
'--no
-doc-force'
)
@update_repo
=
!
argv
.
option
(
'--no-update'
)
@update_repo
=
!
argv
.
option
(
'--no-update'
)
@projpath
=
argv
.
shift_argument
@projpath
=
argv
.
shift_argument
super
unless
argv
.
empty?
super
unless
argv
.
empty?
...
...
lib/cocoapods/command/spec.rb
View file @
46ea3110
...
@@ -54,13 +54,11 @@ module Pod
...
@@ -54,13 +54,11 @@ module Pod
# If available specify the documentation sources.
# If available specify the documentation sources.
# :html The online link for the documentation.
# :html The online link for the documentation.
# :atom The atom link of the Xcode 4 compatible documentation set.
# :appledoc If the pod uses appledoc specify the options. The command
# :appledoc If the pod uses appledoc specify the options. The command
# will be run on the files specified in s.source_file.
# will be run on the files specified in s.source_file.
#
#
s.documentation = {
s.documentation = {
# :html => 'http://EXAMPLE/
#{
@name
}
/documentation',
# :html => 'http://EXAMPLE/
#{
@name
}
/documentation',
# :atom => 'http://EXAMPLE/
#{
@name
}
/com.company.
#{
@name
}
.atom',
# :appledoc => ['--project-name', '
#{
@name
}
',
# :appledoc => ['--project-name', '
#{
@name
}
',
# '--project-company', 'Company Name',
# '--project-company', 'Company Name',
# '--company-id', 'com.company',
# '--company-id', 'com.company',
...
...
lib/cocoapods/config.rb
View file @
46ea3110
...
@@ -25,7 +25,7 @@ module Pod
...
@@ -25,7 +25,7 @@ module Pod
@silent
=
false
@silent
=
false
@doc
=
true
@doc
=
true
@doc_install
=
true
@doc_install
=
true
@doc_force
=
fals
e
@doc_force
=
tru
e
end
end
def
project_root
def
project_root
...
...
lib/cocoapods/installer.rb
View file @
46ea3110
...
@@ -53,10 +53,9 @@ module Pod
...
@@ -53,10 +53,9 @@ module Pod
downloader
.
download
downloader
.
download
if
config
.
doc?
if
config
.
doc?
doc_source
=
pod
.
generate_documentation
(
config
.
doc_install?
,
config
.
doc_force?
,
config
.
verbose?
)
if
pod
.
generate_documentation
(
config
.
doc_install?
,
config
.
doc_force?
,
config
.
verbose?
)
if
doc_source
action
=
config
.
doc_install
?
'installed'
:
'generated'
action
=
config
.
doc_install
?
'installed'
:
'generated'
puts
"
#{
action
}
#{
doc_source
}
documentation"
unless
config
.
silent?
puts
"
#{
action
}
documentation"
unless
config
.
silent?
end
end
end
end
...
...
lib/cocoapods/local_pod.rb
View file @
46ea3110
...
@@ -83,19 +83,21 @@ module Pod
...
@@ -83,19 +83,21 @@ module Pod
#
#
def
generate_documentation
(
install
,
force
=
true
,
verbose
=
false
)
def
generate_documentation
(
install
,
force
=
true
,
verbose
=
false
)
documentation
=
specification
.
documentation
?
specification
.
documentation
:
{}
documentation
=
specification
.
documentation
?
specification
.
documentation
:
{}
success
=
false
if
force
||
documentation
.
has_key?
(
:appledoc
)
if
force
||
documentation
.
has_key?
(
:appledoc
)
`which appledoc`
`which appledoc`
return
nil
unless
$?
.
success?
return
nil
unless
$?
.
success?
dir
=
"
#{
@sandbox
.
root
}
/Documentation/
#{
name
}
/"
dir
=
"
#{
@sandbox
.
root
}
/Documentation/
#{
name
}
/"
FileUtils
.
mkdir_p
(
dir
)
FileUtils
.
mkdir_p
(
dir
)
# default options
# default options
#inline spec may not have some fields like authors
project_company
=
specification
.
authors
?
specification
.
authors
.
keys
.
to_s
:
'no-company-specified'
options
=
[
'--project-name'
,
specification
.
to_s
,
options
=
[
'--project-name'
,
specification
.
to_s
,
'--project-company'
,
specification
.
authors
.
keys
.
to_s
,
'--project-company'
,
project_company
,
'--docset-copyright'
,
"Generated by cocoapods (see
#{
specification
.
homepage
}
for copyright information)."
,
'--docset-desc'
,
specification
.
description
,
'--company-id'
,
'org.cocoapods'
,
'--company-id'
,
'org.cocoapods'
,
'--ignore'
,
'.m'
]
'--ignore'
,
'.m'
]
options
+=
[
'--docset-copyright'
,
"Generated by cocoapods (see
#{
specification
.
homepage
}
for copyright information)."
]
if
specification
.
homepage
options
+=
[
'--docset-desc'
,
specification
.
description
]
if
specification
.
description
# spec options
# spec options
options
+=
documentation
[
:appledoc
]
if
documentation
[
:appledoc
]
options
+=
documentation
[
:appledoc
]
if
documentation
[
:appledoc
]
# options that can't be overridden
# options that can't be overridden
...
@@ -104,29 +106,14 @@ module Pod
...
@@ -104,29 +106,14 @@ module Pod
options
+=
[
'--print-settings'
]
if
verbose
options
+=
[
'--print-settings'
]
if
verbose
options
+=
[
'--output'
,
dir
]
options
+=
[
'--output'
,
dir
]
options
+=
expanded_paths
(
specification
.
source_files
,
:glob
=>
'*.{h,m,mm,c,cpp}'
,
:relative_to_sandbox
=>
false
)
options
+=
expanded_paths
(
specification
.
source_files
,
:glob
=>
'*.{h,m,mm,c,cpp}'
,
:relative_to_sandbox
=>
false
)
success
=
false
Open3
.
popen3
(
'appledoc'
,
*
options
)
do
|
stdin
,
stdout
,
stderr
|
Open3
.
popen3
(
'appledoc'
,
*
options
)
do
|
stdin
,
stdout
,
stderr
|
puts
stdout
.
read
.
chomp
if
verbose
puts
stdout
.
read
.
chomp
if
verbose
puts
stderr
.
read
.
chomp
if
verbose
puts
stderr
.
read
.
chomp
if
verbose
# TODO: success test should be more robust
success
=
stderr
.
read
.
chomp
==
""
success
=
stderr
.
read
.
chomp
==
""
end
end
# TODO: should return nil if appledoc fails
end
return
success
?
'appledoc'
:
nil
success
elsif
documentation
[
:atom
]
&&
install
# TODO: donwload and uncompress the docset
# path =
#Open3.popen3('osascript') { |stdin, stdout, stderr|
#stdin.puts('tell application "Xcode"')
#stdin.puts("load documentation set with path \"#{path}\"")
#stdin.puts('end tell')
#stdin.close
#puts stdout.read.chomp if verbose
#puts stderr.read.chomp if verbose
#}
#return 'atom'
end
return
nil
end
end
def
requires_arc?
def
requires_arc?
...
...
spec/unit/specification_spec.rb
View file @
46ea3110
...
@@ -283,22 +283,18 @@ describe "A Pod::Specification, in general," do
...
@@ -283,22 +283,18 @@ describe "A Pod::Specification, in general," do
it
"returns the documentation of the Pod"
do
it
"returns the documentation of the Pod"
do
@spec
.
documentation
=
{
@spec
.
documentation
=
{
:html
=>
'http://EXAMPLE/#{@name}/documentation'
,
:html
=>
'http://EXAMPLE/#{@name}/documentation'
,
:atom
=>
'http://EXAMPLE/#{@name}/com.company.#{@name}.atom'
,
:appledoc
=>
[
'--project-name'
,
'#{@name}'
,
:appledoc
=>
[
'--project-name'
,
'#{@name}'
,
'--project-company'
,
'"Company Name"'
,
'--project-company'
,
'"Company Name"'
,
'--company-id'
,
'com.company'
,
'--company-id'
,
'com.company'
,
'--ignore'
,
'Common'
,
'--ignore'
,
'Common'
,
'--ignore'
,
'.m'
]
'--ignore'
,
'.m'
]
}
}
@spec
.
documentation
.
should
==
{
@spec
.
documentation
[
:html
].
should
==
'http://EXAMPLE/#{@name}/documentation'
:html
=>
'http://EXAMPLE/#{@name}/documentation'
,
@spec
.
documentation
[
:appledoc
].
should
==
[
'--project-name'
,
'#{@name}'
,
:atom
=>
'http://EXAMPLE/#{@name}/com.company.#{@name}.atom'
,
:appledoc
=>
[
'--project-name'
,
'#{@name}'
,
'--project-company'
,
'"Company Name"'
,
'--project-company'
,
'"Company Name"'
,
'--company-id'
,
'com.company'
,
'--company-id'
,
'com.company'
,
'--ignore'
,
'Common'
,
'--ignore'
,
'Common'
,
'--ignore'
,
'.m'
]
'--ignore'
,
'.m'
]
}
end
end
it
"takes a list of paths to clean"
do
it
"takes a list of paths to clean"
do
...
...
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