Class: Pod::Command::Bin::Update
- Inherits:
-
Pod::Command::Bin
- Object
- Pod::Command
- Pod::Command::Bin
- Pod::Command::Bin::Update
- Includes:
- Pod, Podfile::DSL
- Defined in:
- lib/cocoapods-tj/command/bin/update.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Update
constructor
A new instance of Update.
- #run ⇒ Object
Methods included from Podfile::DSL
#allow_prerelease!, #set_configuration_env, #set_use_source_pods, #use_binaries!, #use_binaries_with_spec_selector!
Methods included from Pod
Methods inherited from Pod::Command::Bin
Methods included from CBin::SpecFilesHelper
#binary_spec, #binary_spec_files, #binary_template_spec, #binary_template_spec_file, #binary_template_spec_files, #clear_binary_spec_file_if_needed, #code_spec, #code_spec_files, #create_binary_spec_file, #find_spec_file, #spec_files
Methods included from CBin::SourcesHelper
#binary_source, #code_source, #sources_manager, #sources_option, #valid_sources
Constructor Details
#initialize(argv) ⇒ Update
Returns a new instance of Update.
29 30 31 32 33 |
# File 'lib/cocoapods-tj/command/bin/update.rb', line 29 def initialize(argv) @update = argv.flag?('update') super @additional_args = argv.remainder! end |
Class Method Details
.load_local_podfile ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/cocoapods-tj/command/bin/update.rb', line 47 def self.load_local_podfile project_root = Pod::Config.instance.project_root path = File.join(project_root.to_s, 'Podfile_TJ') unless File.exist?(path) path = File.join(project_root.to_s, 'Podfile_TJ') end if File.exist?(path) contents = File.open(path, 'r:utf-8', &:read) podfile = Pod::Config.instance.podfile local_podfile = Podfile.from_file(path) if local_podfile local_pre_install_callback = nil local_post_install_callback = nil local_podfile.instance_eval do local_pre_install_callback = @pre_install_callback local_post_install_callback = @post_install_callback end end podfile.instance_eval do begin if local_podfile.plugins.any? hash_plugins = podfile.plugins || {} hash_plugins = hash_plugins.merge(local_podfile.plugins) set_hash_value(%w[plugins].first, hash_plugins) podfile.set_use_source_pods(local_podfile.use_source_pods) if local_podfile.use_source_pods podfile.use_binaries!(local_podfile.use_binaries?) end local_podfile&.target_definition_list&.each do |local_target| next if local_target.name == 'Pods' target_definition_list.each do |target| unless target.name == local_target.name && (local_target.to_hash['dependencies'] &&local_target.to_hash['dependencies'].any?) next end target.instance_exec do local_dependencies = local_target.to_hash['dependencies'] target_dependencies = target.to_hash['dependencies'] local_dependencies.each do |local_dependency| unless local_dependency.is_a?(Hash) && local_dependency.keys.first next end target_dependencies.each do |target_dependency| next unless target_dependency.is_a?(Hash) && target_dependency.keys.first && target_dependency.keys.first == local_dependency.keys.first target_dependencies.delete target_dependency break end end local_dependencies.each do |d| UI. "Development Pod #{d.to_yaml}" if podfile.plugins.keys.include?('cocoapods-tj') podfile.set_use_source_pods(d.keys.first) if (d.is_a?(Hash) && d.keys.first) end end new_dependencies = target_dependencies + local_dependencies set_hash_value(%w[dependencies].first, new_dependencies) end end end if local_pre_install_callback @pre_install_callback = local_pre_install_callback end if local_post_install_callback @post_install_callback = local_post_install_callback end rescue Exception => e = "Invalid `#{path}` file: #{e.}" raise Pod::DSLError.new(, path, e, contents) end end end end |
.options ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/cocoapods-tj/command/bin/update.rb', line 17 def self. [ ["--sources=#{Pod::TrunkSource::TRUNK_REPO_URL}", 'The sources from which to update dependent pods. ' \ 'Multiple sources must be comma-delimited'], ['--exclude-pods=podName', 'Pods to exclude during update. Multiple pods must be comma-delimited'], ['--clean-install', 'Ignore the contents of the project cache and force a full pod installation. This only ' \ 'applies to projects that have enabled incremental installation'], ['--project-directory=/project/dir/', 'The path to the root of the project directory'], ['--no-repo-update', 'Skip running `pod repo update` before install'] ].concat(super) end |
Instance Method Details
#run ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cocoapods-tj/command/bin/update.rb', line 35 def run Update.load_local_podfile argvs = [ *@additional_args ] gen = Pod::Command::Update.new(CLAide::ARGV.new(argvs)) gen.validate! gen.run end |