class RBT::GenerateFlatpakManifestFile

Public Class Methods

[](i = '') click to toggle source
#

RBT::GenerateFlatpakManifestFile[]

#
# File lib/rbt/generate_files/generate_flatpak_manifest_file.rb, line 107
def self.[](i = '')
  new(i)
end
new( commandline_arguments = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/generate_files/generate_flatpak_manifest_file.rb, line 33
def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end

Public Instance Methods

do_work_on_this_program(i) click to toggle source
#

do_work_on_this_program

#
# File lib/rbt/generate_files/generate_flatpak_manifest_file.rb, line 55
def do_work_on_this_program(i)
  require 'json'
  dataset = action(:SanitizeCookbook, i)
  # ======================================================================= #
  # Now we can collect all information that will be necessary for
  # the "manifest" file.
  # ======================================================================= #
  program_name = dataset.short_name?
  hash = {}
  hash['app-id'] = 'org.gnome.'+program_name.capitalize
  hash['runtime-id'] = 'org.gnome.Platform'
  hash['runtime-version'] = dataset.program_version?
  hash['sdk'] = 'org.gnome.Sdk'
  hash['command'] = dataset.short_name?
  hash['finish-args'] = [
    '--filesystem=xdg-documents',
    '--socket=x11',
    # Wayland access:
    '--socket=wayland',
    '--share=network'
  ]
  # ======================================================================= #
  # === Modules
  #
  # The module list specifies each of the modules that are to be built
  # as part of the build process.
  # ======================================================================= #
  hash['modules'] = {
    'name': dataset.short_name?,
    'sources': [
      'type':   'archive',
      'url':     dataset.url1?,
      'sha256': `sha256sum #{dataset.program_path?}`.strip
    ]
  }
  # what = hash.to_json
  what = YAML.dump(hash)
  into = 'manifest'
  opne 'Storing into `'+sfile(into)+'`.'
  write_what_into(what, into)
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::LeanPrototype#reset
# File lib/rbt/generate_files/generate_flatpak_manifest_file.rb, line 47
def reset
  super()
  infer_the_namespace
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/generate_files/generate_flatpak_manifest_file.rb, line 100
def run
  do_work_on_this_program(first_argument?)
end