Module: Pod::Podfile::DSL
- Defined in:
- lib/cocoapods-developing-folder/folder_DSL.rb,
lib/cocoapods-developing-folder/local_pod_DSL.rb
Instance Method Summary collapse
- #folder(path, *requirements) ⇒ Object
- #import_pod(path, *requirements) ⇒ Object
- #local_pod(name, *requirements) ⇒ Object
Instance Method Details
#folder(path, *requirements) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cocoapods-developing-folder/folder_DSL.rb', line 8 def folder(path, *requirements) basePath = Pathname.new path def import_pod(path, *requirements) podspec = path.children.find do |p| !p.directory? and p.extname == ".podspec" end if podspec != nil = (requirements.last || {}).clone [:path] = unify_path(path).to_path pod(podspec.basename(".podspec").to_s, ) end path.children.each do |p| if p.directory? import_pod(p, *requirements) end end end import_pod basePath, *requirements end |
#import_pod(path, *requirements) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/cocoapods-developing-folder/folder_DSL.rb', line 10 def import_pod(path, *requirements) podspec = path.children.find do |p| !p.directory? and p.extname == ".podspec" end if podspec != nil = (requirements.last || {}).clone [:path] = unify_path(path).to_path pod(podspec.basename(".podspec").to_s, ) end path.children.each do |p| if p.directory? import_pod(p, *requirements) end end end |
#local_pod(name, *requirements) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/cocoapods-developing-folder/local_pod_DSL.rb', line 22 def local_pod(name, *requirements) = requirements.last rootPath = Pod.local_pod_DSL_root_path || "./" if and .kind_of? Hash and [:root_path] != nil rootPath = [:root_path] end basePath = Pathname.new rootPath path = nil basePath.find do |p| if p.basename.to_s == "#{name}.podspec" path = p break end end if path == nil raise "\ncannot find local pod: #{name}" return end path = unify_path(path.parent) path = path.to_s if and .kind_of? Hash [:path] = path pod(name, *requirements) else pod(name, *requirements, :path => path) end end |