Class: Pod::Command::Setup
- Inherits:
-
Pod::Command
- Object
- CLAide::Command
- Pod::Command
- Pod::Command::Setup
- Extended by:
- Executable
- Defined in:
- lib/cocoapods/command/setup.rb
Setup steps collapse
-
#add_master_repo ⇒ void
Adds the master repo from the remote.
-
#set_master_repo_branch ⇒ void
Sets the repo to the master branch.
-
#set_master_repo_url ⇒ void
Sets the url of the master repo according to whether it is push.
-
#update_master_repo ⇒ void
Updates the master repo against the remote.
Private helpers collapse
-
.read_only_url ⇒ String
The read only url of the master repo.
-
#master_repo_dir ⇒ Pathname
The directory of the master repo.
-
#url ⇒ String
The url to use according to whether push mode should be enabled.
Instance Method Summary collapse
Methods included from Executable
capture_command, executable, execute_command, which, which!
Methods inherited from Pod::Command
#ensure_master_spec_repo_exists!, #initialize, options, report_error, run
Methods included from Pod::Config::Mixin
Constructor Details
This class inherits a constructor from Pod::Command
Class Method Details
.read_only_url ⇒ String
Returns the read only url of the master repo.
92 93 94 |
# File 'lib/cocoapods/command/setup.rb', line 92 def self.read_only_url 'https://github.com/CocoaPods/Specs.git' end |
Instance Method Details
#add_master_repo ⇒ void
This method returns an undefined value.
Adds the master repo from the remote.
52 53 54 55 |
# 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 ⇒ Pathname
Returns the directory of the master repo.
98 99 100 |
# File 'lib/cocoapods/command/setup.rb', line 98 def master_repo_dir config.sources_manager.master_repo_dir end |
#run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 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 ⇒ void
This is not needed anymore as it was used for CocoaPods 0.6 release candidates.
This method returns an undefined value.
Sets the repo to the master branch.
73 74 75 76 77 |
# 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 ⇒ void
This method returns an undefined value.
Sets the url of the master repo according to whether it is push.
42 43 44 45 46 |
# 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 ⇒ void
This method returns an undefined value.
Updates the master repo against the remote.
61 62 63 64 |
# 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 ⇒ String
Returns the url to use according to whether push mode should be enabled.
86 87 88 |
# File 'lib/cocoapods/command/setup.rb', line 86 def url self.class.read_only_url end |