Module: Xcode::Configuration::SpaceDelimitedString
- Extended by:
- SpaceDelimitedString
- Included in:
- SpaceDelimitedString
- Defined in:
- lib/xcode/configurations/space_delimited_string_property.rb
Overview
Within the a build settings for a configuration there are a number of settings that are stored a space-delimited strings. This helper module provides the opening and saving of these values.
When opened the value returns is going to be an Array.
Instance Method Summary collapse
-
#append(original, value) ⇒ Object
Space Delimited Strings are not unlike arrays and those we assume that the inputs are going to be two arrays that will be joined and then ensured that only the unique values are saved.
-
#open(value) ⇒ Array<String>
While the space delimited string can and is often stored in that way, it appears as though Xcode is now possibly storing these values in a format that the parser is returning as an Array.
-
#save(value) ⇒ String
The space-delimited string.
Instance Method Details
#append(original, value) ⇒ Object
Space Delimited Strings are not unlike arrays and those we assume that the inputs are going to be two arrays that will be joined and then ensured that only the unique values are saved.
58 59 60 |
# File 'lib/xcode/configurations/space_delimited_string_property.rb', line 58 def append(original,value) save( ( open(original) + Array(value)).uniq ) end |
#open(value) ⇒ Array<String>
While the space delimited string can and is often stored in that way, it appears as though Xcode is now possibly storing these values in a format that the parser is returning as an Array. So if the raw value is an array, simply return that raw value instead of attempting to convert it.
37 38 39 |
# File 'lib/xcode/configurations/space_delimited_string_property.rb', line 37 def open(value) value.is_a?(Array) ? value : value.to_s.split(" ") end |