module Pod::Podfile::DSL

Public Instance Methods

folder(path, *requirements) click to toggle source
# 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" or p.basename.to_s.end_with? ".podspec.json")
        end
        if podspec != nil 
            options = (requirements.last || {}).clone 
            options[:path] = unify_path(path).to_path
            name = podspec.basename(".json")
            name = name.basename(".podspec")
            pod(name.to_s, options)
        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) click to toggle source
# 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" or p.basename.to_s.end_with? ".podspec.json")
    end
    if podspec != nil 
        options = (requirements.last || {}).clone 
        options[:path] = unify_path(path).to_path
        name = podspec.basename(".json")
        name = name.basename(".podspec")
        pod(name.to_s, options)
    end
    path.children.each do |p|
        if p.directory?
            import_pod(p, *requirements)
        end
    end
end
local_pod(name, *requirements) click to toggle source
# File lib/cocoapods-developing-folder/local_pod_DSL.rb, line 28
def local_pod(name, *requirements)
    options = requirements.last

    rootPaths = Pod.local_pod_DSL_root_paths || ["./"]
    if options and options.kind_of? Hash and options[:root_path] != nil
        rootPaths = [ options[:root_path] ]
    end

    rootPodName = Specification.root_name name
    found = false

    rootPaths.each do |rootPath|
        basePath = Pathname.new rootPath
    
        path = nil
        basePath.find do |p|
            if p.basename.to_s == "#{rootPodName}.podspec" || p.basename.to_s == "#{rootPodName}.podspec.json"
                path = p
                break
            end
        end
        next if path.nil?
    
        path = unify_path(path.parent)
        path = path.to_s
        
        if options and options.kind_of? Hash
            options[:path] = path
            pod(name, *requirements)
        else 
            pod(name, *requirements, :path => path)
        end
        found = true
        break
    end
    if not found
        raise "\ncannot find local pod: #{name}. Searching roots: #{rootPaths}"
    end
end