10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/pod/pod.rb', line 10
def pod(name = nil, *requirements, &block)
unless ENV['GIT_2_LOCAL'] == "true"
real_pod(name, *requirements, &block)
return
end
unless requirements[0].instance_of? String
unless requirements[0].key?(:git) && (requirements[0].key?(:commit) || requirements[0].key?(:branch))
real_pod(name, *requirements, &block)
else
git = requirements[0].fetch(:git)
commit = requirements[0].key?(:commit) ? requirements[0].fetch(:commit) : nil
branch = requirements[0].key?(:branch) ? requirements[0].fetch(:branch) : nil
component = git.split("/")[4].split(".")[0]
gitclone(git, branch, commit)
real_pod(name, :path=>"../"+component+"/", &block)
end
else
real_pod(name, *requirements, &block)
end
end
|