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
e08be2fe
Commit
e08be2fe
authored
Nov 16, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stash hacking.
parent
7061b9eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
4 deletions
+39
-4
downloader.rb
lib/cocoapods/downloader.rb
+39
-4
No files found.
lib/cocoapods/downloader.rb
View file @
e08be2fe
module
Pod
module
Pod
class
Downloader
class
Downloader
extend
Executable
def
self
.
for_source
(
pod_root
,
source
)
def
self
.
for_source
(
pod_root
,
source
)
options
=
source
.
dup
options
=
source
.
dup
if
url
=
options
.
delete
(
:git
)
if
url
=
options
.
delete
(
:git
)
Git
.
new
(
pod_root
,
url
,
options
)
Git
.
new
(
pod_root
,
url
,
options
)
elsif
url
=
options
.
delete
(
:hg
)
Mercurial
.
new
(
pod_root
,
url
,
options
)
else
else
raise
"Unsupported download strategy `
#{
source
.
inspect
}
'."
raise
"Unsupported download strategy `
#{
source
.
inspect
}
'."
end
end
...
@@ -15,8 +19,13 @@ module Pod
...
@@ -15,8 +19,13 @@ module Pod
@pod_root
,
@url
,
@options
=
pod_root
,
url
,
options
@pod_root
,
@url
,
@options
=
pod_root
,
url
,
options
end
end
def
clean
(
clean_paths
=
[])
clean_paths
.
each
do
|
path
|
path
.
rmtree
end
if
clean_paths
end
class
Git
<
Downloader
class
Git
<
Downloader
extend
Executable
executable
:git
executable
:git
def
download
def
download
...
@@ -53,10 +62,36 @@ module Pod
...
@@ -53,10 +62,36 @@ module Pod
end
end
def
clean
(
clean_paths
=
[])
def
clean
(
clean_paths
=
[])
super
(
@pod_root
+
'.git'
).
rmtree
(
@pod_root
+
'.git'
).
rmtree
clean_paths
.
each
do
|
path
|
end
path
.
rmtree
end
end
if
clean_paths
class
Mercurial
<
Downloader
extend
Executable
executable
:hg
def
download
@pod_root
.
dirname
.
mkpath
if
@options
[
:revision
]
download_revision
else
download_head
end
end
def
download_head
hg
"clone '
#{
@url
}
' '
#{
@pod_root
}
'"
end
def
download_revision
hg
"clone '
#{
@url
}
' --rev '
#{
@options
[
:revision
]
}
' '
#{
@pod_root
}
'"
end
def
clean
(
clean_paths
=
[])
super
#(@pod_root + '.git').rmtree
puts
"TODO clean mercurial!"
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