Class: Reflex::Packager::MacOSConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/reflex/packager/config.rb

Overview

macOS specific configuration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ MacOSConfig

Returns a new instance of MacOSConfig.



162
163
164
165
166
167
168
# File 'lib/reflex/packager/config.rb', line 162

def initialize(hash)
  @deployment_target = hash[:deployment_target]  .to_s
  @archs             = Array(hash[:archs]).map  &:to_s
  @codesign_identity = hash[:codesign][:identity].to_s
  @codesign_team_id  = hash[:codesign][:team_id]&.to_s
  validate
end

Instance Attribute Details

#archsObject (readonly)

Returns the value of attribute archs.



170
171
172
# File 'lib/reflex/packager/config.rb', line 170

def archs
  @archs
end

#codesign_identityObject (readonly)

Returns the value of attribute codesign_identity.



170
171
172
# File 'lib/reflex/packager/config.rb', line 170

def codesign_identity
  @codesign_identity
end

#codesign_team_idObject (readonly)

Returns the value of attribute codesign_team_id.



170
171
172
# File 'lib/reflex/packager/config.rb', line 170

def codesign_team_id
  @codesign_team_id
end

#deployment_targetObject (readonly)

Returns the value of attribute deployment_target.



170
171
172
# File 'lib/reflex/packager/config.rb', line 170

def deployment_target
  @deployment_target
end

Class Method Details

.defaultsObject



151
152
153
154
155
156
157
158
159
160
# File 'lib/reflex/packager/config.rb', line 151

def self.defaults()
  {
    deployment_target: '11.0',
    archs:             'arm64',
    codesign: {
      identity: '-',
      team_id:  nil
    }
  }
end

Instance Method Details

#validateObject

Raises:



172
173
174
# File 'lib/reflex/packager/config.rb', line 172

def validate()
  raise Error, "invalid archs: '#{@archs}'" if @archs.empty?
end