Class: Pod::Command::Update
- Inherits:
-
Pod::Command
- Object
- CLAide::Command
- Pod::Command
- Pod::Command::Update
- Includes:
- Project
- Defined in:
- lib/cocoapods/command/project.rb
Overview
————————————————————————-#
Instance Method Summary collapse
-
#initialize(argv) ⇒ Update
constructor
A new instance of Update.
- #run ⇒ Object
Methods included from Project
included, #run_install_with_update
Methods inherited from Pod::Command
#ensure_master_spec_repo_exists!, options, report_error, run
Methods included from Pod::Config::Mixin
Constructor Details
#initialize(argv) ⇒ Update
Returns a new instance of Update.
125 126 127 128 |
# File 'lib/cocoapods/command/project.rb', line 125 def initialize(argv) @pods = argv.arguments! unless argv.arguments.empty? super end |
Instance Method Details
#run ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/cocoapods/command/project.rb', line 130 def run verify_podfile_exists! if @pods verify_lockfile_exists! # Check if all given pods are installed lockfile_roots = config.lockfile.pod_names.map { |p| Specification.root_name(p) } missing_pods = @pods.map { |p| Specification.root_name(p) }.select do |pod| !lockfile_roots.include?(pod) end if missing_pods.length > 0 if missing_pods.length > 1 = "Pods `#{missing_pods.join('`, `')}` are not " \ 'installed and cannot be updated' else = "The `#{missing_pods.first}` Pod is not installed " \ 'and cannot be updated' end raise Informative, end run_install_with_update(:pods => @pods) else UI.puts 'Update all pods'.yellow unless @pods run_install_with_update(true) end end |