Class: XcodeArchiveCache::BuildSettings::Loader
- Inherits:
-
Object
- Object
- XcodeArchiveCache::BuildSettings::Loader
- Defined in:
- lib/build_settings/loader.rb
Instance Method Summary collapse
-
#get_settings(project_path, target_name) ⇒ Hash{String => String}
Build settings for target or nil.
-
#initialize(executor) ⇒ Loader
constructor
A new instance of Loader.
- #load_settings(project_paths) ⇒ Object
Constructor Details
#initialize(executor) ⇒ Loader
Returns a new instance of Loader.
44 45 46 47 48 |
# File 'lib/build_settings/loader.rb', line 44 def initialize(executor) @executor = executor @extractor = Extractor.new @settings = Hash.new end |
Instance Method Details
#get_settings(project_path, target_name) ⇒ Hash{String => String}
Returns build settings for target or nil.
73 74 75 76 77 |
# File 'lib/build_settings/loader.rb', line 73 def get_settings(project_path, target_name) return nil unless settings[project_path] settings[project_path][target_name] end |
#load_settings(project_paths) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/build_settings/loader.rb', line 52 def load_settings(project_paths) paths_without_settings = project_paths.select {|path| settings[path] == nil} threads = paths_without_settings.map do |path| Thread.new(path) do |project_path| Thread.current.abort_on_exception = true [project_path, executor.load_build_settings(project_path)] end end threads.each do |thread| project_path, all_targets_settings = thread.value settings[project_path] = extractor.extract_per_target(all_targets_settings) end end |