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
6dc80f02
Commit
6dc80f02
authored
Mar 07, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#149] Documentation and license - syntax change
parent
c2008b4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
33 deletions
+46
-33
spec.rb
lib/cocoapods/command/spec.rb
+31
-25
specification.rb
lib/cocoapods/specification.rb
+15
-8
No files found.
lib/cocoapods/command/spec.rb
View file @
6dc80f02
...
@@ -40,7 +40,6 @@ module Pod
...
@@ -40,7 +40,6 @@ module Pod
Pod::Spec.new do |s|
Pod::Spec.new do |s|
s.name = '
#{
@name
}
'
s.name = '
#{
@name
}
'
s.version = '1.0.0'
s.version = '1.0.0'
s.license = 'MIT'
s.summary = 'A short description of
#{
@name
}
.'
s.summary = 'A short description of
#{
@name
}
.'
s.homepage = 'http://EXAMPLE/
#{
@name
}
'
s.homepage = 'http://EXAMPLE/
#{
@name
}
'
s.author = { '
#{
author
}
' => '
#{
email
}
' }
s.author = { '
#{
author
}
' => '
#{
email
}
' }
...
@@ -53,30 +52,37 @@ module Pod
...
@@ -53,30 +52,37 @@ module Pod
s.description = 'An optional longer description of
#{
@name
}
.'
s.description = 'An optional longer description of
#{
@name
}
.'
# If available specify the online link for the documentation and
# If available specify the documentation sources.
# the atom link of the Xcode 4 compatible documentation set.
# :html The online link for the documentation.
# If the pod supports appledoc documentation generation enable it
# :atom The atom link of the Xcode 4 compatible documentation set.
# and specify the appledoc options. Appledoc will be run on the files
# :appledoc If the pod uses appledoc specify the options. The command
# specified in s.source_file.
# will be run on the files specified in s.source_file.
#
#
# s.documentation[:html] = 'http://EXAMPLE/
#{
@name
}
/documentation'
s.documentation = {
# s.documentation[:atom] = 'http://EXAMPLE/
#{
@name
}
/com.company.
#{
@name
}
.atom'
# :html => 'http://EXAMPLE/
#{
@name
}
/documentation',
# s.documentation[:appledoc] = true
# :atom => 'http://EXAMPLE/
#{
@name
}
/com.company.
#{
@name
}
.atom',
# s.documentation[:options] << '--project-name' << '
#{
@name
}
' <<
# :appledoc => ['--project-name', '
#{
@name
}
',
# '--project-company' << '"Company Name"' <<
# '--project-company', '"Company Name"',
# '--company-id' << 'com.company' <<
# '--company-id', 'com.company',
# '--output' << './doc' <<
# '--output', './doc',
# '--ignore' << 'Common' <<
# '--ignore', 'Common',
# '--ignore' << '.m'
# '--ignore', '.m']
}
# Specify the file containing the license of the pod.
# If a dedicated license file is not available specify a file containing
# Specify the license of the pod.
# the license and the ruby range of the relevant lines. If the license
# :type The type of the license.
# is not available in any file it is specify the text directly.
# :file The file containing the license of the pod.
#
# :range If a dedicated license file is not available specify a file
s.license_text[:file] = 'LICENSE'
# that contains the license and the range of the lines
# s.license_text[:range] = 1..15
# containing the license.
# s.license_text[:text] = 'Permission is hereby granted ...'
# :text If the license is not available in any of the files it should be
# included here.
s.license = {
:type => 'MIT',
:file => 'LICENSE',
# :range => 1..15,
# :text => 'Permission is hereby granted ...'
}
# If this Pod runs only on iOS or OS X, then specify that with one of
# If this Pod runs only on iOS or OS X, then specify that with one of
# these, or none if it runs on both platforms.
# these, or none if it runs on both platforms.
...
...
lib/cocoapods/specification.rb
View file @
6dc80f02
...
@@ -29,8 +29,7 @@ module Pod
...
@@ -29,8 +29,7 @@ module Pod
# TODO This is just to work around a MacRuby bug
# TODO This is just to work around a MacRuby bug
def
post_initialize
def
post_initialize
@documentation
,
@license_text
=
{},
{}
@dependencies
,
@source_files
,
@resources
,
@clean_paths
,
@subspecs
,
=
[],
[],
[],
[],
[]
@dependencies
,
@source_files
,
@resources
,
@clean_paths
,
@subspecs
,
@documentation
[
:options
]
=
[],
[],
[],
[],
[],
[]
@platform
=
Platform
.
new
(
nil
)
@platform
=
Platform
.
new
(
nil
)
@xcconfig
=
Xcodeproj
::
Config
.
new
@xcconfig
=
Xcodeproj
::
Config
.
new
end
end
...
@@ -41,8 +40,6 @@ module Pod
...
@@ -41,8 +40,6 @@ module Pod
attr_accessor
:homepage
attr_accessor
:homepage
attr_accessor
:description
attr_accessor
:description
attr_accessor
:source
attr_accessor
:source
attr_accessor
:license
attr_accessor
:license_text
attr_accessor
:documentation
attr_accessor
:documentation
attr_reader
:version
attr_reader
:version
...
@@ -61,12 +58,22 @@ module Pod
...
@@ -61,12 +58,22 @@ module Pod
alias_method
:author
=
,
:authors
=
alias_method
:author
=
,
:authors
=
attr_reader
:authors
attr_reader
:authors
def
summary
=
(
summary
)
def
summary
=
(
summary
)
@summary
=
summary
@summary
=
summary
end
end
attr_reader
:summary
attr_reader
:summary
def
license
=
(
license
)
if
license
.
kind_of?
(
Array
)
@license
=
license
[
1
].
merge
({
:type
=>
license
[
0
]})
elsif
license
.
kind_of?
(
String
)
@license
=
{
:type
=>
license
}
else
@license
=
license
end
end
attr_reader
:license
def
description
def
description
@description
||
summary
@description
||
summary
end
end
...
@@ -154,11 +161,11 @@ module Pod
...
@@ -154,11 +161,11 @@ module Pod
# Not attributes
# Not attributes
include
Config
::
Mixin
include
Config
::
Mixin
def
local?
def
local?
!
source
.
nil?
&&
!
source
[
:local
].
nil?
!
source
.
nil?
&&
!
source
[
:local
].
nil?
end
end
def
local_path
def
local_path
Pathname
.
new
(
File
.
expand_path
(
source
[
:local
]))
Pathname
.
new
(
File
.
expand_path
(
source
[
:local
]))
end
end
...
@@ -381,7 +388,7 @@ module Pod
...
@@ -381,7 +388,7 @@ module Pod
end
end
# Override the getters to always return the value of the top level parent spec.
# Override the getters to always return the value of the top level parent spec.
[
:version
,
:summary
,
:platform
,
:license
,
:
license_text
,
:
authors
,
:requires_arc
,
:compiler_flags
,
:documentation
].
each
do
|
attr
|
[
:version
,
:summary
,
:platform
,
:license
,
:authors
,
:requires_arc
,
:compiler_flags
,
:documentation
].
each
do
|
attr
|
define_method
(
attr
)
{
top_level_parent
.
send
(
attr
)
}
define_method
(
attr
)
{
top_level_parent
.
send
(
attr
)
}
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