class Pod::Command::Setup
Public Class Methods
read_only_url()
click to toggle source
@return [String] the read only url of the master repo.
# File lib/cocoapods/command/setup.rb, line 92 def self.read_only_url 'https://github.com/CocoaPods/Specs.git' end
Public Instance Methods
add_master_repo()
click to toggle source
Adds the master repo from the remote.
@return [void]
# File lib/cocoapods/command/setup.rb, line 52 def add_master_repo cmd = ['master', url, 'master', '--progress'] Repo::Add.parse(cmd).run end
master_repo_dir()
click to toggle source
@return [Pathname] the directory of the master repo.
# File lib/cocoapods/command/setup.rb, line 98 def master_repo_dir config.sources_manager.master_repo_dir end
run()
click to toggle source
# File lib/cocoapods/command/setup.rb, line 20 def run UI.section 'Setting up CocoaPods master repo' do if master_repo_dir.exist? set_master_repo_url set_master_repo_branch update_master_repo else add_master_repo end end UI.puts 'Setup completed'.green end
set_master_repo_branch()
click to toggle source
Sets the repo to the master branch.
@note This is not needed anymore as it was used for CocoaPods 0.6
release candidates.
@return [void]
# File lib/cocoapods/command/setup.rb, line 73 def set_master_repo_branch Dir.chdir(master_repo_dir) do git %w(checkout master) end end
set_master_repo_url()
click to toggle source
Sets the url of the master repo according to whether it is push.
@return [void]
# File lib/cocoapods/command/setup.rb, line 42 def set_master_repo_url Dir.chdir(master_repo_dir) do git('remote', 'set-url', 'origin', url) end end
update_master_repo()
click to toggle source
Updates the master repo against the remote.
@return [void]
# File lib/cocoapods/command/setup.rb, line 61 def update_master_repo show_output = !config.silent? config.sources_manager.update('master', show_output) end
url()
click to toggle source
@return [String] the url to use according to whether push mode should
be enabled.
# File lib/cocoapods/command/setup.rb, line 86 def url self.class.read_only_url end