Class: PodBuilder::InstallResult
- Inherits:
-
Object
- Object
- PodBuilder::InstallResult
- Defined in:
- lib/pod_builder/install.rb
Instance Attribute Summary collapse
-
#licenses ⇒ Array<Hash>
readonly
The installed licenses.
-
#prebuilt_info ⇒ Hash
readonly
A hash containing the expected prebuilt_info filename and content.
Instance Method Summary collapse
- #+(obj) ⇒ Object
-
#initialize(licenses = [], prebuilt_info = Hash.new) ⇒ InstallResult
constructor
A new instance of InstallResult.
- #write_prebuilt_info_files ⇒ Object
Constructor Details
#initialize(licenses = [], prebuilt_info = Hash.new) ⇒ InstallResult
Returns a new instance of InstallResult.
16 17 18 19 |
# File 'lib/pod_builder/install.rb', line 16 def initialize(licenses = [], prebuilt_info = Hash.new) @licenses = licenses @prebuilt_info = prebuilt_info end |
Instance Attribute Details
#licenses ⇒ Array<Hash> (readonly)
Returns The installed licenses.
10 11 12 |
# File 'lib/pod_builder/install.rb', line 10 def licenses @licenses end |
#prebuilt_info ⇒ Hash (readonly)
Returns A hash containing the expected prebuilt_info filename and content.
14 15 16 |
# File 'lib/pod_builder/install.rb', line 14 def prebuilt_info @prebuilt_info end |
Instance Method Details
#+(obj) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/pod_builder/install.rb', line 21 def +(obj) merged_licenses = @licenses.dup + obj.licenses merged_prebuilt_info = @prebuilt_info.dup merged_prebuilt_info.each do |key, value| if obj.prebuilt_info.has_key?(key) specs = merged_prebuilt_info[key]["specs"] || [] specs += (obj.prebuilt_info[key]["specs"] || []) merged_prebuilt_info[key]["specs"] = specs.uniq end end merged_prebuilt_info = obj.prebuilt_info.merge(merged_prebuilt_info) return InstallResult.new(merged_licenses, merged_prebuilt_info) end |
#write_prebuilt_info_files ⇒ Object
38 39 40 41 42 |
# File 'lib/pod_builder/install.rb', line 38 def write_prebuilt_info_files prebuilt_info.each do |file_path, file_content| File.write(file_path, JSON.pretty_generate(file_content)) end end |