Class: XcodeProject::XCBuildConfiguration
- Defined in:
- lib/xcodeproject/xc_build_configuration.rb
Instance Attribute Summary collapse
-
#build_settings ⇒ Object
Returns the value of attribute build_settings.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Node
Instance Method Summary collapse
- #change_version(value, type = :major) ⇒ Object
- #increment_version(type = :major) ⇒ Object
-
#initialize(root, uuid, data) ⇒ XCBuildConfiguration
constructor
A new instance of XCBuildConfiguration.
- #version(type = :major) ⇒ Object
Constructor Details
#initialize(root, uuid, data) ⇒ XCBuildConfiguration
Returns a new instance of XCBuildConfiguration.
33 34 35 36 37 38 |
# File 'lib/xcodeproject/xc_build_configuration.rb', line 33 def initialize(root, uuid, data) super(root, uuid, data) @name = data['name'] @build_settings = data['buildSettings'] end |
Instance Attribute Details
#build_settings ⇒ Object
Returns the value of attribute build_settings.
31 32 33 |
# File 'lib/xcodeproject/xc_build_configuration.rb', line 31 def build_settings @build_settings end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
30 31 32 |
# File 'lib/xcodeproject/xc_build_configuration.rb', line 30 def name @name end |
Instance Method Details
#change_version(value, type = :major) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/xcodeproject/xc_build_configuration.rb', line 52 def change_version(value, type = :major) case type when :major then write_property('CFBundleShortVersionString', value) when :minor then write_property('CFBundleVersion', value) else raise ArgumentError, 'Wrong argument type, expected :major or :minor.' end end |
#increment_version(type = :major) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/xcodeproject/xc_build_configuration.rb', line 60 def increment_version(type = :major) cv = version(type) nv = cv.nil? ? '0' : cv.next change_version(nv, type) end |
#version(type = :major) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/xcodeproject/xc_build_configuration.rb', line 40 def version(type = :major) major = read_property('CFBundleShortVersionString') minor = read_property('CFBundleVersion') case type when :major then major when :minor then minor when :both then major + '.' + minor else raise ArgumentError, 'Wrong argument type, expected :major, :minor or :both.' end end |