Skip to content

Commit fc05d7f

Browse files
author
Dusty
committed
svn->temporary_repos
1 parent 82c3540 commit fc05d7f

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
#
3+
# https://github.com/CocoaPods/CocoaPods/blob/master/spec/spec_helper/temporary_repos.rb
4+
#
5+
6+
module SpecHelper
7+
def self.tmp_repos_path
8+
TemporaryRepos.tmp_repos_path
9+
end
10+
11+
module TemporaryRepos
12+
extend Pod::Executable
13+
executable :svn
14+
15+
#
16+
# Copy test-repo to temp location and initialize local svn repository
17+
#
18+
def repo_make(name)
19+
path = repo_path(name)
20+
path.mkpath
21+
Dir.chdir(path) do
22+
`echo stuff`
23+
`touch dustywusyt`
24+
end
25+
path
26+
end
27+
28+
#
29+
# @return [Pathname] The path for the repo with the given name.
30+
#
31+
def repo_path(name)
32+
tmp_repos_path + name
33+
end
34+
35+
# Sets up a lightweight svn master repo in `tmp/cocoapods/repos/master` with the
36+
# contents of `spec/fixtures/spec-repos/test_repo`.
37+
#
38+
def set_up_test_repo
39+
puts "Set up tst repo!"
40+
# require 'fileutils'
41+
# test_repo_path.mkpath
42+
# origin = ROOT + 'spec/fixtures/spec-repos/test_repo/.'
43+
# destination = tmp_repos_path + 'master'
44+
# FileUtils.cp_r(origin, destination)
45+
# repo_make('master')
46+
end
47+
48+
#--------------------------------------#
49+
50+
def tmp_repos_path
51+
SpecHelper.temporary_directory + 'cocoapods/repos'
52+
end
53+
54+
module_function :tmp_repos_path
55+
56+
def self.extended(base)
57+
base.before do
58+
tmp_repos_path.mkpath
59+
end
60+
end
61+
62+
end
63+
end

0 commit comments

Comments
 (0)