class RBT::BeautifySystem

Constants

USE_THIS_AS_DEFAULT_INPUT
#

RBT::BeautifySystem::USE_THIS_AS_DEFAULT_INPUT

#

Public Class Methods

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

RBT::BeautifySystem[]

#
# File lib/rbt/utility_scripts/beautify_system.rb, line 185
def self.[](i = '')
  new(i)
end
new( i = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/beautify_system.rb, line 63
def initialize(
    i           = nil,
    run_already = true
  )
  reset
  set_input(i)
  run if run_already
end

Public Instance Methods

do_compile(i) click to toggle source
#

do_compile

#
# File lib/rbt/utility_scripts/beautify_system.rb, line 149
def do_compile(i)
  if i.is_a? String
    i.strip!
    if i.include? N
      i = i.split(N)
    end
  end
  if i.is_a? String
    i = [i]
  end
  i.map!(&:strip)
  i.reject!(&:empty?)
  i.each {|entry|
    begin
      RBT::Action::Installer.new(entry.strip)
    rescue SystemExit
      opne 'User requested to exit, thus we will exit now.'
      exit
    rescue Exception => error
      opne 'An error was encountered:'
      pp error
      pp error.class
    end
  }
end
input?() click to toggle source
#

input?

#
# File lib/rbt/utility_scripts/beautify_system.rb, line 142
def input?
  @input
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::LeanPrototype#reset
# File lib/rbt/utility_scripts/beautify_system.rb, line 75
def reset
  super()
  infer_the_namespace
  # ===================================================================== #
  # === @use_this_as_default_input
  # ===================================================================== #
  @use_this_as_default_input = USE_THIS_AS_DEFAULT_INPUT
  # ===================================================================== #
  # Add some aliases there.
  # ===================================================================== #
  chained_programs = RBT.chained_programs
  # ===================================================================== #
  # You can add more aliases to this entry.
  # ===================================================================== #
  array_add_these_aliases_from_the_chained_programs = %w(
    autotools
    audio_suite
    audio_suite2
    cfamily_addons
    alsa
    editors
    perl
    video_base
    video_suite
    metagtkmm
    databases
    fluxbox
    graphics_suite
    irc
    my_python
    sdl
    viewers
    xml
    ruby_addons
    xorg_protos
    xorg_utils
    xorg_libraries
    xorg_data
    xorg_apps
    xorg_fonts
    xorg_server
    terminals
    all_of_the_mate_desktop
    kde5_foundation
    kde5_plasma
    kde5_porting_aids
    kde5_applications
    xfce
  )
  array_add_these_aliases_from_the_chained_programs.each {|entry|
    add_this = chained_programs[entry].strip.tr(',',N)
    @use_this_as_default_input << add_this
  }
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/beautify_system.rb, line 178
def run
  do_compile @use_this_as_default_input
end
set_input(i = '') click to toggle source
#

set_input

#
# File lib/rbt/utility_scripts/beautify_system.rb, line 133
def set_input(i = '')
  i = i.first if i.is_a? Array
  i = i.to_s.dup
  @input = i
end