Module: Xcode::Configuration::BooleanProperty

Extended by:
BooleanProperty
Included in:
BooleanProperty
Defined in:
lib/xcode/configurations/boolean_property.rb

Overview

Within the a build settings for a configuration there are a number of settings that are stored as Objective-C boolean values. This helper module provides the opening and saving of these values.

When opened the value returns is going to be an Array.

Examples:

setting and getting a property


debug_config project.target('SomeTarget').config('Debug')
debug_config.always_search_user_paths  # => false
debug_config.always_search_user_paths = true
debug_config.always_search_user_paths  # true

Instance Method Summary collapse

Instance Method Details

#append(original, value) ⇒ Object

Note:

Appending boolean properties has no real good default operation. What happens in this case is that whatever you decide to append will automatically override the previously existing settings.

Parameters:

  • original (Types)

    the original value to be appended

  • value (Types)

    Description



47
48
49
# File 'lib/xcode/configurations/boolean_property.rb', line 47

def append(original,value)
  save(value)
end

#open(value) ⇒ TrueClass, FalseClass

Returns the boolean value based on the specified value.

Parameters:

Returns:



27
28
29
# File 'lib/xcode/configurations/boolean_property.rb', line 27

def open(value)
  value.to_s =~ /^YES$/
end

#save(value) ⇒ String

Returns YES or NO.

Parameters:

Returns:



35
36
37
# File 'lib/xcode/configurations/boolean_property.rb', line 35

def save(value)
  value.to_s =~ /^(?:NO|false)$/ ? "NO" : "YES"
end