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
9838d174
Commit
9838d174
authored
May 10, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable caching for specs and remove configurable git cache size.
parent
f03ed11c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
config.rb
lib/cocoapods/config.rb
+0
-1
git.rb
lib/cocoapods/downloader/git.rb
+5
-6
spec_helper.rb
spec/spec_helper.rb
+0
-1
No files found.
lib/cocoapods/config.rb
View file @
9838d174
...
...
@@ -28,7 +28,6 @@ module Pod
@repos_dir
=
Pathname
.
new
(
File
.
expand_path
(
"~/.cocoapods"
))
@verbose
=
@silent
=
@force_doc
=
false
@clean
=
@generate_docs
=
@doc_install
=
@integrate_targets
=
true
@git_cache_size
=
500
end
def
project_root
...
...
lib/cocoapods/downloader/git.rb
View file @
9838d174
...
...
@@ -9,6 +9,8 @@ module Pod
include
Config
::
Mixin
executable
:git
MAX_CACHE_SIZE
=
500
def
download
prepare_cache
puts
'->'
.
green
<<
' Cloning git repo'
if
config
.
verbose?
...
...
@@ -23,7 +25,7 @@ module Pod
end
def
prepare_cache
unless
cache_exist?
||
config
.
git_cache_size
==
0
unless
cache_exist?
puts
'->'
.
green
<<
" Creating cache git repo (
#{
cache_path
}
)"
if
config
.
verbose?
cache_path
.
rmtree
if
cache_path
.
exist?
cache_path
.
mkpath
...
...
@@ -35,7 +37,7 @@ module Pod
return
unless
caches_dir
.
exist?
Dir
.
chdir
(
caches_dir
)
do
repos
=
Pathname
.
new
(
caches_dir
).
children
.
select
{
|
c
|
c
.
directory?
}.
sort_by
(
&
:ctime
)
while
caches_size
>=
config
.
git_cache_size
&&
!
repos
.
empty?
while
caches_size
>=
MAX_CACHE_SIZE
&&
!
repos
.
empty?
dir
=
repos
.
shift
puts
'->'
.
yellow
<<
" Removing git cache for `
#{
origin_url
(
dir
)
}
'"
if
config
.
verbose?
dir
.
rmtree
...
...
@@ -60,8 +62,7 @@ module Pod
end
def
clone_url
# git_cache_size = 0 disables the cache
config
.
git_cache_size
==
0
?
url
:
cache_path
cache_path
end
def
caches_size
...
...
@@ -70,7 +71,6 @@ module Pod
end
def
update_cache
return
if
config
.
git_cache_size
==
0
puts
'->'
.
green
<<
" Updating cache git repo (
#{
cache_path
}
)"
if
config
.
verbose?
Dir
.
chdir
(
cache_path
)
do
git
"reset --hard HEAD"
...
...
@@ -80,7 +80,6 @@ module Pod
end
def
ensure_ref_exists
(
ref
)
return
if
config
.
git_cache_size
==
0
Dir
.
chdir
(
cache_path
)
{
git
"rev-list --max-count=1
#{
ref
}
"
}
return
if
$?
==
0
# Skip pull if not needed
...
...
spec/spec_helper.rb
View file @
9838d174
...
...
@@ -53,7 +53,6 @@ end
config
=
Pod
::
Config
.
instance
config
.
silent
=
true
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
config
.
git_cache_size
=
0
require
'tmpdir'
...
...
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