class Pod::Extension::SourceDefinition

Attributes

children[R]
domain[R]
map[R]
parent[R]

Public Class Methods

new(domain, parent) click to toggle source
# File lib/cocoapods-extension/development/definition.rb, line 11
def initialize(domain, parent)
    @domain = domain
    @parent = parent
    @children = []
    @map = Hash::new
    if parent.is_a?(Pod::Extension::SourceDefinition)
        parent.children << self
    end
end

Public Instance Methods

source_list() click to toggle source
# File lib/cocoapods-extension/development/definition.rb, line 21
def source_list
    list = Hash::new(@map)
    for source in children do
        list = list.merge(source.map)
    end
    list
end
store_pod(name = nil, *requirements) click to toggle source
# File lib/cocoapods-extension/development/definition.rb, line 29
def store_pod(name = nil, *requirements)
    options = requirements.last || Hash.new
    git = options[:git] || "#{name}.git"
    group = options[:group] || name

    if domain.start_with? "git@"
        store_pod_git(name, group, git)
    elsif domain.size > 0
        store_pod_http(name, group, git)
    end
end
store_pod_git(name, group, git) click to toggle source
# File lib/cocoapods-extension/development/definition.rb, line 41
def store_pod_git(name, group, git)
    source = "#{domain}:#{group}/#{git}"
    map[name] = source
end
store_pod_http(name, group, git) click to toggle source
# File lib/cocoapods-extension/development/definition.rb, line 46
def store_pod_http(name, group, git)
    source = Pathname(domain)
    source += group
    source += git
    map[name] = source.to_s
end