Skip to content

Commit 10c82da

Browse files
author
GaoJi
committed
add local_pod_DSL
1 parent e905ee1 commit 10c82da

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
require 'pathname'
2+
3+
module Pod
4+
class Podfile
5+
module DSL
6+
7+
def local_pod(name, *requirements)
8+
basePath = Pathname.new "./"
9+
10+
path = nil
11+
basePath.find do |p|
12+
if p.basename.to_s == "#{name}.podspec"
13+
path = p
14+
break
15+
end
16+
end
17+
18+
if path == nil
19+
raise "\ncannot find local pod: #{name}"
20+
return
21+
end
22+
options = requirements.last
23+
options[:path] = path.to_s
24+
pod(name, *requirements)
25+
end
26+
27+
end
28+
end
29+
end

0 commit comments

Comments
 (0)