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.



158
159
160
161
162
163
164
# File 'lib/reflex/packager/config.rb', line 158

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.



166
167
168
# File 'lib/reflex/packager/config.rb', line 166

def archs
  @archs
end

#codesign_identityObject (readonly)

Returns the value of attribute codesign_identity.



166
167
168
# File 'lib/reflex/packager/config.rb', line 166

def codesign_identity
  @codesign_identity
end

#codesign_team_idObject (readonly)

Returns the value of attribute codesign_team_id.



166
167
168
# File 'lib/reflex/packager/config.rb', line 166

def codesign_team_id
  @codesign_team_id
end

#deployment_targetObject (readonly)

Returns the value of attribute deployment_target.



166
167
168
# File 'lib/reflex/packager/config.rb', line 166

def deployment_target
  @deployment_target
end

Class Method Details

.defaultsObject



147
148
149
150
151
152
153
154
155
156
# File 'lib/reflex/packager/config.rb', line 147

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

Instance Method Details

#validateObject

Raises:



168
169
170
# File 'lib/reflex/packager/config.rb', line 168

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