class CocoapodsRepoSq::Repository
Class that represents the credentials needed to access a Square SDK repository of {guides.cocoapods.org/syntax/podspec.html podspecs} for a given Square Application. Responsible for downloading a copy of the repository from Square servers and cache it on the local filesystem.
Attributes
Square SDK repository set by the plugin initialization on the {guides.cocoapods.org/syntax/podfile.html#plugin Podfile}. This setting is used by the {Downloader} class to know which repository to download files from in the context of a `pod install` or `pod update` command call. When a podspec indicates a Square source it does not have a Square SDK repository reference to provide to the Downloader
class so this global setting is used instead.
@return [CocoapodsRepoSq::Repository]
current Square SDK repository
@return [String]
nickname under which a Square SDK repository was registered on the {RepositoryStore}.
@return [String]
server password used to access a specific Square SDK repository.
@return [String]
local filesystem path where this repository cache of podspecs is stored.
@return [String]
Square SDK repositories server url.
@return [String]
server user name used to access a specific Square SDK repository.
Public Class Methods
@param name [String]
nickname under which a Square SDK repository was registered on the {RepositoryStore}.
@param username [String]
server user name used to access a specific Square SDK repository.
@param password [String]
server password used to access a specific Square SDK repository.
@param url [String]
Square SDK repositories server url.
@param path [String]
local filesystem path where this repository cache of podspecs is stored.
# File lib/cocoapods_repo_sq/repository.rb, line 79 def initialize(name, username, password, url, path) @name = name @username = username @url = url @password = password @path = path end
Public Instance Methods
Updates the local copy of the podspecs from the Square SDK repository
# File lib/cocoapods_repo_sq/repository.rb, line 88 def update_specs # download new specs to a temp directory new_specs_path = get_temporary_path downloader = Downloader.new(new_specs_path, "specs.zip", :repository => self) downloader.download # perform cleanup specs_path = File.join(@path, 'Specs') new_specs_file = File.join(new_specs_path, "file.zip") FileUtils.rm(new_specs_file) if File.exists?(new_specs_file) FileUtils.rm_rf(specs_path) if Dir.exists?(specs_path) FileUtils.mv(new_specs_path, specs_path) nil end
Private Instance Methods
# File lib/cocoapods_repo_sq/repository.rb, line 104 def get_temporary_path temp_path = File.join(@path, 'Specs.new') FileUtils.rm_rf(temp_path) if Dir.exists?(temp_path) temp_path end