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
537ba242
Commit
537ba242
authored
Nov 18, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SVN downloader. Closes #81.
parent
139eda6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
4 deletions
+73
-4
downloader.rb
lib/cocoapods/downloader.rb
+5
-2
subversion.rb
lib/cocoapods/downloader/subversion.rb
+29
-0
downloader_spec.rb
spec/functional/downloader_spec.rb
+39
-2
No files found.
lib/cocoapods/downloader.rb
View file @
537ba242
module
Pod
module
Pod
class
Downloader
class
Downloader
autoload
:Git
,
'cocoapods/downloader/git'
autoload
:Git
,
'cocoapods/downloader/git'
autoload
:Mercurial
,
'cocoapods/downloader/mercurial'
autoload
:Mercurial
,
'cocoapods/downloader/mercurial'
autoload
:Subversion
,
'cocoapods/downloader/subversion'
extend
Executable
extend
Executable
...
@@ -11,6 +12,8 @@ module Pod
...
@@ -11,6 +12,8 @@ module Pod
Git
.
new
(
pod_root
,
url
,
options
)
Git
.
new
(
pod_root
,
url
,
options
)
elsif
url
=
options
.
delete
(
:hg
)
elsif
url
=
options
.
delete
(
:hg
)
Mercurial
.
new
(
pod_root
,
url
,
options
)
Mercurial
.
new
(
pod_root
,
url
,
options
)
elsif
url
=
options
.
delete
(
:svn
)
Subversion
.
new
(
pod_root
,
url
,
options
)
else
else
raise
"Unsupported download strategy `
#{
source
.
inspect
}
'."
raise
"Unsupported download strategy `
#{
source
.
inspect
}
'."
end
end
...
...
lib/cocoapods/downloader/subversion.rb
0 → 100644
View file @
537ba242
module
Pod
class
Downloader
class
Subversion
<
Downloader
executable
:svn
def
download
@pod_root
.
dirname
.
mkpath
if
@options
[
:revision
]
download_revision
else
download_head
end
end
def
download_head
svn
"checkout '
#{
@url
}
' '
#{
@pod_root
}
'"
end
def
download_revision
svn
"checkout '
#{
@url
}
' -r '
#{
@options
[
:revision
]
}
' '
#{
@pod_root
}
'"
end
def
clean
(
clean_paths
=
[])
super
@pod_root
.
glob
(
'**/.svn'
).
each
(
&
:rmtree
)
end
end
end
end
spec/functional/downloader_spec.rb
View file @
537ba242
...
@@ -56,7 +56,7 @@ describe "Pod::Downloader" do
...
@@ -56,7 +56,7 @@ describe "Pod::Downloader" do
it
"removes the .hg directory"
do
it
"removes the .hg directory"
do
downloader
=
Pod
::
Downloader
.
for_source
(
@dir
,
downloader
=
Pod
::
Downloader
.
for_source
(
@dir
,
:hg
=>
fixture
(
'mercurial-repo'
)
,
:revision
=>
'46198bb3af96'
:hg
=>
fixture
(
'mercurial-repo'
)
)
)
downloader
.
download
downloader
.
download
downloader
.
clean
downloader
.
clean
...
@@ -65,13 +65,50 @@ describe "Pod::Downloader" do
...
@@ -65,13 +65,50 @@ describe "Pod::Downloader" do
it
"removes the clean_paths files and directories"
do
it
"removes the clean_paths files and directories"
do
downloader
=
Pod
::
Downloader
.
for_source
(
@dir
,
downloader
=
Pod
::
Downloader
.
for_source
(
@dir
,
:hg
=>
fixture
(
'mercurial-repo'
)
,
:revision
=>
'46198bb3af96'
:hg
=>
fixture
(
'mercurial-repo'
)
)
)
downloader
.
download
downloader
.
download
downloader
.
clean
([
@dir
+
'README'
])
downloader
.
clean
([
@dir
+
'README'
])
(
@dir
+
'README'
).
should
.
not
.
exist
(
@dir
+
'README'
).
should
.
not
.
exist
end
end
end
describe
"for Subversion"
do
extend
SpecHelper
::
TemporaryDirectory
it
"check's out a specific revision"
do
downloader
=
Pod
::
Downloader
.
for_source
(
@dir
,
:svn
=>
"file://
#{
fixture
(
'subversion-repo'
)
}
"
,
:revision
=>
'1'
)
downloader
.
download
(
@dir
+
'README'
).
read
.
strip
.
should
==
'first commit'
end
it
"check's out a specific tag"
do
downloader
=
Pod
::
Downloader
.
for_source
(
@dir
,
:svn
=>
"file://
#{
fixture
(
'subversion-repo'
)
}
/tags/tag-1"
)
downloader
.
download
(
@dir
+
'README'
).
read
.
strip
.
should
==
'tag 1'
end
it
"removes the .svn directories"
do
downloader
=
Pod
::
Downloader
.
for_source
(
@dir
,
:svn
=>
"file://
#{
fixture
(
'subversion-repo'
)
}
/trunk"
)
downloader
.
download
downloader
.
clean
(
@dir
+
'.svn'
).
should
.
not
.
exist
end
it
"removes the clean_paths files and directories"
do
downloader
=
Pod
::
Downloader
.
for_source
(
@dir
,
:svn
=>
"file://
#{
fixture
(
'subversion-repo'
)
}
/trunk"
)
downloader
.
download
downloader
.
clean
([
@dir
+
'README'
])
(
@dir
+
'README'
).
should
.
not
.
exist
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