Class: RXCode::Preferences
- Inherits:
-
Object
- Object
- RXCode::Preferences
- Defined in:
- lib/rxcode/preferences.rb
Overview
Provides access to global XCode preferences.
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
Instance Method Summary collapse
- #derived_data_location ⇒ Object
- #derived_data_location_is_relative_to_workspace? ⇒ Boolean
-
#initialize(defaults = nil) ⇒ Preferences
constructor
A new instance of Preferences.
Constructor Details
#initialize(defaults = nil) ⇒ Preferences
Returns a new instance of Preferences.
16 17 18 19 20 |
# File 'lib/rxcode/preferences.rb', line 16 def initialize(defaults = nil) defaults ||= Plist::parse_xml(`defaults read com.apple.dt.Xcode | plutil -convert xml1 -o - -`) @defaults = defaults end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
14 15 16 |
# File 'lib/rxcode/preferences.rb', line 14 def defaults @defaults end |
Instance Method Details
#derived_data_location ⇒ Object
22 23 24 |
# File 'lib/rxcode/preferences.rb', line 22 def derived_data_location defaults['IDECustomDerivedDataLocation'] || File.("~/Library/Developer/Xcode/DerivedData") end |
#derived_data_location_is_relative_to_workspace? ⇒ Boolean
26 27 28 |
# File 'lib/rxcode/preferences.rb', line 26 def derived_data_location_is_relative_to_workspace? !derived_data_location.start_with?('/') end |