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
ba8d1345
Commit
ba8d1345
authored
May 16, 2015
by
Olivier Halligon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make `pod cache list` YAML-compatible
parent
2fdac707
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
list.rb
lib/cocoapods/command/cache/list.rb
+17
-15
No files found.
lib/cocoapods/command/cache/list.rb
View file @
ba8d1345
...
@@ -26,39 +26,41 @@ module Pod
...
@@ -26,39 +26,41 @@ module Pod
end
end
def
run
def
run
UI
.
puts
(
"
Cache root
:
#{
@cache
.
root
}
"
)
if
@short_output
UI
.
puts
(
"
$CACHE_ROOT
:
#{
@cache
.
root
}
"
)
if
@short_output
if
@pod_name
.
nil?
# Print all
if
@pod_name
.
nil?
# Print all
@cache
.
cache_descriptors_per_pod
.
each
do
|
pod
,
cache_desc
|
@cache
.
cache_descriptors_per_pod
.
each
do
|
pod_name
,
cache_descriptors
|
UI
.
title
pod
print_pod_cache_infos
(
pod_name
,
cache_descriptors
)
print_pod_cache_infos
(
cache_desc
)
end
end
else
# Print only for the requested pod
else
# Print only for the requested pod
cache_descriptors
=
@cache
.
cache_descriptors_per_pod
[
@pod_name
]
cache_descriptors
=
@cache
.
cache_descriptors_per_pod
[
@pod_name
]
if
cache_descriptors
.
nil?
if
cache_descriptors
.
nil?
UI
.
notice
(
"No cache for pod named
#{
@pod_name
}
found"
)
UI
.
notice
(
"No cache for pod named
#{
@pod_name
}
found"
)
else
else
print_pod_cache_infos
(
cache_descriptors
)
print_pod_cache_infos
(
@pod_name
,
cache_descriptors
)
end
end
end
end
end
end
private
private
# Prints the list of specs & pod cache dirs for a single pod name
# Prints the list of specs & pod cache dirs for a single pod name
.
#
#
# @param [Array<Hash>] info_list
# This output is valid YAML so it can be parsed with 3rd party tools
#
# @param [Array<Hash>] cache_descriptors
# The various infos about a pod cache. Keys are
# The various infos about a pod cache. Keys are
# :spec_file, :version, :release and :slug
# :spec_file, :version, :release and :slug
#
#
def
print_pod_cache_infos
(
info_list
)
def
print_pod_cache_infos
(
pod_name
,
cache_descriptors
)
info_list
.
each
do
|
info
|
UI
.
puts
"
#{
pod_name
}
:"
UI
.
section
(
"
#{
info
[
:version
]
}
(
#{
pod_type
(
info
)
}
)"
)
do
cache_descriptors
.
each
do
|
desc
|
if
@short_output
if
@short_output
[
:spec_file
,
:slug
].
each
{
|
k
|
info
[
k
]
=
info
[
k
].
relative_path_from
(
@cache
.
root
)
}
[
:spec_file
,
:slug
].
each
{
|
k
|
desc
[
k
]
=
desc
[
k
].
relative_path_from
(
@cache
.
root
)
}
end
UI
.
labeled
(
'Spec'
,
info
[
:spec_file
])
UI
.
labeled
(
'Pod'
,
info
[
:slug
])
end
end
UI
.
puts
(
" - Version:
#{
desc
[
:version
]
}
"
)
UI
.
puts
(
" Type:
#{
pod_type
(
desc
)
}
"
)
UI
.
puts
(
" Spec:
#{
desc
[
:spec_file
]
}
"
)
UI
.
puts
(
" Pod:
#{
desc
[
:slug
]
}
"
)
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