class Pod::Command::RepoTal::AddCDN

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/cocoapods-repo-tal/command/repo/add_cdn.rb, line 17
def initialize(argv)
  @name = argv.shift_argument
  @url = argv.shift_argument
  super
end

Public Instance Methods

run() click to toggle source
# File lib/cocoapods-repo-tal/command/repo/add_cdn.rb, line 34
def run
  section = "Adding spec repo `#{@name}` with CDN `#{@url}`"
  UI.section(section) do
    save_url
    config.sources_manager.sources([dir.basename.to_s]).each(&:verify_compatibility!)
  end
end
validate!() click to toggle source
Calls superclass method
# File lib/cocoapods-repo-tal/command/repo/add_cdn.rb, line 23
def validate!
  super
  unless @name && @url
    help! 'Adding a repo needs a `NAME` and a `URL`.'
  end
  if @name == 'master'
    raise Informative,
          'To setup the master specs repo, please run `pod setup`.'
  end
end

Private Instance Methods

save_url() click to toggle source

Saves the spec-repo URL to a '.url' file.

@return [void]

# File lib/cocoapods-repo-tal/command/repo/add_cdn.rb, line 48
def save_url
  dir.mkpath
  File.open(dir + '.url', 'w') { |file| file.write(@url) }
rescue => e
  raise Informative, "Could not create '#{config.repos_dir}', the CocoaPods repo cache directory.\n" \
      "#{e.class.name}: #{e.message}"
end