Class: Pod::Source::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods_plugin.rb

Instance Method Summary collapse

Instance Method Details

#create_source_with_url(url) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/cocoapods_plugin.rb', line 53

def create_source_with_url(url)
  require 'coding_ar_util'
  
  name = name_for_url(url)
  if CodingArUtil.coding_ar_service?(url)
    Command::Repo::AddCodingAr.parse([name, url]).run
  else
    orig_create_source_with_url(url)
  end

  source = source_with_url(url)
  raise "Unable to create a source with URL #{url}" unless source
  source
end

#orig_create_source_with_urlObject



34
# File 'lib/cocoapods_plugin.rb', line 34

alias_method :orig_create_source_with_url, :create_source_with_url

#orig_source_from_pathObject



33
# File 'lib/cocoapods_plugin.rb', line 33

alias_method :orig_source_from_path, :source_from_path

#source_from_path(path) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/cocoapods_plugin.rb', line 36

def source_from_path(path)
  @sources_by_path ||= Hash.new do |hash, key|
    hash[key] = case
                when key.basename.to_s == Pod::TrunkSource::TRUNK_REPO_NAME
                  TrunkSource.new(key)
                when (key + '.url').exist?
                  CDNSource.new(key)
                when (key + '.coding_ar_url').exist?
                  CodingArSource.new(key)
                else
                  Source.new(key)
                end
  end

  @sources_by_path[path]
end