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
872dc480
Commit
872dc480
authored
Mar 08, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ACL to the cache
parent
d52828ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
cache.rb
lib/cocoapods/downloader/cache.rb
+18
-16
No files found.
lib/cocoapods/downloader/cache.rb
View file @
872dc480
...
...
@@ -6,28 +6,13 @@ module Pod
class
Cache
Result
=
Struct
.
new
(
:location
,
:spec
,
:checkout_options
)
attr_
accesso
r
:root
attr_
reade
r
:root
def
initialize
(
root
)
@root
=
root
root
.
mkpath
unless
root
.
exist?
end
def
cache_key
(
pod_name
,
version
=
nil
,
downloader_opts
=
nil
)
raise
ArgumentError
unless
pod_name
||
(
!
version
&&
!
downloader_opts
)
if
version
"Release/
#{
pod_name
}
/
#{
version
}
"
elsif
downloader_opts
opts
=
downloader_opts
.
to_a
.
sort_by
(
&
:first
).
map
{
|
k
,
v
|
"
#{
k
}
=
#{
v
}
"
}.
join
(
'-'
).
gsub
(
/
#{
File
::
SEPARATOR
}
+/
,
'+'
)
"External/
#{
pod_name
}
/
#{
opts
}
"
end
end
def
path_for_pod
(
name
,
version
=
nil
,
downloader_opts
=
nil
)
root
+
cache_key
(
name
,
version
,
downloader_opts
)
end
def
download_pod
(
name_or_spec
,
released
=
false
,
downloader_opts
=
nil
,
head
=
false
)
spec
=
nil
if
name_or_spec
.
is_a?
Pod
::
Specification
...
...
@@ -73,6 +58,23 @@ module Pod
raise
end
private
def
cache_key
(
pod_name
,
version
=
nil
,
downloader_opts
=
nil
)
raise
ArgumentError
unless
pod_name
||
(
!
version
&&
!
downloader_opts
)
if
version
"Release/
#{
pod_name
}
/
#{
version
}
"
elsif
downloader_opts
opts
=
downloader_opts
.
to_a
.
sort_by
(
&
:first
).
map
{
|
k
,
v
|
"
#{
k
}
=
#{
v
}
"
}.
join
(
'-'
).
gsub
(
/
#{
File
::
SEPARATOR
}
+/
,
'+'
)
"External/
#{
pod_name
}
/
#{
opts
}
"
end
end
def
path_for_pod
(
name
,
version
=
nil
,
downloader_opts
=
nil
)
root
+
cache_key
(
name
,
version
,
downloader_opts
)
end
def
download
(
name
,
target
,
params
,
head
)
downloader
=
Downloader
.
for_target
(
target
,
params
)
if
head
...
...
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