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
2019ee33
Commit
2019ee33
authored
Jul 23, 2013
by
Chris McKnight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move license info into podfile-info command
parent
11124e93
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
51 deletions
+8
-51
command.rb
lib/cocoapods/command.rb
+0
-1
licenses.rb
lib/cocoapods/command/licenses.rb
+0
-47
podfile_info.rb
lib/cocoapods/command/podfile_info.rb
+8
-3
No files found.
lib/cocoapods/command.rb
View file @
2019ee33
...
...
@@ -11,7 +11,6 @@ module Pod
require
'cocoapods/command/help'
require
'cocoapods/command/inter_process_communication'
require
'cocoapods/command/lib'
require
'cocoapods/command/licenses'
require
'cocoapods/command/list'
require
'cocoapods/command/outdated'
require
'cocoapods/command/podfile_info'
...
...
lib/cocoapods/command/licenses.rb
deleted
100644 → 0
View file @
11124e93
module
Pod
class
Command
class
Licenses
<
Command
self
.
summary
=
'Show licenses of installed pods'
self
.
description
=
<<-
DESC
Shows the licenses of installed pods
DESC
def
initialize
(
argv
)
super
end
def
run
verify_podfile_exists!
verify_lockfile_exists!
lockfile
=
config
.
lockfile
pods
=
lockfile
.
pod_names
licenses
=
[]
deps
=
lockfile
.
dependencies
.
map
{
|
d
|
d
.
name
}
pods
=
(
deps
+
pods
).
uniq
pods
.
each
do
|
pod_name
|
spec
=
(
Pod
::
SourcesManager
.
search_by_name
(
pod_name
).
first
rescue
nil
)
license
=
"Unknown"
if
spec
specification
=
spec
.
specification
license
=
specification
.
license
[
:type
]
||
"Unknown"
end
licenses
<<
[
pod_name
,
license
]
end
if
licenses
.
empty?
UI
.
puts
"No pods found."
.
yellow
else
UI
.
section
"Licenses:"
do
licenses
.
each
do
|
(
name
,
license
)
|
UI
.
puts
"
#{
name
}
:
#{
license
}
"
end
end
end
end
end
end
end
lib/cocoapods/command/podfile_info.rb
View file @
2019ee33
...
...
@@ -14,13 +14,15 @@ module Pod
def
self
.
options
[
[
"--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
)
end
def
initialize
(
argv
)
@info_all
=
argv
.
flag?
(
'all'
)
@info_in_md
=
argv
.
flag?
(
'md'
)
@info_license
=
argv
.
flag?
(
'license'
)
@podfile_path
=
argv
.
shift_argument
super
end
...
...
@@ -64,6 +66,9 @@ module Pod
if
spec
info
=
{}
keys
.
each
{
|
k
|
info
[
k
]
=
spec
.
specification
.
send
(
k
)
}
if
@info_license
info
[
:license
]
||=
spec
.
specification
.
license
[
:type
]
end
pods_info
<<
info
else
...
...
@@ -78,9 +83,9 @@ module Pod
pods
.
each
do
|
pod
|
if
in_md
UI
.
puts
"* [
#{
pod
[
:name
]
}
](
#{
pod
[
:homepage
]
}
) -
#{
pod
[
:summary
]
}
"
UI
.
puts
[
"* [
#{
pod
[
:name
]
}
](
#{
pod
[
:homepage
]
}
) -
#{
pod
[
:summary
]
}
"
,
pod
[
:license
]].
compact
.
join
(
' - '
)
else
UI
.
puts
"-
#{
pod
[
:name
]
}
-
#{
pod
[
:summary
]
}
"
UI
.
puts
[
"-
#{
pod
[
:name
]
}
-
#{
pod
[
:summary
]
}
"
,
pod
[
:license
]].
compact
.
join
(
' - '
)
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