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
beaaa73b
Commit
beaaa73b
authored
Jul 23, 2013
by
Chris McKnight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just add license as a key to get from the specification
parent
2019ee33
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
podfile_info.rb
lib/cocoapods/command/podfile_info.rb
+5
-9
No files found.
lib/cocoapods/command/podfile_info.rb
View file @
beaaa73b
...
@@ -14,8 +14,7 @@ module Pod
...
@@ -14,8 +14,7 @@ module Pod
def
self
.
options
def
self
.
options
[
[
[
"--all"
,
"Show information about all Pods with dependencies that are used in a project"
],
[
"--all"
,
"Show information about all Pods with dependencies that are used in a project"
],
[
"--md"
,
"Output information in Markdown format"
],
[
"--md"
,
"Output information in Markdown format"
]
[
"--license"
,
"Additionally output license type"
]
].
concat
(
super
)
].
concat
(
super
)
end
end
...
@@ -59,16 +58,13 @@ module Pod
...
@@ -59,16 +58,13 @@ module Pod
pods
.
collect!
{
|
pod
|
(
pod
.
is_a?
(
Hash
))
?
pod
.
keys
.
first
:
pod
}
pods
.
collect!
{
|
pod
|
(
pod
.
is_a?
(
Hash
))
?
pod
.
keys
.
first
:
pod
}
end
end
def
pods_info_hash
(
pods
,
keys
=
[
:name
,
:homepage
,
:summary
])
def
pods_info_hash
(
pods
,
keys
=
[
:name
,
:homepage
,
:summary
,
:license
])
pods_info
=
[]
pods_info
=
[]
pods
.
each
do
|
pod
|
pods
.
each
do
|
pod
|
spec
=
(
Pod
::
SourcesManager
.
search_by_name
(
pod
).
first
rescue
nil
)
spec
=
(
Pod
::
SourcesManager
.
search_by_name
(
pod
).
first
rescue
nil
)
if
spec
if
spec
info
=
{}
info
=
{}
keys
.
each
{
|
k
|
info
[
k
]
=
spec
.
specification
.
send
(
k
)
}
keys
.
each
{
|
k
|
info
[
k
]
=
spec
.
specification
.
send
(
k
)
}
if
@info_license
info
[
:license
]
||=
spec
.
specification
.
license
[
:type
]
end
pods_info
<<
info
pods_info
<<
info
else
else
...
@@ -79,13 +75,13 @@ module Pod
...
@@ -79,13 +75,13 @@ module Pod
end
end
def
pods_info
(
pods
,
in_md
=
false
)
def
pods_info
(
pods
,
in_md
=
false
)
pods
=
pods_info_hash
(
pods
,
[
:name
,
:homepage
,
:summary
])
pods
=
pods_info_hash
(
pods
,
[
:name
,
:homepage
,
:summary
,
:license
])
pods
.
each
do
|
pod
|
pods
.
each
do
|
pod
|
if
in_md
if
in_md
UI
.
puts
[
"* [
#{
pod
[
:name
]
}
](
#{
pod
[
:homepage
]
}
) -
#{
pod
[
:summary
]
}
"
,
pod
[
:license
]].
compact
.
join
(
' - '
)
UI
.
puts
"* [
#{
pod
[
:name
]
}
](
#{
pod
[
:homepage
]
}
) -
#{
pod
[
:summary
]
}
-
#{
pod
[
:license
][
:type
]
}
"
else
else
UI
.
puts
[
"-
#{
pod
[
:name
]
}
-
#{
pod
[
:summary
]
}
"
,
pod
[
:license
]].
compact
.
join
(
' - '
)
UI
.
puts
"-
#{
pod
[
:name
]
}
-
#{
pod
[
:summary
]
}
-
#{
pod
[
:license
][
:type
]
}
"
end
end
end
end
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