Stores the global configuration of CocoaPods.
Object
verbose
initialize
verbose?
silent
silent?
new_version_message
new_version_message?
clean
clean?
integrate_targets
integrate_targets?
skip_repo_update
skip_repo_update?
max_cache_size
cache_root
aggressive_cache=
aggressive_cache?
home_dir
repos_dir
installation_root
project_root
sandbox_root
project_pods_root
sandbox
podfile
lockfile
podfile_path
lockfile_path
statistics_cache_file
search_index_file
downloader
spec_statistics_provider
user_settings_file
configure_with
podfile_path_in_dir
instance
verbose #=> Bool
Bool
Whether CocoaPods should provide detailed output about the performed actions.
verbose=(value) #=> Bool
Bool
Whether CocoaPods should provide detailed output about the performed actions.
initialize(use_user_settings = true) #=> Config
Config
A new instance of Config
115 def initialize(use_user_settings = true)
116 configure_with(DEFAULTS)
117
118 if use_user_settings && user_settings_file.exist?
119 require 'yaml'
120 user_settings = YAML.load_file(user_settings_file)
121 configure_with(user_settings)
122 end
123 end
verbose? #=> Bool
Bool
Whether CocoaPods should provide detailed output about the performed actions.
40 def verbose
41 @verbose
42 end
silent #=> Bool
Bool
Whether CocoaPods should produce not output.
Pod::Config#silent?
silent=(value) #=> Bool
Bool
Whether CocoaPods should produce not output.
silent? #=> Bool
Bool
Whether CocoaPods should produce not output.
45 def silent
46 @silent
47 end
new_version_message #=> Bool
Bool
Whether a message should be printed when a new version of CocoaPods is available.
Pod::Config#new_version_message?
new_version_message=(value) #=> Bool
Bool
Whether a message should be printed when a new version of CocoaPods is available.
new_version_message? #=> Bool
Bool
Whether a message should be printed when a new version of CocoaPods is available.
51 def new_version_message
52 @new_version_message
53 end
clean #=> Bool
Bool
Whether the installer should clean after the installation.
Pod::Config#clean?
clean=(value) #=> Bool
Bool
Whether the installer should clean after the installation.
clean? #=> Bool
Bool
Whether the installer should clean after the installation.
60 def clean
61 @clean
62 end
integrate_targets #=> Bool
Bool
Whether CocoaPods should integrate a user target and build the workspace or just create the Pods project.
Pod::Config#integrate_targets?
integrate_targets=(value) #=> Bool
Bool
Whether CocoaPods should integrate a user target and build the workspace or just create the Pods project.
integrate_targets? #=> Bool
Bool
Whether CocoaPods should integrate a user target and build the workspace or just create the Pods project.
66 def integrate_targets
67 @integrate_targets
68 end
skip_repo_update #=> Bool
Bool
Whether the installer should skip the repos update.
Pod::Config#skip_repo_update?
skip_repo_update=(value) #=> Bool
Bool
Whether the installer should skip the repos update.
skip_repo_update? #=> Bool
Bool
Whether the installer should skip the repos update.
72 def skip_repo_update
73 @skip_repo_update
74 end
max_cache_size #=> Fixnum
Fixnum
The maximum size for the cache expressed in Mb.
max_cache_size=(value) #=> Fixnum
Fixnum
The maximum size for the cache expressed in Mb.
cache_root #=> Pathname
Pathname
The directory where CocoaPods should cache remote data and other expensive to compute information.
cache_root=(value) #=> Pathname
Pathname
The directory where CocoaPods should cache remote data and other expensive to compute information.
aggressive_cache? #=> Bool
Bool
Whether the downloader should use more aggressive caching options.
105 def aggressive_cache?
106 @aggressive_cache || (ENV['CP_AGGRESSIVE_CACHE'] == 'TRUE')
107 end
home_dir #=> Pathname
Pathname
The directory where repos, templates and configuration files are stored.
138 def home_dir
139 @home_dir ||= Pathname.new(ENV['CP_HOME_DIR'] || "~/.cocoapods").expand_path
140 end
repos_dir #=> Pathname
Pathname
The directory where the CocoaPods sources are stored.
repos_dir=(value) #=> undefined
value
The value to set the attribute repos_dir to.
installation_root #=> Pathname
Pathname
The root of the CocoaPods installation where the Podfile is located.
Pod::Config#project_root
installation_root=(value) #=> undefined
value
The value to set the attribute installation_root to.
project_root #=> Pathname
Pathname
The root of the CocoaPods installation where the Podfile is located.
173 def installation_root
174 current_path = Pathname.pwd
175 unless @installation_root
176 while(!current_path.root?)
177 if podfile_path_in_dir(current_path)
178 @installation_root = current_path
179 unless current_path == Pathname.pwd
180 UI.puts("[in #{current_path}]")
181 end
182 break
183 else
184 current_path = current_path.parent
185 end
186 end
187 @installation_root ||= Pathname.pwd
188 end
189 @installation_root
190 end
sandbox_root #=> Pathname
Pathname
The root of the sandbox.
Pod::Config#project_pods_root
sandbox_root=(value) #=> undefined
value
The value to set the attribute sandbox_root to.
project_pods_root #=> Pathname
Pathname
The root of the sandbox.
182 def sandbox_root
183 @sandbox_root ||= installation_root + 'Pods'
184 end
sandbox #=> Sandbox
Sandbox
The sandbox of the current project.
186 def sandbox
187 @sandbox ||= Sandbox.new(sandbox_root)
188 end
podfile #=> Podfile, Nil
Podfile
The Podfile to use for the current execution.
Nil
If no Podfile is available.
podfile=(value) #=> undefined
value
The value to set the attribute podfile to.
lockfile #=> Lockfile, Nil
Lockfile
The Lockfile to use for the current execution.
Nil
If no Lockfile is available.
201 def lockfile
202 @lockfile ||= Lockfile.from_file(lockfile_path) if lockfile_path
203 end
podfile_path #=> Pathname, Nil
Pathname
Nil
214 def podfile_path
215 @podfile_path ||= podfile_path_in_dir(installation_root)
216 end
lockfile_path #=> undefined
222 def lockfile_path
223 @lockfile_path ||= installation_root + 'Podfile.lock'
224 end
statistics_cache_file #=> Pathname
Pathname
The file to use a cache of the statistics provider.
228 def statistics_cache_file
229 cache_root + 'statistics.yml'
230 end
search_index_file #=> Pathname
Pathname
The file to use to cache the search data.
234 def search_index_file
235 cache_root + 'search_index.yaml'
236 end
downloader(target_path, options) #=> Downloader
The downloader to use for the retrieving remote source.
247 def downloader(target_path, options)
248 downloader = Downloader.for_target(target_path, options)
249 downloader.cache_root = cache_root
250 downloader.max_cache_size = max_cache_size
251 downloader.aggressive_cache = aggressive_cache?
252 downloader
253 end
spec_statistics_provider #=> Specification::Set::Statistics
Specification::Set::Statistics
The statistic provider to use for specifications.
258 def spec_statistics_provider
259 Specification::Set::Statistics.new(statistics_cache_file)
260 end
user_settings_file #=> Pathname
Pathname
The path of the file which contains the user settings.
270 def user_settings_file
271 home_dir + "config.yaml"
272 end
configure_with(values_by_key) #=> void
Hash{String,Symbol => Object}
values_by_key
The values of the attributes grouped by key.
void
281 def configure_with(values_by_key)
282 return unless values_by_key
283 values_by_key.each do |key, value|
284 self.instance_variable_set("@#{key}", value)
285 end
286 end
podfile_path_in_dir(dir) #=> Pathname, Nil
Pathname
dir
The directory where to look for the Podfile.
Pathname
The path of the Podfile.
Nil
If not Podfile was found in the given dir
305 def podfile_path_in_dir(dir)
306 PODFILE_NAMES.each do |filename|
307 candidate = dir + filename
308 if candidate.exist?
309 return candidate
310 end
311 end
312 nil
313 end
instance #=> Config
Config
The current config instance creating one if needed.
instance=(instance) #=> void
Config
Nil
the
Instance.
void
323 def self.instance
324 @instance ||= new
325 end