Class: Reflex::Packager::Profile

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

Overview

Describes the runtime a packaged app embeds: the umbrella pod that provides the native build, the extensions and libraries registered with CRuby, and the scaffold for the ‘new’ command.

The packager itself is runtime-agnostic; each gem (reflex, rubysketch, …) supplies its own profile and reuses this packager as the engine.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pod:, git:, version:, libraries:, extensions:, config_files:, template:) ⇒ Profile

Returns a new instance of Profile.

Parameters:

  • pod (String)

    umbrella pod name (e.g. ‘Reflex’)

  • git (String)

    umbrella pod git repository

  • version (String)

    umbrella pod version (for the tag)

  • libraries (Array<String>)

    ruby lib bundles to add to load path

  • extensions (Array<String>)

    native exts to register (Init_<name>)

  • config_files (Array<String>)

    config file names, preferred first

  • template (String)

    ‘new’ main script template ({name})



24
25
26
27
# File 'lib/reflex/packager/profile.rb', line 24

def initialize(pod:, git:, version:, libraries:, extensions:, config_files:, template:)
  @pod, @git, @version, @libraries, @extensions, @config_files, @template =
    pod, git, version, libraries, extensions, config_files, template
end

Instance Attribute Details

#config_filesObject (readonly)

Returns the value of attribute config_files.



29
30
31
# File 'lib/reflex/packager/profile.rb', line 29

def config_files
  @config_files
end

#extensionsObject (readonly)

Returns the value of attribute extensions.



29
30
31
# File 'lib/reflex/packager/profile.rb', line 29

def extensions
  @extensions
end

#gitObject (readonly)

Returns the value of attribute git.



29
30
31
# File 'lib/reflex/packager/profile.rb', line 29

def git
  @git
end

#librariesObject (readonly)

Returns the value of attribute libraries.



29
30
31
# File 'lib/reflex/packager/profile.rb', line 29

def libraries
  @libraries
end

#podObject (readonly)

Returns the value of attribute pod.



29
30
31
# File 'lib/reflex/packager/profile.rb', line 29

def pod
  @pod
end

#templateObject (readonly)

Returns the value of attribute template.



29
30
31
# File 'lib/reflex/packager/profile.rb', line 29

def template
  @template
end

#versionObject (readonly)

Returns the value of attribute version.



29
30
31
# File 'lib/reflex/packager/profile.rb', line 29

def version
  @version
end

Instance Method Details

#bundle_id_prefixObject



35
36
37
# File 'lib/reflex/packager/profile.rb', line 35

def bundle_id_prefix()
  "org.xord.#{pod_key}"
end

#pod_keyObject



31
32
33
# File 'lib/reflex/packager/profile.rb', line 31

def pod_key()
  pod.downcase.to_sym
end