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
c4f3a5df
Commit
c4f3a5df
authored
Aug 09, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Subversion] Improved head support.
parent
4d85f946
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
subversion.rb
lib/cocoapods/downloader/subversion.rb
+13
-12
downloader_spec.rb
spec/functional/downloader_spec.rb
+11
-0
No files found.
lib/cocoapods/downloader/subversion.rb
View file @
c4f3a5df
...
@@ -4,25 +4,26 @@ module Pod
...
@@ -4,25 +4,26 @@ module Pod
executable
:svn
executable
:svn
def
download
def
download
if
options
[
:revision
]
svn
%|checkout "#{reference_url}" "#{target_path}"|
download_revision
elsif
options
[
:tag
]
download_tag
else
download_head
end
end
end
def
download_head
def
download_head
svn
%|checkout "#{
url}/#{options[:folder]
}" "#{target_path}"|
svn
%|checkout "#{
trunk_url
}" "#{target_path}"|
end
end
def
download_revision
def
reference_url
svn
%|checkout "#{url}/#{options[:folder]}" -r "#{options[:revision]}" "#{target_path}"|
result
=
url
.
dup
result
<<
'/'
<<
options
[
:folder
]
if
options
[
:folder
]
result
<<
'/tags/'
<<
options
[
:tag
]
if
options
[
:tag
]
result
<<
'" -r "'
<<
options
[
:revision
]
if
options
[
:revision
]
result
end
end
def
download_tag
def
trunk_url
svn
%|checkout "#{url}/tags/#{options[:tag]}/#{options[:folder]}" "#{target_path}"|
result
=
url
.
dup
result
<<
'/'
<<
options
[
:folder
]
if
options
[
:folder
]
result
<<
'/trunk'
result
end
end
end
end
end
end
...
...
spec/functional/downloader_spec.rb
View file @
c4f3a5df
...
@@ -253,6 +253,7 @@ module Pod
...
@@ -253,6 +253,7 @@ module Pod
end
end
describe
"for Subversion"
do
describe
"for Subversion"
do
it
"check's out a specific revision"
do
it
"check's out a specific revision"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:svn
=>
"file://
#{
fixture
(
'subversion-repo'
)
}
"
,
:revision
=>
'1'
:svn
=>
"file://
#{
fixture
(
'subversion-repo'
)
}
"
,
:revision
=>
'1'
...
@@ -270,7 +271,17 @@ module Pod
...
@@ -270,7 +271,17 @@ module Pod
downloader
.
download
downloader
.
download
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'tag 1'
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'tag 1'
end
end
it
"check's out the head version"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:svn
=>
"file://
#{
fixture
(
'subversion-repo'
)
}
"
,
:revision
=>
'1'
)
downloader
=
Downloader
.
for_pod
(
@pod
)
downloader
.
download_head
(
@pod
.
root
+
'README'
).
read
.
strip
.
should
==
'unintersting'
end
end
end
describe
"for HTTP"
do
describe
"for HTTP"
do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryDirectory
...
...
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