Module: RBT

Defined in:
lib/rbt/time/time.rb,
lib/rbt/base/base.rb,
lib/rbt/make/make.rb,
lib/rbt/shell/help.rb,
lib/rbt/shell/menu.rb,
lib/rbt/cmake/cmake.rb,
lib/rbt/libtool/run.rb,
lib/rbt/shell/shell.rb,
lib/rbt/sinatra/app.rb,
lib/rbt/libtool/help.rb,
lib/rbt/libtool/reset.rb,
lib/rbt/actions/action.rb,
lib/rbt/actions/actions.rb,
lib/rbt/aliases/aliases.rb,
lib/rbt/colours/colours.rb,
lib/rbt/libtool/libtool.rb,
lib/rbt/project/project.rb,
lib/rbt/shell/constants.rb,
lib/rbt/version/version.rb,
lib/rbt/compile/constants.rb,
lib/rbt/cookbooks/url/url.rb,
lib/rbt/encoding/encoding.rb,
lib/rbt/errors/exceptions.rb,
lib/rbt/libtool/constants.rb,
lib/rbt/colours/use_colours.rb,
lib/rbt/constants/constants.rb,
lib/rbt/constants/namespace.rb,
lib/rbt/linux/fedora/fedora.rb,
lib/rbt/sinatra/action_view.rb,
lib/rbt/sql/compile_via_sql.rb,
lib/rbt/sql/create_database.rb,
lib/rbt/colours/html_colours.rb,
lib/rbt/misc/exclusive_logic.rb,
lib/rbt/toplevel_methods/ftp.rb,
lib/rbt/toplevel_methods/opn.rb,
lib/rbt/toplevel_methods/rds.rb,
lib/rbt/toplevel_methods/url.rb,
lib/rbt/constants/remote_URLs.rb,
lib/rbt/controller/controller.rb,
lib/rbt/misc/colourize_parser.rb,
lib/rbt/misc/configure_string.rb,
lib/rbt/registered/registered.rb,
lib/rbt/requires/require_yaml.rb,
lib/rbt/sinatra/action_create.rb,
lib/rbt/toplevel_methods/html.rb,
lib/rbt/url_action/url_action.rb,
lib/rbt/utility_scripts/gitty.rb,
lib/rbt/utility_scripts/scons.rb,
lib/rbt/utility_scripts/users.rb,
lib/rbt/check_for_updates/base.rb,
lib/rbt/cookbooks/find_headers.rb,
lib/rbt/sql/generate_sql_table.rb,
lib/rbt/toplevel_methods/debug.rb,
lib/rbt/toplevel_methods/games.rb,
lib/rbt/toplevel_methods/meson.rb,
lib/rbt/toplevel_methods/patch.rb,
lib/rbt/toplevel_methods/roebe.rb,
lib/rbt/commandline/commandline.rb,
lib/rbt/logging/create_log_file.rb,
lib/rbt/toplevel_methods/cliner.rb,
lib/rbt/toplevel_methods/editor.rb,
lib/rbt/toplevel_methods/md5sum.rb,
lib/rbt/utility_scripts/chainer.rb,
lib/rbt/make/colour_make_install.rb,
lib/rbt/requires/require_colours.rb,
lib/rbt/sinatra/toplevel_methods.rb,
lib/rbt/toplevel_methods/symlink.rb,
lib/rbt/toplevel_methods/to_bool.rb,
lib/rbt/compile_base/compile_base.rb,
lib/rbt/cookbooks/merge_cookbooks.rb,
lib/rbt/misc/reverse_dependencies.rb,
lib/rbt/toplevel_methods/download.rb,
lib/rbt/toplevel_methods/rubygems.rb,
lib/rbt/utility_scripts/toolchain.rb,
lib/rbt/utility_scripts/uninstall.rb,
lib/rbt/utility_scripts/use_flags.rb,
lib/rbt/errors/file_does_not_exist.rb,
lib/rbt/linux/gentoo/create_ebuild.rb,
lib/rbt/registered/registered_tags.rb,
lib/rbt/toplevel_methods/gobolinux.rb,
lib/rbt/configuration/configuration.rb,
lib/rbt/cookbooks/all_urls/all_urls.rb,
lib/rbt/cookbooks/feedback_licenses.rb,
lib/rbt/cookbooks/homepage/homepage.rb,
lib/rbt/cookbooks/show_last_updated.rb,
lib/rbt/utility_scripts/autosymlink.rb,
lib/rbt/utility_scripts/post_install.rb,
lib/rbt/check_for_updates/update_lxqt.rb,
lib/rbt/cookbooks/convert_date_format.rb,
lib/rbt/lean_prototype/lean_prototype.rb,
lib/rbt/linux/gobolinux/create_recipe.rb,
lib/rbt/registered/registered_headers.rb,
lib/rbt/requires/require_base_scripts.rb,
lib/rbt/toplevel_methods/all_binaries.rb,
lib/rbt/toplevel_methods/does_include.rb,
lib/rbt/toplevel_methods/dual_compile.rb,
lib/rbt/utility_scripts/chain_compile.rb,
lib/rbt/utility_scripts/change_prefix.rb,
lib/rbt/cookbooks/show_dependencies_on.rb,
lib/rbt/linux/kernel/rename_system_map.rb,
lib/rbt/registered/register_everything.rb,
lib/rbt/registered/registered_binaries.rb,
lib/rbt/registered/registered_m4_files.rb,
lib/rbt/toplevel_methods/all_libraries.rb,
lib/rbt/toplevel_methods/batch_compile.rb,
lib/rbt/toplevel_methods/e_and_esystem.rb,
lib/rbt/toplevel_methods/error_message.rb,
lib/rbt/toplevel_methods/pin_and_unpin.rb,
lib/rbt/toplevel_methods/verbose_truth.rb,
lib/rbt/utility_scripts/backup_program.rb,
lib/rbt/utility_scripts/build_detector.rb,
lib/rbt/utility_scripts/create_package.rb,
lib/rbt/utility_scripts/remove_program.rb,
lib/rbt/linux/slackware/filelist_parser.rb,
lib/rbt/linux/slackware/update_slackpkg.rb,
lib/rbt/registered/registered_gir_files.rb,
lib/rbt/registered/registered_libraries.rb,
lib/rbt/toplevel_methods/home_directory.rb,
lib/rbt/utility_scripts/beautify_system.rb,
lib/rbt/utility_scripts/install_graalvm.rb,
lib/rbt/utility_scripts/profile_install.rb,
lib/rbt/utility_scripts/remove_symlinks.rb,
lib/rbt/utility_scripts/symlink_headers.rb,
lib/rbt/compile_base/compile_base_module.rb,
lib/rbt/cookbooks/find_all_archive_types.rb,
lib/rbt/database_adapters/sequel/adapter.rb,
lib/rbt/generate_files/generate_makefile.rb,
lib/rbt/linux/debian/create_control_file.rb,
lib/rbt/linux/linux_from_scratch/lfs/lfs.rb,
lib/rbt/linux/linux_from_scratch/lfs/run.rb,
lib/rbt/requires/require_colours_and_opn.rb,
lib/rbt/requires/require_utility_scripts.rb,
lib/rbt/toplevel_methods/make_app_prefix.rb,
lib/rbt/toplevel_methods/module_programs.rb,
lib/rbt/utility_scripts/convert_pkgbuild.rb,
lib/rbt/utility_scripts/replace_symlinks.rb,
lib/rbt/utility_scripts/version_switcher.rb,
lib/rbt/constants/configuration_directory.rb,
lib/rbt/cookbooks/find_duplicate_binaries.rb,
lib/rbt/sinatra/action_available_programs.rb,
lib/rbt/sql/create_sql_from_this_cookbook.rb,
lib/rbt/toplevel_methods/toplevel_methods.rb,
lib/rbt/utility_scripts/config_log_parser.rb,
lib/rbt/utility_scripts/extra_information.rb,
lib/rbt/utility_scripts/missing_homepages.rb,
lib/rbt/actions/meta_actions/batch_compile.rb,
lib/rbt/generate_files/create_bash_scripts.rb,
lib/rbt/linux/debian/create_debian_package.rb,
lib/rbt/linux/linux_from_scratch/lfs/reset.rb,
lib/rbt/utility_scripts/fix_pkgconfig_file.rb,
lib/rbt/utility_scripts/installed_programs.rb,
lib/rbt/utility_scripts/reconstitute_glibc.rb,
lib/rbt/check_for_updates/update_kde_plasma.rb,
lib/rbt/colours/permanently_disable_colours.rb,
lib/rbt/errors/map_line_to_a_specific_error.rb,
lib/rbt/generate_files/generate_shellscript.rb,
lib/rbt/libtool/class_methods/class_methods.rb,
lib/rbt/libtool/search_in_these_directories.rb,
lib/rbt/toplevel_methods/available_programs.rb,
lib/rbt/toplevel_methods/convert_global_env.rb,
lib/rbt/toplevel_methods/no_trad_no_symlink.rb,
lib/rbt/utility_scripts/cleanup_system_tags.rb,
lib/rbt/utility_scripts/compile_base_system.rb,
lib/rbt/utility_scripts/copy_these_archives.rb,
lib/rbt/utility_scripts/fetch_all_m4_macros.rb,
lib/rbt/utility_scripts/flatpak_url_scanner.rb,
lib/rbt/utility_scripts/install_glib_schema.rb,
lib/rbt/utility_scripts/not_found_libraries.rb,
lib/rbt/utility_scripts/package_rbt_scripts.rb,
lib/rbt/utility_scripts/remove_all_symlinks.rb,
lib/rbt/utility_scripts/symlink_glib_schema.rb,
lib/rbt/generate_files/create_pkgconfig_file.rb,
lib/rbt/generate_files/create_snapcraft_file.rb,
lib/rbt/generate_files/generate_pdf_tutorial.rb,
lib/rbt/toplevel_methods/run_makepkg_command.rb,
lib/rbt/toplevel_methods/show_available_tags.rb,
lib/rbt/utility_scripts/apply_sed_operations.rb,
lib/rbt/utility_scripts/feedback_binaries_of.rb,
lib/rbt/utility_scripts/feedback_information.rb,
lib/rbt/utility_scripts/parse_configure_help.rb,
lib/rbt/utility_scripts/show_dependencies_of.rb,
lib/rbt/utility_scripts/symlink_all_programs.rb,
lib/rbt/cookbooks/toggle_keep_extracted_value.rb,
lib/rbt/package_managers/create_rpm_spec_file.rb,
lib/rbt/registered/registered_pkgconfig_files.rb,
lib/rbt/requires/require_the_toplevel_methods.rb,
lib/rbt/toplevel_methods/archive_related_code.rb,
lib/rbt/utility_scripts/compile_into_home_dir.rb,
lib/rbt/utility_scripts/report_the_kde_status.rb,
lib/rbt/utility_scripts/simplified_ldd_output.rb,
lib/rbt/utility_scripts/simplify_root_entries.rb,
lib/rbt/actions/individual_actions/ntrad/ntrad.rb,
lib/rbt/check_for_updates/update_kde_framework.rb,
lib/rbt/configuration/initialize_configuration.rb,
lib/rbt/linux/linux_from_scratch/lfs/constants.rb,
lib/rbt/toplevel_methods/remove_file_extension.rb,
lib/rbt/utility_scripts/convert_to_traditional.rb,
lib/rbt/utility_scripts/find_multiple_versions.rb,
lib/rbt/utility_scripts/query_file_association.rb,
lib/rbt/actions/meta_actions/linux_from_scratch.rb,
lib/rbt/generate_files/create_big_yaml_cookbook.rb,
lib/rbt/gui/universal_widgets/notebook/notebook.rb,
lib/rbt/problems_and_errors/problems_and_errors.rb,
lib/rbt/requires/require_the_validation_scripts.rb,
lib/rbt/toplevel_methods/compile_these_programs.rb,
lib/rbt/toplevel_methods/install_which_binaries.rb,
lib/rbt/utility_scripts/autoupdate_this_program.rb,
lib/rbt/utility_scripts/query_binary_to_package.rb,
lib/rbt/utility_scripts/query_header_to_package.rb,
lib/rbt/utility_scripts/simple_version_comparer.rb,
lib/rbt/utility_scripts/symlink_pkgconfig_files.rb,
lib/rbt/actions/individual_actions/prefix/prefix.rb,
lib/rbt/check_for_updates/check_for_blfs_updates.rb,
lib/rbt/generate_files/generate_shell_completion.rb,
lib/rbt/homebrew/registered_programs_of_homebrew.rb,
lib/rbt/libtool/class_methods/use_this_directory.rb,
lib/rbt/linux/gobolinux/create_dependencies_file.rb,
lib/rbt/linux/slackware/create_slackware_package.rb,
lib/rbt/linux/slackware/generate_slack_desc_file.rb,
lib/rbt/toplevel_methods/configure_appdir_prefix.rb,
lib/rbt/utility_scripts/remove_empty_directories.rb,
lib/rbt/check_for_updates/check_for_gnome_updates.rb,
lib/rbt/check_for_updates/update_kde_applications.rb,
lib/rbt/check_for_updates/update_kde_porting_aids.rb,
lib/rbt/configuration/simple_configuration_loader.rb,
lib/rbt/cookbooks/search_for_tags/search_for_tags.rb,
lib/rbt/generate_files/generate_rbt_configuration.rb,
lib/rbt/utility_scripts/update_entry/update_entry.rb,
lib/rbt/actions/individual_actions/extract/extract.rb,
lib/rbt/actions/individual_actions/headers/headers.rb,
lib/rbt/generate_files/create_global_yaml_database.rb,
lib/rbt/libtool/class_methods/return_every_la_file.rb,
lib/rbt/linux/gobolinux/gobolinux_recipes_comparer.rb,
lib/rbt/requires/require_the_registered_components.rb,
lib/rbt/toplevel_methods/install_libstdc_plus_plus.rb,
lib/rbt/utility_scripts/convert_to_non_traditional.rb,
lib/rbt/generate_files/generate_machomebrew_formula.rb,
lib/rbt/gui/universal_widgets/statistics/statistics.rb,
lib/rbt/gui/universal_widgets/url_action/url_action.rb,
lib/rbt/libtool/class_methods/autocorrect_this_file.rb,
lib/rbt/linux/gobolinux/gobolinux_naming_convention.rb,
lib/rbt/linux/linux_from_scratch/parse_blfs_webpage.rb,
lib/rbt/requires/require_the_generate_files_classes.rb,
lib/rbt/toplevel_methods/run_make_then_make_install.rb,
lib/rbt/toplevel_methods/show_last_configure_option.rb,
lib/rbt/checks_and_validations/validate_archive_size.rb,
lib/rbt/checks_and_validations/validate_blfs_entries.rb,
lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb,
lib/rbt/misc/create_and_populate_pkgconfig_directory.rb,
lib/rbt/toplevel_methods/check_for_binary_duplicates.rb,
lib/rbt/toplevel_methods/determine_host_architecture.rb,
lib/rbt/utility_scripts/check_for_available_versions.rb,
lib/rbt/utility_scripts/check_for_duplicate_binaries.rb,
lib/rbt/utility_scripts/system_compile_possibilities.rb,
lib/rbt/utility_scripts/what_could_become_an_app_dir.rb,
lib/rbt/check_for_updates/NEW_check_for_gnome_updates.rb,
lib/rbt/check_for_updates/check_for_slackware_updates.rb,
lib/rbt/configuration/configuration_instance_variable.rb,
lib/rbt/cookbooks/generate_homepage/generate_homepage.rb,
lib/rbt/generate_files/generate_flatpak_manifest_file.rb,
lib/rbt/requires/require_the_cookbook_utility_scripts.rb,
lib/rbt/toplevel_methods/feedback_program_description.rb,
lib/rbt/utility_scripts/compile_in_traditional_manner.rb,
lib/rbt/utility_scripts/purge_headers_of_this_program.rb,
lib/rbt/actions/individual_actions/configure/configure.rb,
lib/rbt/actions/individual_actions/cookbooks/blfs/blfs.rb,
lib/rbt/actions/individual_actions/information/highest.rb,
lib/rbt/actions/meta_actions/beyond_linux_from_scratch.rb,
lib/rbt/constants/predefined_installation_instructions.rb,
lib/rbt/linux/slackware/install_this_slackware_package.rb,
lib/rbt/toplevel_methods/chroot_and_chown_related_code.rb,
lib/rbt/utility_scripts/beautify_configure_help_output.rb,
lib/rbt/utility_scripts/purge_binaries_of_this_program.rb,
lib/rbt/utility_scripts/report_the_registered_programs.rb,
lib/rbt/utility_scripts/symlink_into_usr_lib_directory.rb,
lib/rbt/actions/individual_actions/software_manager/run.rb,
lib/rbt/checks_and_validations/allowed_cookbook_entries.rb,
lib/rbt/cookbooks/check_for_existing_source_directories.rb,
lib/rbt/gui/universal_widgets/recipe_maker/recipe_maker.rb,
lib/rbt/toplevel_methods/return_version_of_this_program.rb,
lib/rbt/toplevel_methods/show_available_utility_scripts.rb,
lib/rbt/utility_scripts/purge_libraries_of_this_program.rb,
lib/rbt/utility_scripts/remove_programs/remove_programs.rb,
lib/rbt/actions/individual_actions/software_manager/menu.rb,
lib/rbt/actions/individual_actions/software_manager/misc.rb,
lib/rbt/actions/individual_actions/to_current/to_current.rb,
lib/rbt/check_for_updates/check_for_mate_desktop_updates.rb,
lib/rbt/checks_and_validations/validate_cookbook_aliases.rb,
lib/rbt/toplevel_methods/return_binaries_of_this_program.rb,
lib/rbt/actions/individual_actions/software_manager/reset.rb,
lib/rbt/compile_via_sql_database/compile_via_sql_database.rb,
lib/rbt/cookbooks/check_for_inclusion/check_for_inclusion.rb,
lib/rbt/cookbooks/multi_url_displayer/multi_url_displayer.rb,
lib/rbt/cookbooks/scan_source_archive/scan_source_archive.rb,
lib/rbt/libtool/remove_libtool_files/remove_libtool_files.rb,
lib/rbt/utility_scripts/show_dependencies_of_this_library.rb,
lib/rbt/actions/individual_actions/sed_wrapper/sed_wrapper.rb,
lib/rbt/checks_and_validations/check_validity_of_cookbooks.rb,
lib/rbt/checks_and_validations/report_useless_descriptions.rb,
lib/rbt/utility_scripts/check_for_invalid_current_symlinks.rb,
lib/rbt/utility_scripts/symlink_into_the_usr_bin_hierarchy.rb,
lib/rbt/actions/individual_actions/software_manager/actions.rb,
lib/rbt/actions/individual_actions/software_manager/setters.rb,
lib/rbt/check_for_updates/check_for_new_release_on_rubygems.rb,
lib/rbt/colours/determine_the_toplevel_use_colours_variable.rb,
lib/rbt/utility_scripts/increment_program_version/constants.rb,
lib/rbt/checks_and_validations/validate_all_cookbook_entries.rb,
lib/rbt/cookbooks/display_cookbook_dataset/feedback/feedback.rb,
lib/rbt/requires/require_the_classes_for_individual_programs.rb,
lib/rbt/toplevel_methods/check_this_cookbook_file_for_errors.rb,
lib/rbt/toplevel_methods/generate_programs_version_yaml_file.rb,
lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb,
lib/rbt/utility_scripts/save_the_available_programs_versions.rb,
lib/rbt/actions/individual_actions/information/show_all_about.rb,
lib/rbt/checks_and_validations/check_for_correct_dependencies.rb,
lib/rbt/checks_and_validations/report_missing_licence_entries.rb,
lib/rbt/gui/universal_widgets/compile_program/compile_program.rb,
lib/rbt/toplevel_methods/swift_return_version_of_this_program.rb,
lib/rbt/actions/individual_actions/software_manager/deprecated.rb,
lib/rbt/actions/individual_actions/software_manager/initialize.rb,
lib/rbt/checks_and_validations/report_missing_homepage_entries.rb,
lib/rbt/toplevel_methods/fast_return_file_size_of_this_program.rb,
lib/rbt/toplevel_methods/files_and_directories_related_methods.rb,
lib/rbt/utility_scripts/show_description_and_extra_information.rb,
lib/rbt/cookbooks/local_check_for_latest/local_check_for_latest.rb,
lib/rbt/actions/individual_actions/statistics/compile_strategies.rb,
lib/rbt/check_for_updates/report_these_programs_could_be_updated.rb,
lib/rbt/checks_and_validations/check_for_faulty_current_symlinks.rb,
lib/rbt/cookbooks/display_cookbook_dataset/feedback/feedback_url.rb,
lib/rbt/misc/classes_for_individual_programs/change_lib64_to_lib.rb,
lib/rbt/toplevel_methods/determine_appdir_prefix_from_this_input.rb,
lib/rbt/toplevel_methods/report_how_many_binaries_are_registered.rb,
lib/rbt/utility_scripts/compile_into_home_dir_without_symlinking.rb,
lib/rbt/actions/individual_actions/information/gather_information.rb,
lib/rbt/actions/individual_actions/statistics/show_all_statistics.rb,
lib/rbt/cookbooks/copy_the_ideal_cookbook/copy_the_ideal_cookbook.rb,
lib/rbt/utility_scripts/register_program_files_into_yaml_database.rb,
lib/rbt/actions/individual_actions/build_directory/build_directory.rb,
lib/rbt/actions/individual_actions/information/report_xfce_version.rb,
lib/rbt/checks_and_validations/batch_validate_the_cookbook_recipes.rb,
lib/rbt/checks_and_validations/missing_use_this_build_system_entry.rb,
lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb,
lib/rbt/utility_scripts/compile_via_environment_variable_as_prefix.rb,
lib/rbt/checks_and_validations/scan_for_missing_last_update_entries.rb,
lib/rbt/cookbooks/display_cookbook_dataset/display_cookbook_dataset.rb,
lib/rbt/cookbooks/required_dependencies_on/required_dependencies_on.rb,
lib/rbt/gui/libui/compile_via_sql_database/compile_via_sql_database.rb,
lib/rbt/gui/universal_widgets/installed_programs/installed_programs.rb,
lib/rbt/shell/create_shell_script_containing_these_program_versions.rb,
lib/rbt/toplevel_methods/configure_has_a_higher_priority_than_meson.rb,
lib/rbt/toplevel_methods/return_location_to_this_programs_yaml_file.rb,
lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb,
lib/rbt/utility_scripts/register_program_files_into_global_database.rb,
lib/rbt/actions/individual_actions/software_manager/software_manager.rb,
lib/rbt/utility_scripts/show_overview_over_available_utility_scripts.rb,
lib/rbt/cookbooks/create_cookbook_yaml_file/create_cookbook_yaml_file.rb,
lib/rbt/libtool/class_methods/return_all_la_files_from_this_directory.rb,
lib/rbt/toplevel_methods/compile_via_appdir_prefix_without_symlinking.rb,
lib/rbt/actions/individual_actions/cookbooks/raw_cookbook/raw_cookbook.rb,
lib/rbt/actions/individual_actions/information/feedback_description_of.rb,
lib/rbt/actions/individual_actions/show_manual_steps/show_manual_steps.rb,
lib/rbt/actions/individual_actions/software_manager/logic_related_code.rb,
lib/rbt/toplevel_methods/return_array_of_programs_without_a_blfs_entry.rb,
lib/rbt/toplevel_methods/return_string_containing_all_program_versions.rb,
lib/rbt/toplevel_methods/report_extended_information_about_this_program.rb,
lib/rbt/utility_scripts/kernel_config_sanitizer/kernel_config_sanitizer.rb,
lib/rbt/utility_scripts/symlink_from_to_current/symlink_from_to_current.rb,
lib/rbt/actions/individual_actions/infer_build_system/infer_build_system.rb,
lib/rbt/actions/individual_actions/show_compile_chain/show_compile_chain.rb,
lib/rbt/actions/individual_actions/software_manager/extract_related_code.rb,
lib/rbt/actions/individual_actions/statistics/display_barplot_statistics.rb,
lib/rbt/actions/individual_actions/software_manager/query_related_methods.rb,
lib/rbt/actions/individual_actions/information/report_mate_desktop_version.rb,
lib/rbt/actions/individual_actions/statistics/show_compile_time_statistics.rb,
lib/rbt/linux/linux_from_scratch/make_conditional_symlink_for_lfs_binutils.rb,
lib/rbt/toplevel_methods/try_to_find_shortcut_for_a_chain_compiled_program.rb,
lib/rbt/utility_scripts/symlink_all_upcased_programs_to_downcased_variants.rb,
lib/rbt/cookbooks/download_all_source_archives/download_all_source_archives.rb,
lib/rbt/cookbooks/improve_the_cookbook_recipes/improve_the_cookbook_recipes.rb,
lib/rbt/utility_scripts/compile_versioned_program/compile_versioned_program.rb,
lib/rbt/utility_scripts/increment_program_version/increment_program_version.rb,
lib/rbt/actions/individual_actions/statistics/return_compile_time_statistics.rb,
lib/rbt/actions/individual_actions/statistics/show_how_many_files_are_tracked.rb,
lib/rbt/actions/individual_actions/cookbooks/expand_cookbooks/expand_cookbooks.rb,
lib/rbt/actions/individual_actions/find_likely_directory/find_likely_directory.rb,
lib/rbt/actions/individual_actions/information/create_program_version_url_file.rb,
lib/rbt/actions/individual_actions/information/show_versions_of_these_programs.rb,
lib/rbt/actions/individual_actions/cookbooks/expanded_cookbook/expanded_cookbook.rb,
lib/rbt/actions/individual_actions/cookbooks/sanitize_cookbook/sanitize_cookbook.rb,
lib/rbt/actions/individual_actions/meson_appdir_configure/meson_appdir_configure.rb,
lib/rbt/actions/individual_actions/create_app_dir_skeleton/create_app_dir_skeleton.rb,
lib/rbt/actions/individual_actions/simple_appdir_configure/simple_appdir_configure.rb,
lib/rbt/utility_scripts/purge_incorrect_yaml_directories_in_the_programs_hierarchy.rb,
lib/rbt/actions/individual_actions/cookbooks/sanitize_cookbook/sanitize_related_code.rb,
lib/rbt/actions/individual_actions/find_alternative_archive/find_alternative_archive.rb,
lib/rbt/actions/individual_actions/remove_outdated_archives/remove_outdated_archives.rb,
lib/rbt/checks_and_validations/find_directory_entries_without_corresponding_yaml_file.rb,
lib/rbt/utility_scripts/classes_for_individual_programs/create_pkgconfig_file_for_lua.rb,
lib/rbt/actions/individual_actions/cookbooks/suggest_cookbook_for/suggest_cookbook_for.rb,
lib/rbt/utility_scripts/static_overview_of_the_available_binaries_on_this_computer_system.rb,
lib/rbt/actions/individual_actions/cookbooks/scan_for_blfs_programs/scan_for_blfs_programs.rb,
lib/rbt/libtool/class_methods/append_this_directory_to_the_list_of_directories_to_search_for.rb,
lib/rbt/actions/individual_actions/filter_for_valid_program_names/filter_for_valid_program_names.rb,
lib/rbt/actions/individual_actions/information/aggregate_information_from_the_expanded_cookbooks.rb,
lib/rbt/toplevel_methods/determine_appdir_prefix_from_this_input_by_guessing_the_program_version.rb,
lib/rbt/actions/individual_actions/cookbooks/show_configuration_options/show_configuration_options.rb,
lib/rbt/actions/individual_actions/checks_and_validations/check_for_invalid_entries_in_this_cookbook.rb,
lib/rbt/actions/individual_actions/map_this_input_to_that_registered_program/map_this_input_to_that_registered_program.rb

Overview

#

require ‘rbt/toplevel_methods/determine_appdir_prefix_from_this_input_by_guessing_the_program_version.rb’ RBT.determine_appdir_prefix_from_this_input

#

Defined Under Namespace

Modules: Actions, ClassesForIndividualPrograms, Compile, CompileBaseModule, Configuration, Cookbooks, DatabaseAdapters, Errors, GUI, Gobolinux, Linux, SaveFile Classes: Action, ApplySedOperations, Autosymlink, AutoupdateThisProgram, BackupProgram, Base, BeautifyConfigureHelpOutput, BeautifySystem, BinaryNameBelongsToWhichProgram, BuildDetector, ChainCompile, Chainer, ChangePrefix, CheckForDuplicateBinaries, CheckForInvalidCurrentSymlinks, CleanupSystemTags, Cmake, ColourMakeInstall, ColourizeParser, Commandline, CompileBase, CompileBaseSystem, CompileInTraditionalManner, CompileIntoHomeDir, CompileIntoHomeDirWithoutSymlinking, CompileVersionedProgram, CompileViaEnvironmentVariableAsPrefix, CompileViaSQL, CompileViaSQLDatabase, ConfigLogParser, ConfigureString, Controller, ConvertToNonTraditional, ConvertToTraditional, CopyTheseArchives, CreateAndPopulatePkgconfigDirectory, CreateBashScripts, CreateLogFile, CreatePackage, CreatePkgconfigFile, CreatePkgconfigFileForLua, CreateRpmSpecFile, CreateShellScriptContainingTheseProgramsVersions, CreateSnapcraftFile, ExclusiveLogic, ExtraInformation, FeedbackBinariesOf, FeedbackInformation, FetchAllM4Macros, FileDoesNotExist, FixPkgconfigFile, FlatpakUrlScanner, GenerateFlatpakManifestFile, GenerateMachomebrewFormula, GenerateMakefile, GeneratePdfTutorial, GenerateRbtConfiguration, GenerateShellCompletion, GenerateShellscript, GenerateSqlTable, Gitty, ImproveTheCookbookRecipes, InstallGlibSchema, InstallGraalvm, InstalledPrograms, Installer, KernelConfigSanitizer, LeanPrototype, Libtool, Make, MissingHomepages, NotAllowedDirectory, NotFoundLibraries, PackageRbtScripts, ParseConfigureHelp, PostInstall, PostinstallationStep, ProblemsAndErrors, ProfileInstall, PurgeBinariesOfThisProgram, PurgeHeadersOfThisProgram, PurgeIncorrectYamlDirectoriesInTheProgramsHierarchy, PurgeLibrariesOfThisProgram, QueryBinaryToPackage, QueryFileAssociation, QueryHeaderToPackage, ReconstituteGlibc, RegisterProgramFilesIntoGlobalDatabase, RegisterProgramFilesIntoYamlDatabase, RegisteredTags, RemoveAllSymlinks, RemoveEmptyDirectories, RemoveProgram, RemovePrograms, RemoveSymlinks, ReplaceSymlinks, RequiredDependenciesOn, ReverseDependencies, SaveTheAvailableProgramsVersions, Scons, ShowDependenciesOfThisLibrary, ShowDescriptionAndExtraInformation, SimpleVersionComparer, SimplifiedLddOutput, SimplifyRootEntries, Sinatra, StaticOverviewOfTheAvailableBinariesOnThisComputerSystem, SymlinkAllPrograms, SymlinkAllUpcasedProgramsToDowncasedVariants, SymlinkFromToCurrent, SymlinkGlibSchema, SymlinkHeaders, SymlinkIntoTheUsrBinHierarchy, SymlinkIntoUsrLibDirectory, SymlinkPkgconfigFiles, SystemCompilePossibilities, Toolchain, Uninstall, UpdateEntry, UpdateSlackpkg, UrlAction, UseFlags, Users, VersionSwitcher, WhatCouldBecomeAnAppDir

Constant Summary collapse

ColourMake =
#

RBT::ColourMake

#
Make
COOKBOOK_ALIASES =

This will be for most everyone else.

{}
PROJECT_BASE_DIRECTORY =
#

RBT::PROJECT_BASE_DIRECTORY

#
File.absolute_path("#{__dir__}/..")+'/'
VERSION =
#

VERSION

Which version does RBT have. Query via: RBT::VERSION. PROGRAM_VERSION is just an alias to it - stick to using VERSION instead “officially” whenever possible.

#
'0.16.13'
RBT_VERSION_NUMBER =

RBT_VERSION_NUMBER

VERSION
PROGRAM_VERSION =

PROGRAM_VERSION

VERSION
LAST_UPDATE =
#

LAST_UPDATE

This specifies when the RBT project was last updated. It should be updated whenever the VERSION constant changes.

#
'03.04.2024'
URL_TO_THE_DOCUMENTATION =
#

URL_TO_THE_DOCUMENTATION

#
"https://www.rubydoc.info/gems/rbt/#{VERSION}"
ENCODING_UTF =
#

RBT::ENCODING_UTF

#
'UTF-8'
ENCODING_ISO =
#

RBT::ENCODING_ISO

#
'ISO-8859-1'
ISO_ENCODING =
ENCODING_ISO
USE_THIS_ENCODING =
#

RBT::USE_THIS_ENCODING

Main pointer towards the main Encoding for the RBT project.

#
ENCODING_UTF
USE_MAIN_ENCODING =

USE_MAIN_ENCODING

USE_THIS_ENCODING
N =
#

N

#
"\n"
TABULATOR =
#

TABULATOR

#
"\t"
COMMAND_NOT_FOUND =
#

COMMAND_NOT_FOUND

#
'command not found'
HOME_FOR_X =
#

RBT::HOME_FOR_X

This constant is mostly used on my home setup, so it will be fairly useless for other people.

#
'/home/x/'
HOME_DIRECTORY_FOR_USER_X =

HOME_DIRECTORY_FOR_USER_X

HOME_FOR_X
DEPOT_DIR =
#

DEPOT_DIR

Hardcoded path to the depot-directory.

#
'/Depot/'
USR_INCLUDE_DIR =
#

USR_INCLUDE_DIR

This can be standalone because it will be ALWAYS absolute, pointing towards “/usr/include/”.

#
'/usr/include/'
FILE_SETUP_PY =
#

FILE_SETUP_PY

This constant can be useful if you have to install a program that depends on the file ‘setup.py’.

#
'setup.py'
FILE_SCONS =
#

FILE_SCONS

#
'SConstruct'
FILE_WAF =
#

FILE_WAF

#
'waf'
FILE_CMAKE_LISTS =
#

FILE_CMAKE_LISTS

#
'CMakeLists.txt'
FILE_MESON_BUILD =
#

FILE_MESON_BUILD

#
'meson.build'
TAR_XZ =
#

TAR_XZ

Several archive types are kept here.

#
'.tar.xz'
TARXZ =

TARXZ

TAR_XZ
TAR_BZ2 =
#

TAR_BZ2

#
'.tar.bz2'
TARBZ2 =

TARBZ2

TAR_BZ2
TAR_GZ =
#

TAR_GZ

#
'.tar.gz'
TARGZ =

TARGZ

TAR_GZ
ZIP =
#

ZIP

#
'.zip'
GEM =
#

GEM

#
'.gem'
LZ =
#

LZ

#
'.lz'
DEFAULT_ARCHIVE_TYPE =
#

DEFAULT_ARCHIVE_TYPE

This constant may be required so that other classes know which is the default archive. This can then be used to, for example, repackage archives into this format.

#
TAR_XZ
ARRAY_REGISTERED_ARCHIVES =
#

ARRAY_REGISTERED_ARCHIVES

Keep these archive formats registered in this Array.

#
[
  TAR_XZ,
  TAR_BZ2,
  TAR_GZ,
  ZIP,
  GEM,
  LZ
]
RUBY_SRC_DIR =
#

RUBY_SRC_DIR

This deliberately hard-coded constant is for my home system - it helps speed up the development process if I can use such constants as shortcuts.

#
"#{HOME_FOR_X}programming/ruby/src/"
RUBY_SRC_DIR_AT_HOME =

RUBY_SRC_DIR_AT_HOME

RUBY_SRC_DIR
RUBY_SRC_DIRECTORY =

RUBY_SRC_DIRECTORY

RUBY_SRC_DIR
RUBY_SRC =

RUBY_SRC

RUBY_SRC_DIR
FILE_USE_FLAGS =
#

FILE_USE_FLAGS

#
"#{project_yaml_directory}use_flags/use_flags.yml"
FILE_COOKBOOK_CHAINED_PROGRAMS =
#

FILE_COOKBOOK_CHAINED_PROGRAMS

Easier constant to keep track of the chained cookbook-programs. In this context, a chain means a successive run of programs that are to be compiled.

This will then yield to a path such as the following:

/usr/lib/ruby/site_ruby/3.0.0/rbt/yaml/chained_programs/chained_programs.yml
#
"#{project_yaml_directory}chained_programs/chained_programs.yml"
FILE_COOKBOOK_ALIASES =
#

FILE_COOKBOOK_ALIASES

#
"#{project_yaml_directory}cookbook_aliases/cookbook_aliases.yml"
FILE_WINDOWS_COOKBOOK =
#

FILE_WINDOWS_COOKBOOK

#
"#{project_yaml_directory}windows_cookbook.yml"
FILE_COMPILE_HOOKS =
#

FILE_COMPILE_HOOKS

#
"#{project_yaml_directory}compile_hooks.yml"
FILE_TIME_COMPILATION =
#

FILE_TIME_COMPILATION

#
"#{project_yaml_directory}configuration/time_compilation.yml"
FILE_PROGRAMS_DIRECTORY =
#

FILE_PROGRAMS_DIRECTORY

#
"#{project_yaml_directory}configuration/programs_directory.yml"
FILE_TRY_TO_USE_THE_FILE_WINDOWS_COOKBOOK =
#

FILE_TRY_TO_USE_THE_FILE_WINDOWS_COOKBOOK

#
"#{project_yaml_directory}configuration/try_to_use_the_file_windows_cookbook.yml"
FILE_USE_MD5SUM =
#

FILE_USE_MD5SUM

#
"#{project_yaml_directory}configuration/use_md5sum.yml"
FILE_USE_PORG =
#

FILE_USE_PORG

#
"#{project_yaml_directory}configuration/use_porg.yml"
FILE_SHORT_TUTORIAL =
#

FILE_SHORT_TUTORIAL

#
"#{RBT.project_base_dir?}tutorial/short_tutorial.md"
RUBY_SRC_DIR_RBT =
#

RUBY_SRC_DIR_RBT

This constant is only useful on my home system.

It corresponds to:

/home/x/programming/ruby/src/rbt/lib/rbt/
#
"#{RUBY_SRC_DIR}rbt/lib/rbt/"
ROEBE_PATH_TO_COOKBOOKS =

ROEBE_PATH_TO_COOKBOOKS

RUBY_SRC_DIR_RBT
RUBY_SRC_DIR_RBT_YAML =
#

RUBY_SRC_DIR_RBT_YAML

This constant may correspond to the String “/home/x/programming/ruby/src/rbt/lib/rbt/yaml/”.

#
"#{RUBY_SRC_DIR_RBT}yaml/"
RUBY_SRC_DIR_RBT_YAML_AT_HOME =
#

RUBY_SRC_DIR_RBT_YAML_AT_HOME

#
RUBY_SRC_DIR_RBT_YAML
RUBY_SRC_RBT_COOKBOOKS =
#

RUBY_SRC_RBT_COOKBOOKS

This constant refers to the following path on my home system:

/home/x/programming/ruby/src/rbt/lib/rbt/yaml/cookbooks/
#
"#{RUBY_SRC_DIR_RBT_YAML}cookbooks/"
GOBOLINUX_LAYOUT =
#

GOBOLINUX_LAYOUT

This constant is probably only needed for gobolinux systems.

#
"#{ENV['GOBOLINUX_LAYOUT']}"
REGISTER_COMPILED_PROGRAM =
#

REGISTER_COMPILED_PROGRAM

Whether we should register compiled programs or not.

#
true
COMPILE_EVERYTHING_INTO_STANDALONE_DIRECTORY =
#

COMPILE_EVERYTHING_INTO_STANDALONE_DIRECTORY

Whether to compile everything into a standalone directory or not.

#
false
SHELL_ERROR_CODE =
#

SHELL_ERROR_CODE

Shell Error code - to append. Since as of September 2022 this won’t include any ‘ ’ character. Before that it did.

#
'2>&1'
ERROR_LINE =
SHELL_ERROR_CODE
DEFAULT_PROGRAM_ENTRY =
#

DEFAULT_PROGRAM_ENTRY

#
'htop'
DEFAULT_ENTRY =

an “alias” to the above ^^^

DEFAULT_PROGRAM_ENTRY
FILE_CPUINFO =
#

FILE_CPUINFO

#
'/proc/cpuinfo'
HOST_CPU =
#

HOST_CPU

The host CPU that the scripts are running on.

#
TARGET_CPU =
#

TARGET_CPU

The target CPU that we are running on.

#
MAKE_COMMAND_TO_USE =
#

MAKE_COMMAND_TO_USE

Which make command to use by default.

#
'make'
CHECK_FOR_BINARY_NAMES =
#

CHECK_FOR_BINARY_NAMES

#
true
CHECK_FOR_LIBRARY_NAMES =
#

CHECK_FOR_LIBRARY_NAMES

#
true
FILE_BUILD_NINJA =
#

FILE_BUILD_NINJA

#
'build.ninja'
SHOW_EXTRA_INFORMATION =
#

SHOW_EXTRA_INFORMATION

#
true
LINUX =
#

LINUX

#
"#{ENV['LINUX']}"
DIRECTORY_INDIVIDUAL_COOKBOOKS_AT_ROEBE_HOME =
#

DIRECTORY_INDIVIDUAL_COOKBOOKS_AT_ROEBE_HOME

This constant is used mostly on my home system.

#
"#{RUBY_SRC_DIR_RBT_YAML}cookbooks/"
COOKBOOKS_BASE_DIRECTORY =
#

COOKBOOKS_BASE_DIRECTORY

The following constant is actually only useful for my home system, and only if I don’t use any other setting. So this is mostly just here for legacy reasons.

#
"#{HOME_DIRECTORY_FOR_USER_X}programming/ruby/src/"\
"rbt/lib/rbt/yaml/cookbooks/"
RBT_HOMEPAGE_URL =
#

RBT_HOMEPAGE_URL

The RBT Homepage is defined here.

#
'https://rubygems.org/gems/rbt'
DEFAULT_COLOUR_TO_USE =
#

DEFAULT_COLOUR_TO_USE

Specify what is our main colour to use for the Cookbooks project.

#
"\e[0;32m"
ARRAY_HELP_OPTIONS =
#

RBT::ARRAY_HELP_OPTIONS (help tag)

All the help options are stored here. These are the ones that work on e. g. “rbt –help”.

#
%w(
  HELP -h --help --help? help hel he h
  display_standard_help_options
)+['Display help']
HASH_ENGLISH_NUMBERS =
#

HASH_ENGLISH_NUMBERS

#
{
  'one'   => 1,
  'two'   => 2,
  'three' => 3,
  'four'  => 4,
  'five'  => 5,
  'six'   => 6,
  'seven' => 7,
  'eight' => 8,
  'nine'  => 9
}
ARRAY_HELP_VERSION_OPTIONS =
#

ARRAY_HELP_VERSION_OPTIONS

#
%w(
  --version?
  --version
  version?
  VERSION
  version
)
ARRAY_SPECIAL_COMPONENT_CONTAINING_MANY_SUBCOMPONENTS =
#

ARRAY_SPECIAL_COMPONENT_CONTAINING_MANY_SUBCOMPONENTS

Here we add constants that can be used like in this way:

ry --plasma1
ry --gnome3
#
%w(
  kde
  kde_apps
  mate
  game
  xfce
  xorg
  gnome
  plasma
  lxqt
  portingaids
)
KDE_REGEX_FOR_REMOTE_ARCHIVES =
#

KDE_REGEX_FOR_REMOTE_ARCHIVES

This is the regex that can be used in order to obtain the proper remote URL to the individual KDE packages.

As an example, have a look here:

https://rubular.com/r/3ZX5Rz8soGqjsw
#
/<tr><td valign="top"><a href="(.+.tar.xz)"><img/
REGEXES_TO_SHOW_THE_SOURCE_DIRECTORY =
#

REGEXES_TO_SHOW_THE_SOURCE_DIRECTORY

These regexes can be used to show/check for the source directory.

#
[
  /^-?-?source(-|_| )?dir\??$/,
  /^-?-?source(-|_| )?archive\??$/,
  /^-?-?src(-|_| )?dir\??$/
]
REGEX_TO_SANITIZE_LIBRARIES =
#

REGEX_TO_SANITIZE_LIBRARIES

Use this regex if you wish to sanitize some libraries.

#
/(.+)\.{(\w+),(\w+)}?/
REGEX_TO_USE_FOR_FOR_GITHUB =
#

REGEX_TO_USE_FOR_FOR_GITHUB

This constant is used to grab archives from github.

These archives have a form like:

https://github.com/ninja-build/ninja/archive/v1.7.1.tar.gz

The following example on rubular shows how to use this:

https://rubular.com/r/f78srzR8v8E0As

The match that will be returned is then a String such as:

1.7.1.tar.gz
#
/^http.+\/archive\/v(.+)$/
REGISTERED_COOKBOOK_ENTRIES =
[]
FILE_CCACHE =
#

FILE_CCACHE

#
"#{project_yaml_directory}configuration/use_ccache.yml"
FILE_GLOBAL_FLAGS =
#

FILE_GLOBAL_FLAGS

#
"#{project_yaml_directory}global_flags.yml"
ROEBE_FILE_GLOBAL_FLAGS =
#

ROEBE_FILE_GLOBAL_FLAGS

This constant here is only for my home system, hence the prefix ROEBE in it.

#
"#{RUBY_SRC_DIR_RBT_YAML}"\
"#{File.basename(FILE_GLOBAL_FLAGS)}"
SPECIFICATION_OF_REGISTERED_COOKBOOK_ENTRIES =
nil
DIRECTORY_RBT_PROFILES =
#

DIRECTORY_RBT_PROFILES

This may be a path such as:

/home/Programs/Ruby/2.6.5/lib/ruby/site_ruby/2.6.0/rbt/misc/profiles/
#
"#{RBT.project_base_directory?}misc/profiles/"
DIRECTORY_TO_THE_PROFILES =

DIRECTORY_TO_THE_PROFILES

DIRECTORY_RBT_PROFILES
FILE_REGISTERED_HEADERS =
#

FILE_REGISTERED_HEADERS

Prefer to use the method RBT.file_registered_headers instead - this constant is mildly deprecated (but still available if you really need it).

#
"#{project_yaml_directory}registered/headers.yml"
CHAINED_PROGRAMS =

Use an empty hash in this case.

{}
NAMESPACE =
#

NAMESPACE

Which namespace we shall use for the RBT project may be defined here.

This is a Hash “constant”, so that we can more easily re-define it, if we have to.

#
{
  namespace: 'RBT'
}
GNOME_FTP_URL =
#

GNOME_FTP_URL

#
'https://download.gnome.org/sources/?C=M&O=D'
DOWNLOAD_KDE_ORG =
#

RBT::DOWNLOAD_KDE_ORG

#
'https://download.kde.org/'
REMOTE_URL_FOR_KDE_APPLICATIONS =
#

RBT::REMOTE_URL_FOR_KDE_APPLICATIONS

The KDE applications include software such as “dolphin”. They are now called “KDE Gear” rather than “KDE Applications”.

The URL may look like this:

https://download.kde.org/stable/release-service/?C=M;O=D

To batch-update these applications, do:

update_kde_applications
updatekdeapplications
#
"#{DOWNLOAD_KDE_ORG}stable/release-service/24.02.0/src/"
REMOTE_URL_FOR_KDE_FRAMEWORKS =
#

REMOTE_URL_FOR_KDE_FRAMEWORKS

This URL should point to the latest KDE-frameworks release.

Presently, (08 September 2018) the latest KDE-frameworks release is 5.50.0 (the URL, oddly enough, does not include the trailing “0”). Subsequent releases neither have had a trailing “0”.

To batch-update from the commandline, try this:

update_kde_frameworks
updatekdeframeworks
#

download.kde.org/stable/frameworks/5.115/

#
"#{DOWNLOAD_KDE_ORG}stable/frameworks/5.115/"
REMOTE_URL_FOR_KDE_PORTING_AIDS =
#

REMOTE_URL_FOR_KDE_PORTING_AIDS

This constant must come after the constant REMOTE_URL_FOR_KDE_FRAMEWORKS has been defined.

To update these, try:

rbt --update_porting_aids
update_porting_aids
#

download.kde.org/stable/frameworks/5.115/portingAids/

#
"#{REMOTE_URL_FOR_KDE_FRAMEWORKS}portingAids/"
REMOTE_URL_FOR_KDE_PLASMA =
#

REMOTE_URL_FOR_KDE_PLASMA (plasma tag)

Always point to the latest KDE-Plasma (upstream) URL here with this constant, such as www.kde.org/info/plasma-5.14.3.php.

To invoke updating all KDE-plasma components from the commandline, you may issue the following command:

update_kde_plasma
updatekdeplasma
#
"#{DOWNLOAD_KDE_ORG}stable/plasma/6.0.2/"
REMOTE_DOWNLOAD_URL_FOR_KDE_PLASMA =
#

REMOTE_DOWNLOAD_URL_FOR_KDE_PLASMA

#
"#{DOWNLOAD_KDE_ORG}stable/plasma/"
REMOTE_PUB_MATE_DESKTOP_RELEASES =
#

REMOTE_PUB_MATE_DESKTOP_RELEASES

#
'https://pub.mate-desktop.org/releases/'
REMOTE_PUB_MATE_DESKTOP_RELEASES_LATEST_VERSION =
#

REMOTE_PUB_MATE_DESKTOP_RELEASES_LATEST_VERSION (mate tag)

This should be used as the base for the download-functionality in the file check_for_mate_desktop_updates.rb

This would correspond to an URL like:

https://pub.mate-desktop.org/releases/1.24/
https://pub.mate-desktop.org/releases/1.26/
https://pub.mate-desktop.org/releases/
#
"#{REMOTE_PUB_MATE_DESKTOP_RELEASES}1.26/"
REMOTE_DOWNLOAD_BASE_URL_FOR_LXQT =
#

REMOTE_DOWNLOAD_BASE_URL_FOR_LXQT

#
'https://downloads.lxqt.org/'
CURRENT_VERSION_OF_LXQT =
#

CURRENT_VERSION_OF_LXQT

Use this constant to keep track as to which lxqt version is the one that is currently tracked by RBT. It has to be manually updated (for now).

#
'0.14.1'
REMOTE_DOWNLOAD_URL_FOR_LXQT =
#

REMOTE_DOWNLOAD_URL_FOR_LXQT

The following constant should have an URL such as:

https://downloads.lxqt.org/0.14.1.html
#
"#{REMOTE_DOWNLOAD_BASE_URL_FOR_LXQT}#{CURRENT_VERSION_OF_LXQT}.html"
REMOTE_SLACKWARE_HOMEPAGE =
#

REMOTE_SLACKWARE_HOMEPAGE

#
'https://www.slackware.com/changelog/current.php?cpu=x86_64'
BASE_URL_TO_GNOME_SOURCES =
#

BASE_URL_TO_GNOME_SOURCES

#
'https://ftp.gnome.org/pub/GNOME/sources/'
BLFS_CHANGELOG_WEBPAGE =
#

BLFS_CHANGELOG_WEBPAGE

#
'https://www.linuxfromscratch.org/blfs/view/svn/introduction/changelog.html'
REMOTE_URL_TO_THE_MATE_DESKTOP_COMPONENTS =
#

REMOTE_URL_TO_THE_MATE_DESKTOP_COMPONENTS

This constant specifies where we can find the (remote) source code to the mate-desktop, via HTTP-file listing.

#
"#{REMOTE_PUB_MATE_DESKTOP_RELEASES_LATEST_VERSION}?C=M&O=D"
URL_TO_REMOTE_CHANGELOG =
#

URL_TO_REMOTE_CHANGELOG

Where to keep the remote changelog, if we make use of one that is.

This is no longer in use as of February 2024 - but, for the time being, we will retain it.

#
'https://shevy.bplaced.net/rbt_changelog.html'
SHALL_WE_DEBUG =

default fallback.

DEBUG = false
YAML_FILE_REGISTERED_TAGS =

Otherwise, initialize as empty hash.

{}
ALL_TAGS =

ALL_TAGS

YAML_FILE_REGISTERED_TAGS
USE_FLAGS =
nil
USE_TAGS =
#

USE_TAGS

Whether to use (and thus symlink) tags. Can be changed via the yaml configuration file.

#
@configuration.use_tags
USE_ABSOLUTE_SYMLINKING =
#

RBT::USE_ABSOLUTE_SYMLINKING

#
@configuration.use_absolute_symlinking
REPORT_SPECIFIC_PROGRAM_NAME =
#

REPORT_SPECIFIC_PROGRAM_NAME

#
@configuration.report_specific_program_name
CAPITALIZE_PROGRAM_NAMES =
#

CAPITALIZE_PROGRAM_NAME

Whether we should capitalize the program names or not. The difference will then be e. g. “htop” versus “Htop”.

#
@configuration.capitalize_program_names
CAPITALIZE_PROGRAM_NAME =
CAPITALIZE_PROGRAM_NAMES
STOP_ON_ERROR =
#

STOP_ON_ERROR

Whether we stop on error or not.

#
@configuration.stop_on_error
YAML_DATABASE_DIRECTORY =
#

YAML_DATABASE_DIRECTORY

Directory definition to use our yaml databases.

#
RBT.rbt_log_directory?
TRY_TO_DOWNLOAD_IF_NOT_FOUND =
#

RBT::TRY_TO_DOWNLOAD_IF_NOT_FOUND

Whether to try and download a program if we can not find it locally.

#
RBT.configuration?.try_to_download_if_not_found
FILE_REGISTERED_BINARIES =
#

FILE_REGISTERED_BINARIES

This may be a file path such as:

/home/Programs/Ruby/2.7.1/lib/ruby/site_ruby/2.7.0/rbt/yaml/registered/binaries.yml

cat $COOKBOOKS/yaml/registered_binaries.yml

#
"#{RBT.yaml_directory_for_the_registered_yaml_files?}binaries.yml"
YAML_FILE_REGISTERED_BINARIES =

Otherwise, initialize as empty hash.

{}
ALL_BINARIES =

ALL_BINARIES

YAML_FILE_REGISTERED_BINARIES
FILE_REGISTERED_LIBRARIES =
#

FILE_REGISTERED_LIBRARIES

This may be a file path such as:

/Programs/Ruby/2.4.1/lib/ruby/site_ruby/2.4.0/rbt/yaml/registered_libraries.yml

cat $RBT/yaml/registered_libraries.yml

#
"#{RBT.yaml_directory_for_the_registered_yaml_files?}libraries.yml"
YAML_FILE_REGISTERED_LIBRARIES =

Otherwise, initialize as empty hash.

{}
ALL_LIBRARIES =

ALL_LIBRARIES

YAML_FILE_REGISTERED_LIBRARIES
FILE_REGISTERED_GIR_FILES =
#

FILE_REGISTERED_GIR_FILES

#
"#{RBT.yaml_directory_for_the_registered_yaml_files?}gir_files.yml"
N_CHARACTERS_PER_LINE =
#

RBT::N_CHARACTERS_PER_LINE

Default value to be used for word-wrap splitting.

#
78
ConfigureHelp =
#

RBT::ConfigureHelp

#
ParseConfigureHelp
FILE_REGISTERED_PKGCONFIG_FILES =
#

FILE_REGISTERED_PKGCONFIG_FILES

#
"#{RBT.yaml_directory_for_the_registered_yaml_files?}pkgconfig_files.yml"
REMOTE_URL_TO_THE_HOMEBREW_FORMULAS =
#

RBT::REMOTE_URL_TO_THE_HOMEBREW_FORMULAS

#
'https://formulae.brew.sh/formula/'
CreateSlackwarePackage =
#

RBT::CreateSlackwarePackage

#
RBT::Linux::Slackware::CreateSlackwarePackage
COLOURS =
#

COLOURS

#
::Colours
HASH_DESIGNATED_COLOURS =
#

HASH_DESIGNATED_COLOURS

#
{}
HASH_INSTALLATION_INSTRUCTIONS =
#

HASH_INSTALLATION_INSTRUCTIONS

This Hash gives us an easier handle to sanitize our data.

It has some constant-shortcuts that are convenient for use lateron.

For instance, RINSTALL means “ruby install”, PINSTALL means “python install”.

#
{}
InstallThisSlackwarePackage =
#

RBT::InstallThisSlackwarePackage

#
RBT::Linux::Slackware::InstallThisSlackwarePackage
Cookbook =
#

RBT::Cookbook

This will also “alias” methods such as RBT::Cookbook[].

#
RBT::Action::Cookbooks::SanitizeCookbook

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.action(action_that_is_desired = nil, optional_argument1 = ARGV, options_hash = {}, &block) ⇒ Object

#

RBT.action (action tag, actions tag)

The second argument to this method defaults to ARGV since as of May 2022.

If you want to require all actions then use this line:

require 'rbt/requires/require_actions.rb'
#


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
# File 'lib/rbt/actions/actions.rb', line 27

def self.action(
    action_that_is_desired = nil,
    optional_argument1     = ARGV, # This is typically the main input to this method.
    options_hash           = {},
    &block
  )
  action_that_is_desired = action_that_is_desired.to_s.delete('?').to_sym
  _ = optional_argument1 # Easier "pointer" here.
  # ======================================================================= #
  # Before September 2022 this method turned the variable optional_argument1
  # into a String, if it was an Array. This is no longer done, as we lose
  # information that way.
  # ======================================================================= #
  case action_that_is_desired # (case tag)
  # ======================================================================= #
  # === :show_manual_steps
  #
  # Commandline usage example:
  #
  #   raction show_manual_steps glibc
  #
  # ======================================================================= #
  when :show_manual_steps,
       :ShowManualSteps
    require 'rbt/actions/individual_actions/show_manual_steps/show_manual_steps.rb'
    RBT.show_manual_steps(_)
  # ======================================================================= #
  # === :run_meson_configure_step
  # ======================================================================= #
  when :run_meson_configure_step
    require 'rbt/toplevel_methods/meson.rb'
    return RBT.run_meson_configure_step(_, &block)
  # ======================================================================= #
  # === :prefix_object
  # ======================================================================= #
  when :prefix_object,
       :PrefixObject,
       :prefix,
       :Prefix
    require 'rbt/actions/individual_actions/prefix/prefix.rb'
    _ = _.first if _.is_a? Array
    RBT.prefix_object(_, &block)
  # ======================================================================= #
  # === :make_app_prefix
  # ======================================================================= #
  when :make_app_prefix
    require 'rbt/toplevel_methods/make_app_prefix.rb'
    RBT.make_app_prefix(_)
  # ======================================================================= #
  # === :build_directory
  #
  # Commandline usage example:
  #
  #   raction build_directory
  #
  # ======================================================================= #
  when :build_directory,
       :BuildDirectory
    require 'rbt/actions/individual_actions/build_directory/build_directory.rb'
    RBT.build_directory(_, &block)
  # ======================================================================= #
  # === :missing_use_this_build_system_entry
  #
  # Commandline usage example:
  #
  #   raction missing_use_this_build_system_entry
  #
  # ======================================================================= #
  when :missing_use_this_build_system_entry,
       :missing_build_system,
       :MissingBuildSystem
    require 'rbt/checks_and_validations/missing_use_this_build_system_entry.rb'
    RBT.missing_use_this_build_system_entry
  # ======================================================================= #
  # === :store_abbreviations
  #
  # Commandline usage example:
  #
  #   raction abbrev
  #
  # ======================================================================= #
  when :store_abbreviations,
       :StoreAbbreviations,
       :abbrev
    require 'rbt/toplevel_methods/available_programs.rb'
    RBT.store_abbreviations
  # ======================================================================= #
  # === :ntrad
  # ======================================================================= #
  when :ntrad,
       :non_traditional,
       :appdir
    require 'rbt/actions/individual_actions/ntrad/ntrad.rb'
    _ = [_].flatten.compact
    work_on_these_programs = [_]
    RBT.ntrad(work_on_these_programs, &block)
  # ======================================================================= #
  # === :compile_in_traditional_manner
  #
  # This entry point will compile via the /usr/ prefix.
  # ======================================================================= #
  when :compile_in_traditional_manner
    require 'rbt/utility_scripts/compile_in_traditional_manner.rb'
    RBT::CompileInTraditionalManner.new(_)
  # ======================================================================= #
  # === :report_rbt_version
  # ======================================================================= #
  when :report_rbt_version
    require 'rbt/version/version.rb'
    RBT.report_rbt_version(_)
  # ======================================================================= #
  # === :rbt_version
  #
  # This action will simply return the current RBT-version, as a String,
  # such as '0.16.9'.
  # ======================================================================= #
  when :rbt_version
    require 'rbt/version/version.rb'
    return RBT.version?
  # ======================================================================= #
  # === :create_and_populate_pkgconfig_directory
  #
  # Commandline invocation example:
  #
  #   raction create_and_populate_pkgconfig_directory
  #
  # ======================================================================= #
  when :create_and_populate_pkgconfig_directory,
       :CreateAndPopulatePkgconfigDirectory,
       :consider_creating_and_populating_the_pkgconfig_directory,
       :ConsiderCreatingAndPopulatingThePkgconfigDirectory
    require 'rbt/misc/create_and_populate_pkgconfig_directory.rb'
    CreateAndPopulatePkgconfigDirectory.new(_)
  # ======================================================================= #
  # === :create_app_dir_skeleton
  #
  # This entry point must be similar to:
  #
  #   rcp htop-1.2
  #   rcp htop-1.2 --blank
  #   rcppwd
  #
  # Commandline invocation example:
  #
  #   raction create_app_dir_skeleton wesnoth-1.2.3
  #
  # ======================================================================= #
  when :create_app_dir_skeleton,
       :create_appdir_skeleton,
       :CreateAppDirSkeleton,
       :create_program_skeleton,
       :create_program,
       :CreateProgram,
       :appdir_skeleton,
       :rcp
    require 'rbt/actions/individual_actions/create_app_dir_skeleton/create_app_dir_skeleton.rb'
    RBT.create_app_dir_skeleton(_, &block)
  # ======================================================================= #
  # === :meson_appdir_prefix
  # ======================================================================= #
  when :meson_appdir_prefix,
       :MesonAppdirPrefix
    require 'rbt/toplevel_methods/meson.rb'
    RBT.meson_appdir_prefix
  # ======================================================================= #
  # === :change_tab_title
  #
  # This entry point can be used to rename a KDE konsole tab.
  # ======================================================================= #
  when :change_tab_title,
       :ChangeTabTitle,
       :consider_changing_the_tab_title,
       :ConsiderChangingTheTabTitle,
       :rename_konsole_tab,
       :rename_shell,
       :set_title,
       :consider_renaming_the_kde_konsole_tab
    require 'rbt/toplevel_methods/toplevel_methods.rb'
    RBT.consider_changing_the_tab_title(_, &block)
  # ======================================================================= #
  # === :cmake
  # ======================================================================= #
  when :cmake,
       :run_cmake
    require 'rbt/cmake/cmake.rb'
    RBT.cmake(_, &block)
  # ======================================================================= #
  # === :run_meson
  #
  # This entry point runs the whole meson-stack, aka "meson", "ninja"
  # and then "ninja install".
  # ======================================================================= #
  when :run_meson
    use_this_prefix = '/usr/'
    if _ and !_.empty?
      use_this_prefix = _
    end
    esystem 'meson --prefix='+use_this_prefix+' --libdir='+use_this_prefix+'/lib BUILD_DIRECTORY'
    cd('BUILD_DIRECTORY')
    esystem 'ninja'
    esystem 'ninja install'
  # ======================================================================= #
  # === :map_this_input_to_that_registered_program
  #
  # Usage examples from within a .rb file:
  #
  #   action(:map_this_input_to_that_registered_program, _)
  #   RBT.action(:map_this_input_to_that_registered_program, _)
  #
  # ======================================================================= #
  when :map_this_input_to_that_registered_program,
       :MapThisInputToThatRegisteredProgram
    require 'rbt/actions/individual_actions/map_this_input_to_that_registered_program/map_this_input_to_that_registered_program.rb'
    RBT::Action::MapThisInputToThatRegisteredProgram[_, &block] # This also is automatically { :be_quiet }
  # ======================================================================= #
  # === :check_for_available_versions
  #
  # Commandline usage example:
  #
  #   raction check_for_available_versions
  #
  # ======================================================================= #
  when :check_for_available_versions,
       :CheckForAvailableVersions
    require 'rbt/utility_scripts/check_for_available_versions.rb'
    RBT.check_for_available_versions(_, &block)
  # ======================================================================= #
  # === :cookbooks
  # ======================================================================= #
  when :cookbooks,
       :Cookbooks,
       :cookbook,
       :Cookbook,
       :sanitize_cookbook,
       :SanitizeCookbook,
       :sanitized_cookbook,
       :sanitize_data,
       :SanitizedData,
       :cookbook_for,
       :CookbookFor,
       :cookbook_dataset,
       :CookbookDataset
    require 'rbt/requires/require_the_cookbook_class.rb'
    RBT.sanitize_cookbook(_, options_hash, &block)
  # ======================================================================= #
  # === :save_the_available_programs_versions
  # ======================================================================= #
  when :save_the_available_programs_versions,
       :SaveTheAvailableProgramsVersions
    require 'rbt/utility_scripts/save_the_available_programs_versions.rb'
    RBT::SaveTheAvailableProgramsVersions.new
  # ======================================================================= #
  # === :backup_program
  # ======================================================================= #
  when :backup_program,
       :BackupProgram
    require 'rbt/utility_scripts/backup_program.rb'
    RBT.backup_program(_)
  # ======================================================================= #
  # === :software_manager
  #
  # This is the general action that can be used to install or otherwise
  # compile a program from its source code. The class that will handle
  # this step is RBT::Action::Installer. In other words, this entry point
  # can be used to compile a program.
  #
  # It is just about the most important entry point for RBT.actions()
  # in general.
  #
  # Usage examples:
  #
  #   RBT.action(:compile_program, 'gcc')
  #   RBT.action(:compile_program, :lfs1)
  #   RBT.action(:compile_program, :lfs2)
  #   RBT.action(:compile_program, :lfs3) { :use_sound }
  #   RBT.action(:installer, :lfs2)
  #   RBT.installer(:htop)
  #
  # Commandline usage examples:
  #
  #   raction software_manager lfs2
  #   raction installer lfs2
  #
  # ======================================================================= #
  when :software_manager,
       :SoftwareManager,
       :sm,
       :SM,
       :installer,
       :Installer,
       :install, # ← Not 100% sure about this alias here yet, but we'll see (February 2024)
       :compile_program,
       :compile
    require 'rbt/actions/individual_actions/software_manager/software_manager.rb'
    # ===================================================================== #
    # === Add support for "lfs1", "lfs2", "lfs3" as input here:
    # ===================================================================== #
    if _.is_a?(Array) and _.first.to_s.start_with?('lfs')
      _ = _.first.to_s
    end
    if _.to_s.start_with?('lfs') # Assume: :lfs1
      # =================================================================== #
      # Load the dataset from the file lfs_steps.yml next:
      # =================================================================== #
      dataset = YAML.load_file("#{project_yaml_directory?}lfs/lfs_steps.yml")
      _ = dataset[
        _.to_s.delete_prefix('lfs').to_i - 1
      ]
    end
    RBT.software_manager(_, &block)    
  # ======================================================================= #
  # === :registered_binaries
  #
  # This action will always return how many registered binaries are
  # available for the RBT project.
  #
  # Usage example from within ruby code:
  #
  #   action(:registered_binaries)
  #
  # ======================================================================= #
  when :registered_binaries,
       :RegisteredBinaries
    require 'rbt/registered/registered_binaries.rb'
    return RBT.registered_binaries?
  # ======================================================================= #
  # === :generate_homepage
  # ======================================================================= #
  when :generate_homepage,
       :GenerateHomepage
    require 'rbt/cookbooks/generate_homepage/generate_homepage.rb'
    RBT.generate_homepage(_)
  # ======================================================================= #
  # === :check_for_duplicate_binaries
  # ======================================================================= #
  when :check_for_duplicate_binaries,
       :CheckForDuplicateBinaries
    require 'rbt/utility_scripts/check_for_duplicate_binaries.rb'
    RBT::CheckForDuplicateBinaries.new(_, &block)
  # ======================================================================= #
  # === :disable_md5sum_calculation
  # ======================================================================= #
  when :disable_md5sum_calculation
    require 'rbt/requires/require_the_cookbook_class.rb'
    RBT::Action::Cookbooks::SanitizeCookbook.disable_md5sum_calculation # Cookbooks::Cookbook must provide this method.
  # ======================================================================= #
  # === :run_make_then_make_install
  # ======================================================================= #
  when :run_make_then_make_install
    require 'rbt/toplevel_methods/run_make_then_make_install.rb'
    RBT.run_make_then_make_install
  # ======================================================================= #
  # === :return_chained_programs
  # ======================================================================= #
  when :return_chained_programs,
       :ReturnChainedPrograms
    require 'rbt/constants/constants.rb'
    return RBT.return_chained_programs
  # ======================================================================= #
  # === :check_for_inclusion
  # ======================================================================= #
  when :check_for_inclusion,
       :CheckForInclusion
    require 'rbt/cookbooks/check_for_inclusion/check_for_inclusion.rb'
    RBT::Cookbooks::CheckForInclusion.new(_)
  # ======================================================================= #
  # === :cookbook_aliases
  # ======================================================================= #
  when :cookbook_aliases,
       :CookbookAliases,
       :cookbooks_aliases,
       :CookbooksAliases
    require 'rbt/aliases/aliases.rb'
    RBT.cookbook_aliases
  # ======================================================================= #
  # === :suggest_cookbook_for
  #
  # Usage example from within ruby code:
  #
  #   action(:suggest_cookbook_for, :htop)
  #
  # ======================================================================= #
  # bl $RBT/actions/individual_actions/cookbooks/suggest_cookbook_for/suggest_cookbook_for.rb
  # ======================================================================= #
  when :suggest_cookbook_for
    require 'rbt/actions/individual_actions/cookbooks/suggest_cookbook_for/suggest_cookbook_for.rb'
    RBT.suggest_cookbook_for(_, &block)
  # ======================================================================= #
  # === :symlink_into_the_usr_bin_hierarchy
  #
  # Symlink the given Array into the /usr/bin/ hierarchy. Optionally a
  # directory can be given as main input.
  #
  # Invocation example:
  #
  #   RBT.action(:symlink_into_the_usr_bin_hierarchy, :ninja)
  #
  # ======================================================================= #
  when :symlink_into_the_usr_bin_hierarchy
    require 'rbt/utility_scripts/symlink_into_the_usr_bin_hierarchy.rb'
    RBT::SymlinkIntoTheUsrBinHierarchy.new(_, &block)
  # ======================================================================= #
  # === :to_current
  #
  # You can pass the program name and program version into this entry
  # point. Passing the full path is also possible.
  #
  # Usage example:
  #
  #   RBT.action(:to_current, 'htop-1.2')
  #
  # ======================================================================= #
  when :to_current,
       :ToCurrent
    require 'rbt/actions/individual_actions/to_current/to_current.rb'
    RBT.to_current(_, &block)
  # ======================================================================= #
  # === :symlink_from_to_current
  #
  # Usage example from within ruby files:
  #
  #   action(:symlink_from_to_current, _)
  #
  # ======================================================================= #
  when :symlink_from_to_current,
       :SymlinkFromToCurrent,
       :symlink_this_appdir,
       :SymlinkThisAppdir
    require 'rbt/utility_scripts/symlink_from_to_current/symlink_from_to_current.rb'
    RBT::SymlinkFromToCurrent.new(_)
  # ======================================================================= #
  # === :force
  #
  # This variant forcues the symlink-action.
  # ======================================================================= #
  when :force,
       :symlink_from_to_current2,
       :SymlinkFromToCurrent2
    require 'rbt/utility_scripts/symlink_from_to_current/symlink_from_to_current.rb'
    _ = RBT::SymlinkFromToCurrent.new(_, :do_not_run_yet)
    _.do_force_symlink
    _.run
  # ======================================================================= #
  # === :infobox_for
  # ======================================================================= #
  when :infobox_for,
       :InfoboxFor,
       :infobox,
       :Infobox,
       :flexbox,
       :Flexbox
    begin # Try to pull in the sexy flexbox.
      require 'ascii_paradise/requires/require_flexbox.rb'
      AsciiParadise::Flexbox.new(_, &block)
    rescue LoadError
      :flexbox_is_not_available
    end
  # ======================================================================= #
  # === :ensure_that_the_log_directory_exists
  #
  # Usage example:
  #
  #   action(:ensure_that_the_log_directory_exists)
  #
  # ======================================================================= #
  when :ensure_that_the_log_directory_exists
    _ = log_directory?
    mkdir(_) unless File.directory? _
  # ======================================================================= #
  # === :generate_version_file
  #
  # Usage example:
  #
  #   action(:generate_version_file)
  #
  # ======================================================================= #
  when :generate_version_file,
       :GenerateVersionFile
    require 'rbt/toplevel_methods/generate_programs_version_yaml_file.rb'
    RBT.generate_programs_version_yaml_file
  # ======================================================================= #
  # === :test_this_alias
  # ======================================================================= #
  when :test_this_alias,
       :rbt_test_alias
    require 'rbt/toplevel_methods/available_programs.rb'
    require 'rbt/aliases/aliases.rb'
    RBT.test_this_alias(_)
  # ======================================================================= #
  # === :return_appdir_prefix
  #
  # Usage example:
  #
  #   action(:return_appdir_prefix, 'htop')
  #
  # ======================================================================= #
  when :return_appdir_prefix,
       :appdir_prefix
    RBT.return_appdir_prefix(_)
  # ======================================================================= #
  # === :determine_appdir_prefix_from_this_input
  #
  # Usage example:
  #
  #   RBT.installer(:determine_appdir_prefix_from_this_input)
  #
  # ======================================================================= #
  when :determine_appdir_prefix_from_this_input
    RBT.determine_appdir_prefix_from_this_input(_)
  # ======================================================================= #
  # === :extract
  #
  # This entry point allows the user to extract an archive.
  #
  # It is a special entry point, because it can also handle pseudo
  # symbols, such as in the following case:
  #
  #   RBT.action(:extract, ':htop') { :be_silent }
  #
  # This will take htop from its default position on the local filesystem.
  #
  # Usage example:
  #
  #   RBT.action(:extract, '/home/x/src/htop/htop-3.1.2.tar.xz', extract_to: '/Depot/jjjj/')
  #    
  # Commandline invocation example:
  #
  #   raction mate_desktop
  #
  # ======================================================================= #
  when :extract,
       :Extract,
       :action_extracter,
       :extract_what_to
    require 'rbt/actions/individual_actions/extract/extract.rb'
    extract_to = options_hash[:extract_to] if options_hash.is_a?(Hash)
    unless _.is_a?(Symbol)
      _ = _.to_s
    end
    if extract_to.nil?
      extract_to = RBT.log_directory?
    end
    RBT.extract(_, extract_to, &block)
  # ======================================================================= #
  # === :program_version
  #
  # This entry point will specifically make use of
  # ProgramInformation.program_version? to find out the program-version
  # from a given String.
  #
  # Commandline usage example:
  #
  #   raction program_version gtkmm-3.24.7
  #
  # ======================================================================= #
  when :program_version,
       :ProgramVersion
    require 'program_information'
    return ProgramInformation.program_version?(_, &block)
  # ======================================================================= #
  # === :program_name
  #
  # This entry point will specifically make use of
  # ProgramInformation.program_name? to find out the program-name from
  # a given String.
  #
  # Commandline usage example:
  #
  #   raction program_name gtkmm-3.24.7
  #
  # ======================================================================= #
  when :program_name,
       :ProgramName
    require 'program_information'
    return ProgramInformation.program_name?(_, &block)
  # ======================================================================= #
  # === :increment_program_version
  #
  # Commandline usage example:
  #
  #   raction increment_program_version
  #
  # ======================================================================= #
  when :increment_program_version,
       :IncrementProgramVersion,
       :increment,
       :Increment
    require 'rbt/utility_scripts/increment_program_version/increment_program_version.rb'
    RBT.increment_program_version
  # ======================================================================= #
  # === report_mate_desktop_version
  #
  # Commandline invocation example:
  #
  #   raction mate_desktop
  #
  # ======================================================================= #
  when :report_mate_desktop_version,
       :report_the_mate_desktop_version,
       :report_mate_desktop,
       :mate_desktop_version,
       :mate_version,
       :mate_desktop,
       :mate?
    require 'rbt/actions/individual_actions/information/report_mate_desktop_version.rb'
    RBT.report_mate_desktop_version
  # ======================================================================= #
  # === :create_program_version_url_file
  #
  # Usage example:
  #
  #   RBT.action(:CreateProgramVersionUrlFile, :ruby)
  #
  # Commandline invocation example:
  #
  #   raction create_program_version_url_file
  #
  # ======================================================================= #
  when :create_program_version_url_file,
       :CreateProgramVersionUrlFile,
       :program_version_url_file
    require 'rbt/actions/individual_actions/information/create_program_version_url_file.rb'
    RBT.create_program_version_url_file(_)
  # ======================================================================= #
  # === :compile_the_python_addons
  # ======================================================================= #
  when :compile_the_python_addons
    require 'rbt/requires/require_the_installer_class.rb'
    compile_object = RBT::Action::Installer.new { :dont_run_yet }
    compile_object.compile_the_python_addons
    compile_object.do_initiate_batch_compilation
  # ======================================================================= #
  # === :gitty
  # ======================================================================= #
  when :gitty,
       :Gitty
    require 'rbt/utility_scripts/gitty.rb'
    RBT.gitty(_)
  # ======================================================================= #
  # === :simple_appdir_configure
  #
  #   bl $RBT/actions/individual_actions/simple_appdir_configure/simple_appdir_configure.rb
  #
  # ======================================================================= #
  when :simple_appdir_configure,
       :SimpleAppdirConfigure
    require 'rbt/actions/individual_actions/simple_appdir_configure/simple_appdir_configure.rb'
    RBT.simple_appdir_configure(_)
  # ======================================================================= #
  # === :file_ldd_dataset
  # ======================================================================= #
  when :file_ldd_dataset,
       :ldd_file
    require 'rbt/utility_scripts/simplified_ldd_output.rb'
    RBT.file_ldd_dataset?
  # ======================================================================= #
  # === :ldd_dataset
  #
  # Usage example:
  #
  #   dataset = RBT.action(:ldd_dataset)
  #
  # ======================================================================= #
  when :ldd_dataset,
       :LddDataset
    require 'rbt/utility_scripts/simplified_ldd_output.rb'
    RBT.ldd_dataset?
  # ======================================================================= #
  # === :create_ldd_dataset
  #
  # This will create a new ldd-dependencies file, containing all
  # local libraries.
  #
  # Commandline invocation example:
  #
  #   rbt_action create_ldd_dataset
  #
  # ======================================================================= #
  when :create_ldd_dataset,
       :create_dependencies_of_libraries_file,
       :CreateDependenciesOfLibrariesFile
    require 'rbt/utility_scripts/simplified_ldd_output.rb'
    RBT.create_ldd_dataset
  # ======================================================================= #
  # === :show_configuration_options
  #
  # This entry point allows the user to query the configuration
  # options used by a given program. On my home computer I have
  # aliased this to "sco", so I can just do "sco gcc" to query
  # the configuration options used by gcc.
  # ======================================================================= #
  when :show_configuration_options,
       :ShowConfigurationOptions,
       :sco
    require 'rbt/requires/require_show_configuration_options.rb'
    RBT.show_configuration_options(_, &block)
  # ======================================================================= #
  # === :scan_for_blfs_programs
  #
  # Commandline invocation example:
  #
  #   raction scan_for_blfs_programs
  #
  # ======================================================================= #
  when :scan_for_blfs_programs,
       :ScanForBlfsPrograms,
       :missing_blfs,
       :MissingBlfs
    require 'rbt/actions/individual_actions/cookbooks/scan_for_blfs_programs/scan_for_blfs_programs.rb'
    RBT.scan_for_blfs_programs
  # ======================================================================= #
  # === :return_blfs
  #
  # This variant, although a slight misnomer, is for commandline use.
  #
  # It will simply print the BLFS of the program at hand.
  #
  # Commandline invocation example:
  #
  #   rbt_action return_blfs
  #
  # ======================================================================= #
  when :return_blfs
    require 'rbt/actions/individual_actions/cookbooks/blfs/blfs.rb' # bl $RBT/actions/individual_actions/cookbooks/blfs/blfs.rb
    e RBT.return_blfs_page_of_this_program(_, &block)
  # ======================================================================= #
  # === :copy_these_archives
  # ======================================================================= #
  when :copy_these_archives,
       :CopyTheseArchives,
       :copy,
       :Copy
    require 'rbt/utility_scripts/copy_these_archives.rb'
    RBT.copy_these_archives(_)
  # ======================================================================= #
  # === :not_found_libraries
  #
  # This entry point allows the user to show libraries that are missing,
  # aka "not found libraries".
  # ======================================================================= #
  when :not_found_libraries,
       :NotFoundLibraries
    require 'rbt/utility_scripts/not_found_libraries.rb'
    RBT.not_found_libraries
  # ======================================================================= #
  # === :remove_empty_directories
  #
  # Commandline usage example:
  #
  #   raction remove_empty_directories
  #
  # ======================================================================= #
  when :remove_empty_directories,
       :RemoveEmptyDirectories
    require 'rbt/utility_scripts/remove_empty_directories.rb'
    RBT.remove_empty_directories(_)
  # ======================================================================= #
  # === :chain_compile
  #
  # Invocation example:
  #
  #   raction chain_compile kde5_plasma
  #
  # ======================================================================= #
  when :chain_compile,
       :ChainCompile
    require 'rbt/utility_scripts/chain_compile.rb'
    RBT.chain_compile(_, &block)
  # ======================================================================= #
  # === :show_compile_chain
  #
  # Invocation example:
  #
  #   raction show_compile_chain kde5_plasma
  #
  # ======================================================================= #
  when :show_compile_chain,
       :ShowCompileChain,
       :display_compile_chain,
       :DisplayCompileChain,
       :show_compile_chain_of,
       :ShowCompileChainOf
    require 'rbt/actions/individual_actions/show_compile_chain/show_compile_chain.rb'
    RBT.show_compile_chain(_)
  # ======================================================================= #
  # === :download_all_source_archives
  # ======================================================================= #
  when :download_all_source_archives,
       :DownloadAllSourceArchives,
       :obtain_source_archives,
       :ObtainSourceArchives,
       :batch_download_all_source_archives,
       :BatchDownloadAllSourceArchives
    require 'rbt/cookbooks/download_all_source_archives/download_all_source_archives.rb'
    RBT::Cookbooks::DownloadAllSourceArchives.new(_)
  # ======================================================================= #
  # === :batch_validate_the_cookbook_recipes
  # ======================================================================= #
  when :batch_validate_the_cookbook_recipes,
       :BatchValidateTheCookbookRecipes,
       :validate_entries,
       :ValidateEntries
    require 'rbt/checks_and_validations/batch_validate_the_cookbook_recipes.rb'
    RBT.validate_entries
  # ======================================================================= #
  # === :homepage
  # ======================================================================= #
  when :homepage,
       :report_the_homepage,
       :report_homepage
    require 'rbt/cookbooks/homepage/homepage.rb'
    RBT.homepage(_)
  # ======================================================================= #
  # === :update_available_programs
  #
  # Commandline usage example:
  #
  #   raction update_available_programs
  #
  # ======================================================================= #
  when :update_available_programs,
       :UpdateAvailablePrograms,
       :save_available_programs,
       :SaveAvailablePrograms
    require 'rbt/toplevel_methods/available_programs.rb'
    RBT.store_available_programs_into_a_yaml_file
  # ======================================================================= #
  # === :url1
  #
  # This will display the url1 content on the commandline.
  #
  # Commandline invocation example:
  #
  #   raction url1 openssl
  #   raction url1 cairo
  #   raction url1 pango
  #   raction url1 sdl2
  #   raction url1 sdl2image
  #   raction url1 sdl2mixer
  #
  # ======================================================================= #
  when :url1
    result = action(:SanitizeCookbook, _, &block)
    e result.url?
  # ======================================================================= #
  # === :url2
  #
  # This will display the url2 content on the commandline.
  #
  # Commandline invocation example:
  #
  #   raction url2 ruby 
  #
  # ======================================================================= #
  when :url2
    result = action(:SanitizeCookbook, _, &block)
    e result.url2?
  # ======================================================================= #
  # === :return_blfs_page_of_this_program
  #
  # Usage examples:
  #
  #   RBT.action(:blfs, 'glibc')
  #   action(:blfs, 'abc') { :def }
  #   action(:return_blfs_page_of_this_program, 'abc') { :def }
  #
  # Commandline invocation example:
  #
  #   rbt_action return_blfs_page_of_this_program htop
  #
  # ======================================================================= #
  when :return_blfs_page_of_this_program,
       :return_blfs_entry_for,
       :blfs_page_of_this_program,
       :blfs_page,
       :report_all_blfs_entries
    require 'rbt/actions/individual_actions/cookbooks/blfs/blfs.rb'
    RBT.return_blfs_page_of_this_program(_, &block)
  # ======================================================================= #
  # === :blfs_instance
  #
  # This will return an instance of class BLFS.
  #
  # Usage example:
  #
  #   action(:blfs_instance, 'abc') { :def }
  #
  # ======================================================================= #
  when :blfs_instance,
       :BlfsInstance,
       :blfs,
       :Blfs
    require 'rbt/actions/individual_actions/cookbooks/blfs/blfs.rb'
    RBT.blfs_instance(_, &block)
  # ======================================================================= #
  # === :validate_blfs_entries
  #
  # Commandline usage example:
  #
  #   raction validate_blfs_entries
  #
  # ======================================================================= #
  when :validate_blfs_entries
    require 'rbt/checks_and_validations/validate_blfs_entries.rb'
    RBT.validate_blfs_entries
  # ======================================================================= #
  # === :paste_blfs
  # ======================================================================= #
  when :paste_blfs
    require 'rbt/requires/require_the_installer_class.rb'
    _ = RBT::Action::Installer.new(_, :do_not_run_yet) 
    _.try_to_show_the_BLFS_content_of_this_program(_)
  # ======================================================================= #
  # === :cleanup_system_tags
  #
  # Usage example:
  #
  #   action(:CleanupSystemTags) { :be_quiet }
  #
  # ======================================================================= #
  when :cleanup_system_tags,
       :CleanupSystemTags
    require 'rbt/utility_scripts/cleanup_system_tags.rb'
    RBT::CleanupSystemTags.new(_, &block)
  # ======================================================================= #
  # === :allowed_cookbook_entries
  # ======================================================================= #
  when :allowed_cookbook_entries,
       :AllowedCookbookEntries
    require 'rbt/checks_and_validations/allowed_cookbook_entries.rb'
    RBT::Cookbooks::AllowedCookbookEntries.new
  # ======================================================================= #
  # === :static_overview_of_the_available_binaries_on_this_computer_system
  # ======================================================================= #
  when :static_overview_of_the_available_binaries_on_this_computer_system,
       :StaticOverviewOfTheAvailableBinariesOnThisComputerSystem
    require 'rbt/utility_scripts/static_overview_of_the_available_binaries_on_this_computer_system.rb'
    RBT.static_overview_of_the_available_binaries_on_this_computer_system
  # ======================================================================= #
  # === :validate_cookbook_aliases
  #
  # Usage example:
  #
  #   RBT.action(:validate_cookbook_aliases)
  #
  # Commandline usage example:
  #
  #   raction validate_cookbook_aliases
  #
  # ======================================================================= #
  when :validate_cookbook_aliases,
       :ValidateCookbookAliases,
       :validate_the_cookbook_aliases,
       :ValidateTheCookbookAliases
    require 'rbt/checks_and_validations/validate_cookbook_aliases.rb'
    RBT.validate_cookbook_aliases
  # ======================================================================= #
  # === :expand_cookbooks
  #
  # Commandline invocation example:
  #
  #   raction expand_cookbooks
  #
  # ======================================================================= #
  when :expand_cookbooks,
       :ExpandCookbooks,
       :expand,
       :EXPAND,
       :expand_this_cookbook,
       :ExpandThisCookbook
    require 'rbt/actions/individual_actions/cookbooks/expand_cookbooks/expand_cookbooks.rb'
    RBT.expand_cookbooks(_)
  # ======================================================================= #
  # === :show_last_updated
  #
  # Usage example:
  #
  #   action(:ShowLastUpdated)
  #
  # Commandline usage example:
  #
  #   raction show_last_updated
  #
  # ======================================================================= #
  when :show_last_updated,
       :ShowLastUpdated
    require 'rbt/cookbooks/show_last_updated.rb'
    RBT.show_last_updated(_)
  # ======================================================================= #
  # === :purge_incorrect_yaml_directories_in_the_programs_hierarchy
  #
  # Commandline usage example:
  #
  #   raction purge_incorrect_yaml_directories_in_the_programs_hierarchy
  #
  # ======================================================================= #
  when :purge_incorrect_yaml_directories_in_the_programs_hierarchy,
       :PurgeIncorrectYamlDirectoriesInTheProgramsHierarchy
    require 'rbt/utility_scripts/purge_incorrect_yaml_directories_in_the_programs_hierarchy.rb'
    RBT::PurgeIncorrectYamlDirectoriesInTheProgramsHierarchy.new(_, &block)
  # ======================================================================= #
  # === :binary_name_belongs_to_which_program
  # ======================================================================= #
  when :binary_name_belongs_to_which_program,
       :BinaryNameBelongsToWhichProgram
    require 'rbt/utility_scripts/binary_name_belongs_to_which_program.rb'
    RBT::BinaryNameBelongsToWhichProgram.new(_, &block)
  # ======================================================================= #
  # === :check_for_gnome_updates
  # ======================================================================= #
  when :check_for_gnome_updates,
       :CheckForGnomeUpdates
    require 'rbt/check_for_updates/check_for_gnome_updates.rb'
    RBT::Cookbooks::CheckForGnomeUpdates.new(_, &block)
  # ======================================================================= #
  # === :register_program_files_into_yaml_database
  # ======================================================================= #
  when :register_program_files_into_yaml_database,
       :RegisterProgramFilesIntoYamlDatabase
    require 'rbt/utility_scripts/register_program_files_into_yaml_database.rb'
    RBT.register_program_files_into_yaml_database(_, &block)
  # ======================================================================= #
  # === :colour_make_install
  # ======================================================================= #
  when :colour_make_install,
       :ColourMakeInstall
    require 'rbt/make/colour_make_install.rb'
    RBT.colour_make_install(_)
  # ======================================================================= #
  # === :filter_for_valid_program_names
  #
  # Here we will modify e. g. "htop.yml" towards "htop" or "hto" towards
  # "htop".
  # ======================================================================= #
  when :filter_for_valid_program_names,
       :main_filter,
       :sanitize_this_program_name
    require 'rbt/actions/individual_actions/filter_for_valid_program_names/filter_for_valid_program_names.rb'
    return RBT.filter_for_valid_program_names(_)
  # ======================================================================= #
  # === :show_how_many_files_are_tracked
  #
  # Invocation example from the commandline:
  #
  #   raction show_how_many_files_are_tracked
  #
  # ======================================================================= #
  when :show_how_many_files_are_tracked,
       :ShowHowManyFilesAreTracked
    require 'rbt/actions/individual_actions/statistics/show_how_many_files_are_tracked.rb'
    RBT.show_how_many_files_are_tracked
  # ======================================================================= #
  # === :compile_strategies
  #
  # Invocation example from the commandline:
  #
  #   raction compile_strategies
  #
  # ======================================================================= #
  when :compile_strategies,
       :CompileStrategies,
       :report_the_compile_strategies,
       :ReportTheCompileStrategies
    require 'rbt/actions/individual_actions/statistics/compile_strategies.rb'
    RBT.report_the_compile_strategies
  # ======================================================================= #
  # === :show_compile_time_statistics
  #
  # Invocation example from the commandline:
  #
  #   raction show_compile_time_statistics
  #
  # ======================================================================= #
  when :show_compile_time_statistics,
       :ShowCompileTimeStatistics
    require 'rbt/actions/individual_actions/statistics/show_compile_time_statistics.rb'
    RBT.show_compile_time_statistics
  # ======================================================================= #
  # === :return_compile_time_statistics
  #
  # Commandline usage example:
  #
  #   raction return_compile_time_statistics
  #
  # ======================================================================= #
  when :return_compile_time_statistics,
       :ReturnCompileTimeStatistics
    require 'rbt/actions/individual_actions/statistics/return_compile_time_statistics.rb'
    pp RBT.return_compile_time_statistics
  # ======================================================================= #
  # === :apply_sed_operations
  # ======================================================================= #
  when :apply_sed_operations,
       :ApplySedOperations
    require 'rbt/utility_scripts/apply_sed_operations.rb'
    RBT.apply_sed_operations(_)
  # ======================================================================= #
  # === :local_check_for_latest
  #
  # Commandline usage example:
  #
  #   raction local_check_for_latest
  #
  # ======================================================================= #
  when :local_check_for_latest,
       :LocalCheckForLatest
    require 'rbt/cookbooks/local_check_for_latest/local_check_for_latest.rb'
    RBT.local_check_for_latest
  # ======================================================================= #
  # === :update_entry
  # ======================================================================= #
  when :update_entry,
       :UpdateEntry
    require 'rbt/requires/require_class_update_entry.rb'
    RBT::UpdateEntry.new(_, &block)
  # ======================================================================= #
  # === :remove_program
  # ======================================================================= #
  when :remove_program,
       :RemoveProgram
    require 'rbt/utility_scripts/remove_program.rb'
    RBT.remove_program(_)
  # ======================================================================= #
  # === :remove_programs
  #
  # This is the plurarl form.
  # ======================================================================= #
  when :remove_programs,
       :RemovePrograms
    require 'rbt/utility_scripts/remove_programs/remove_programs.rb'
    RBT.remove_programs
  # ======================================================================= #
  # === :return_xfce_version
  # ======================================================================= #
  when :return_xfce_version
    require 'rbt/toplevel_methods/try_to_return_a_special_compile_component.rb'
  # ======================================================================= #
  # === :report_xfce_version
  #
  # Commandline invocation example:
  #
  #   raction xfce_version
  #   raction xfce?
  #
  # ======================================================================= #
  when :report_xfce_version,
       :xfce_version,
       :xfce?
    require 'rbt/actions/individual_actions/information/report_xfce_version.rb'
    RBT.report_xfce_version
  # ======================================================================= #
  # === :highest
  #
  # Usage example:
  #
  #   action(:highest)
  #
  # Commandline invocation example:
  #
  #   raction highest 55
  #
  # ======================================================================= #
  when :highest
    require 'rbt/actions/individual_actions/information/highest.rb'
    RBT.highest(_)
  # ======================================================================= #
  # === :create_dependencies_file
  #
  # This entry point is specifically for GoboLinux, allowing the user
  # to create a dependencies file.
  # ======================================================================= #
  when :create_dependencies_file,
       :CreateDependenciesFile
    require 'rbt/linux/gobolinux/create_dependencies_file.rb'
    create_dependencies_file = RBT::Linux::Gobolinux::CreateDependenciesFile.new(
      _[0], 
      _[1],
      :dont_run_yet
    )
    create_dependencies_file.allow_creation_of_resources
    create_dependencies_file.run # Finally, run it.
  # ======================================================================= #
  # === :show_dependencies_of
  # ======================================================================= #
  when :show_dependencies_of
    require 'rbt/cookbooks/show_dependencies_of.rb'
    RBT.show_dependencies_of(_)
  # ======================================================================= #
  # === :update_kde_porting_aids
  # ======================================================================= #
  when :update_kde_porting_aids,
       :UpdateKdePortingAids
    require 'rbt/check_for_updates/update_kde_porting_aids.rb'
    RBT.update_kde_porting_aids
  # ======================================================================= #
  # === :update_kde_apps
  # ======================================================================= #
  when :update_kde_apps,
       :UpdateKdeApps,
       :update_kde_application,
       :UpdateKdeApplication,
       :update_kde_applications,
       :UpdateKdeApplications
    require 'rbt/check_for_updates/update_kde_applications.rb'
    RBT.update_kde_applications
  # ======================================================================= #
  # === :update_kde_framework
  # ======================================================================= #
  when :update_kde_framework
    require 'rbt/check_for_updates/update_kde_framework.rb'
    RBT.update_kde_framework
  # ======================================================================= #
  # === :update_all_ruby_gems
  # ======================================================================= #
  when :update_all_ruby_gems,
       :check_for_new_release_on_rubygems,
       :check_for_new_releases_on_rubygems
    require 'rbt/check_for_updates/check_for_new_release_on_rubygems.rb'
    RBT.update_all_ruby_gems
  # ======================================================================= #
  # === :check_for_existing_source_directories
  # ======================================================================= #
  when :check_for_existing_source_directories,
       :CheckForExistingSourceDirectories
    require 'rbt/cookbooks/check_for_existing_source_directories.rb'
    RBT.check_if_source_directories_exist
  # ======================================================================= #
  # === :try_to_return_a_special_compile_component
  #
  #   rbt_action try_to_return_a_special_compile_component
  #
  # ======================================================================= #
  when :try_to_return_a_special_compile_component,
       :TryToReturnASpecialCompileComponent
    require 'rbt/toplevel_methods/try_to_return_a_special_compile_component.rb'
    RBT.try_to_return_a_special_compile_component(_)
  # ======================================================================= #
  # === :generate_shell_completion
  # ======================================================================= #
  when :generate_shell_completion,
       :GenerateShellCompletion
    require 'rbt/generate_files/generate_shell_completion.rb'
    RBT.generate_shell_completion(_)
  # ======================================================================= #
  # === :symlink_all_upcased_programs_to_downcased_variants
  # ======================================================================= #
  when :symlink_all_upcased_programs_to_downcased_variants,
       :SymlinkAllUpcasedProgramsToDowncasedVariants
    require 'rbt/utility_scripts/symlink_all_upcased_programs_to_downcased_variants.rb'
    RBT::SymlinkAllUpcasedProgramsToDowncasedVariants.new
  # ======================================================================= #
  # === :package_rbt_scripts
  # ======================================================================= #
  when :package_rbt_scripts,
       :PackageRbtScripts
    require 'rbt/utility_scripts/package_rbt_scripts.rb'
    RBT::PackageRbtScripts.new
  # ======================================================================= #
  # === :sed_wrapper
  # ======================================================================= #
  when :sed_wrapper,
       :SedWrapper
    require 'rbt/actions/individual_actions/sed_wrapper/sed_wrapper.rb'
    RBT.sed_wrapper(_)
  # ======================================================================= #
  # === :report_how_many_binaries_are_registered
  #
  # Commandline invocation example:
  #
  #   raction report_how_many_binaries_are_registered
  #
  # ======================================================================= #
  when :report_how_many_binaries_are_registered
    require 'rbt/toplevel_methods/report_how_many_binaries_are_registered.rb'
    RBT.report_how_many_binaries_are_registered
  # ======================================================================= #
  # === :search_for_tags
  # ======================================================================= #
  when :search_for_tags,
       :SearchForTags,
       :stag
    require 'rbt/requires/require_search_for_tags.rb'
    RBT.search_for_tags(_)
  # ======================================================================= #
  # === :remove_all_symlinks
  # ======================================================================= #
  when :remove_all_symlinks,
       :RemoveAllSymlinks
    require 'rbt/utility_scripts/remove_all_symlinks.rb'
    RemoveAllSymlinks.new
  # ======================================================================= #
  # === :url_new
  # ======================================================================= #
  when :url_new
    require 'rbt/cookbooks/url/url.rb'
    RBT::Cookbooks::Url.new(_)
  # ======================================================================= #
  # === :url
  # ======================================================================= #
  when :url
    require 'rbt/cookbooks/url/url.rb'
    RBT.return_url1_of_this_program(_)
  # ======================================================================= #
  # === :create_shell_script_containing_these_program_versions
  # ======================================================================= #
  when :create_shell_script_containing_these_program_versions,
       :generate_a_big_shell_script
    require 'rbt/shell/create_shell_script_containing_these_program_versions.rb'
    RBT.create_shell_script_containing_these_program_versions
  # ======================================================================= #
  # === :create_shell_scripts
  # ======================================================================= #
  when :create_shell_scripts,
       :create_bash_scripts,
       :to_bash,
       :CreateBashScripts
    require 'rbt/generate_files/create_bash_scripts.rb'
    RBT::CreateBashScripts.new # bl $RBT/create_bash_scripts.rb
  # ======================================================================= #
  # === :register_everything
  #
  # Commandline invocation example:
  #
  #   raction register_everything
  #
  # ======================================================================= #
  when :register_everything,
       :RegisterEverything
    require 'rbt/registered/register_everything.rb'
    RBT.register_everything
  # ======================================================================= #
  # === :show_all_about
  #
  # Usage example:
  #
  #   RBT.action(:show_all_about, 'ruby')
  #
  # Commandline invocation example:
  #
  #   raction show_all_about ruby
  #
  # ======================================================================= #
  when :show_all_about,
       :ShowAllAbout
    require 'rbt/actions/individual_actions/information/show_all_about.rb'
    RBT.show_all_about(_)
  # ======================================================================= #
  # === :remove_libtool_files
  #
  # Invocation example:
  #
  #   raction remove_libtool_files kde5_plasma
  #
  # ======================================================================= #
  when :remove_libtool_files,
       :delete_libtool_files
    require 'rbt/libtool/remove_libtool_files/remove_libtool_files.rb'
    RBT.remove_libtool_files(_)
  # ======================================================================= #
  # === :expanded_cookbooks
  #
  # raction expanded_cookbooks htop
  #
  # ======================================================================= #
  when :expanded_cookbooks,
       :ExpandedCookbooks,
       :expanded
    require 'rbt/actions/individual_actions/cookbooks/expanded_cookbook/expanded_cookbook.rb'
    pp RBT.expanded_cookbook(_).dataset?
  # ======================================================================= #
  # === :aggregate_information_from_the_expanded_cookbooks
  #
  # Commandline invocation example:
  #
  #   raction aggregate
  #
  # ======================================================================= #
  when :aggregate_information_from_the_expanded_cookbooks,
       :aggregate
    require 'rbt/actions/individual_actions/information/aggregate_information_from_the_expanded_cookbooks.rb'
    RBT.aggregate_information_from_the_expanded_cookbooks(_)
  # ======================================================================= #
  # === :scan_source_archive
  # ======================================================================= #
  when :scan_source_archive,
       :ScanSourceArchive
    require 'rbt/cookbooks/scan_source_archive/scan_source_archive.rb'
    RBT.scan_source_archive      
  # ======================================================================= #
  # === :report_the_registered_programs
  #
  # Invocation example from the commandline:
  #
  #   raction report_the_registered_programs
  #
  # ======================================================================= #
  when :report_the_registered_programs,
       :ReportTheRegisteredPrograms
    require 'rbt/utility_scripts/report_the_registered_programs.rb'
    RBT.report_the_registered_programs
  # ======================================================================= #
  # === :feedback_licenses
  #
  # Commandline usage example:
  #
  #   raction feedback_licenses
  #
  # ======================================================================= #
  when :feedback_licenses,
       :feedback_licences,
       :FeedbackLicenses,
       :FeedbackLicences
    require 'rbt/cookbooks/feedback_licenses.rb'
    RBT.feedback_licenses(_) # bl $RUBY_COOKBOOKS/lib/cookbooks/feedback_licenses.rb
  # ======================================================================= #
  # === :scan_for_missing_last_update_entries
  # ======================================================================= #
  when :scan_for_missing_last_update_entries,
       :missing_last_update_entries
    require 'rbt/checks_and_validations/scan_for_missing_last_update_entries.rb:class'
    RBT::Cookbooks::ScanForMissingLastUpdateEntries.new
  # ======================================================================= #
  # === check_for_mate_desktop_updates
  #
  # Commandline invocation example:
  #
  #   raction check_for_mate_desktop_updates
  #
  # ======================================================================= #
  when :check_for_mate_desktop_updates,
       :CheckForMateDesktopUpdates,
       :mate_updates
    require 'rbt/check_for_updates/check_for_mate_desktop_updates.rb'
    RBT.check_for_mate_desktop_updates
  # ======================================================================= #
  # === :show_all_statistics
  #
  # Usage example:
  #
  #   RBT.action(:show_all_statistics)
  #
  # Commandline invocation example:
  #
  #   raction show_all_statistics
  #
  # ======================================================================= #
  when :show_all_statistics,
       :ShowAllStatistics,
       :show_statistics,
       :ShowStatistics
    require 'rbt/actions/individual_actions/statistics/show_all_statistics.rb'
    RBT.show_all_statistics
  # ======================================================================= #
  # === :display_barplot_statistics
  #
  # Usage example:
  #
  #   action(:display_barplot_statistics)
  #
  # Invocation example from the commandline:
  #
  #   raction display_barplot_statistics
  #
  # ======================================================================= #
  when :display_barplot_statistics
    require 'rbt/actions/individual_actions/statistics/display_barplot_statistics.rb'
    RBT.display_barplot_statistics
  # ======================================================================= #
  # === :uninstall
  # ======================================================================= #
  when :uninstall
    require 'rbt/utility_scripts/uninstall.rb'
    RBT.uninstall(_)
  # ======================================================================= #
  # === :what_could_become_an_app_dir
  # ======================================================================= #
  when :what_could_become_an_app_dir
    require 'rbt/utility_scripts/what_could_become_an_app_dir.rb'
    RBT.what_could_become_an_app_dir
  # ======================================================================= #
  # === :run_configure
  #
  # Usage example:
  #
  #   RBT.action(:run_configure, :htop)
  #
  # ======================================================================= #
  when :run_configure,
       :configure
    require 'rbt/actions/individual_actions/configure/configure.rb'
    RBT::Actions::Configure.new(_)
  # ======================================================================= #
  # === :run_configure
  #
  # This will really just run "./configure" basically.
  #
  # Usage example:
  #
  #   RBT.installer(:htop)
  #
  # ======================================================================= #
  when :simple_run_configure,
       :simple_configure
    yielded = nil
    if block_given?
      yielded = yield
    end
    cmd = "./configure #{_}"
    case yielded
    # ===================================================================== #
    # === :colourize_and_padded
    # ===================================================================== #
    when :colourize_and_padded,
         :colourized_and_padded
      e
      e steelblue(cmd)
      e
      system cmd
    # ===================================================================== #
    # === :colourized
    # ===================================================================== #
    when :colourized,
         :colourize
      e steelblue(cmd)
      system cmd
    else # else without colours.
      esystem cmd
    end
  # ======================================================================= #
  # === :all_urls
  # ======================================================================= #
  when :all_urls,
       :all_URLs
    require 'rbt/cookbooks/all_urls/all_urls.rb'
    RBT.all_urls(_)
  # ======================================================================= #
  # === :create_registered_tags
  #
  # Commandline usage example:
  #
  #   raction create_registered_tags
  #
  # ======================================================================= #
  when :create_registered_tags,
       :CreateRegisteredTags
    require 'rbt/registered/registered_tags.rb'
    RBT.create_registered_tags
  # ======================================================================= #
  # === :feedback_description_of
  #
  # Commandline usage example:
  #
  #   raction feedback_description_of ruby
  #
  # ======================================================================= #
  when :feedback_description_of
    require 'rbt/actions/individual_actions/information/feedback_description_of.rb'
    RBT.feedback_description_of(_)
  # ======================================================================= #
  # === :feedback_program_description
  #
  # This entry point will quickly show the description of the given
  # program, onto the commandline.
  #
  # Commandline usage example:
  #
  #   raction feedback_program_description ruby
  #
  # ======================================================================= #
  when :feedback_program_description
    require 'rbt/toplevel_methods/feedback_program_description.rb'
    RBT.feedback_program_description(_)
  # ======================================================================= #
  # === :create_cookbook_yaml_file
  #
  # Commandline usage example:
  #
  #   raction create_cookbook_yaml_file libxml2
  #
  # ======================================================================= #
  when :create_cookbook_yaml_file,
       :create_new_cookbook,
       :create_a_new_cookbook
    require 'rbt/cookbooks/create_cookbook_yaml_file/create_cookbook_yaml_file.rb'
    RBT.create_cookbook_yaml_file(_)
  # ======================================================================= #
  # === :update_tags
  #
  # This entry point will update the registered tags.
  # ======================================================================= #
  when :update_tags,
       :registered_tags
    require 'rbt/registered/registered_tags.rb'
    RBT::RegisteredTags.new
  # ======================================================================= #
  # === :chained_programs
  # ======================================================================= #
  when :chained_programs
    require 'rbt/constants/constants.rb'
    return RBT.chained_programs?
  # ======================================================================= #
  # === :url_action
  # ======================================================================= #
  when :url_action
    require 'rbt/url_action/url_action.rb'
    RBT::UrlAction[_]
  # ======================================================================= #
  # === :dual_compile
  # ======================================================================= #
  when :dual_compile
    require 'rbt/toplevel_methods/dual_compile.rb'
    RBT.dual_compile(_)
  # ======================================================================= #
  # === :custom_toolchain
  # ======================================================================= #
  when :custom_toolchain
    require 'rbt/requires/require_the_installer_class.rb'
    RBT::Action::Installer.new(_)
  # ======================================================================= #
  # === :chroot_compile
  # ======================================================================= #
  when :chroot_compile
    require 'rbt/toplevel_methods/chroot_and_chown_related_code.rb'
    RBT.chroot_compile(_)
  # ======================================================================= #
  # === :uchroot_compile
  # ======================================================================= #
  when :uchroot_compile
    require 'rbt/toplevel_methods/toplevel_methods.rb'
    RBT.uchroot_compile(_) # uchroot nasm bison
  # ======================================================================= #
  # === :generate_all_slack_desc_files
  #
  # This action allows the user to batch-create all slack-desc files.
  # ======================================================================= #
  when :generate_all_slack_desc_files
    require 'rbt/requires/require_the_installer_class.rb'
    _ = RBT::Action::Installer.new(:dont_run_yet)
    target = "#{rbt_log_directory?}slackware_desc_files/"
    opnn; mkdir(target, :be_verbose)
    cd target
    RBT.all_programs?.each {|entry|
      _.generate_slack_desc_file_for_this_program(entry)
    }
  # ======================================================================= #
  # === :trad
  # ======================================================================= #
  when :trad,
       :traditional
    require 'rbt/utility_scripts/compile_in_traditional_manner.rb'
    RBT::CompileInTraditionalManner.new(_)
  # ======================================================================= #
  # === :report_where_the_source_directory_can_be_found
  # ======================================================================= #
  when :report_where_the_source_directory_can_be_found,
       :report_base_directory,
       :report_archive_directory
    e "#{rev}The directory for source archives can be found at:"
    e
    e "  #{sdir(RBT.source_directory?)}"
    e
  # ======================================================================= #
  # === :report_host_cpu
  # ======================================================================= #
  when :report_host_cpu
    e "#{rev}The host system (CPU) in use is: "\
      "#{sfancy(host_cpu?)}"
  # ======================================================================= #
  # === :manual_steps
  # ======================================================================= #
  when :manual_steps
    require 'rbt/requires/require_the_installer_class.rb'
    compile_this_program = _.first
    compile_object = RBT::Action::Installer.new(compile_this_program, :do_not_run_yet)
    compile_object.set_compile_this_program(compile_this_program)
    compile_object.menu('--manual-steps')
    compile_object.run
  # ======================================================================= #
  # === :find_all_archive_types
  # ======================================================================= #
  when :find_all_archive_types
    require 'rbt/cookbooks/find_all_archive_types.rb'
    RBT::Cookbooks::FindAllArchiveTypes.new(_).show_results
  # ======================================================================= #
  # === :beautify_configure_help_output
  # ======================================================================= #
  when :beautify_configure_help_output
    require 'rbt/utility_scripts/beautify_configure_help_output.rb'
    RBT::BeautifyConfigureHelpOutput.new(_)
  # ======================================================================= #
  # === :colour_make
  # ======================================================================= #
  when :colour_make
    require 'rbt/make/make.rb'
    RBT::Make.new(_)
  # ======================================================================= #
  # === :compile_via_appdir_prefix_without_symlinking
  # ======================================================================= #
  when :compile_via_appdir_prefix_without_symlinking
    require 'rbt/toplevel_methods/compile_via_appdir_prefix_without_symlinking.rb'
    RBT.compile_via_appdir_prefix_without_symlinking(_)
  # ======================================================================= #
  # === :feedback_all_available_formats
  # ======================================================================= #
  when :feedback_all_available_formats
    require 'rbt/cookbooks/sanitize_cookbook/misc.rb'
    RBT::Cookbooks::SanitizeCookbook.feedback_all_available_formats
  # ======================================================================= #
  # === :create_snapcraft_file
  # ======================================================================= #
  when :create_snapcraft_file
    require 'rbt/cookbooks/create_snapcraft_file.rb'
    RBT::Cookbooks::CreateSnapcraftFile.new(_)
  # ======================================================================= #
  # === :extra_information
  # ======================================================================= #
  when :extra_information
    require 'rbt/utility_scripts/extra_information.rb'
    RBT::ExtraInformation.show(_)
  # ======================================================================= #
  # === :autoupdate_this_program
  # ======================================================================= #
  when :autoupdate_this_program
    require 'rbt/utility_scripts/autoupdate_this_program.rb'
    RBT::AutoupdateThisProgram.new(_)
  # ======================================================================= #
  # === :autosymlink
  # ======================================================================= #
  when :autosymlink
    require 'rbt/utility_scripts/autosymlink.rb'
    RBT::Autosymlink.new(_)
  # ======================================================================= #
  # === :compile_these_programs
  #
  # Invocation example:
  #
  #   compile_these_programs php python
  #
  # ======================================================================= #
  when :compile_these_programs
    require 'rbt/requires/require_the_installer_class.rb'
    if _.is_a?(String) and _.include?(' ')
      _ = optional_argument1.split(' ')
    end
    _.each {|entry|
      RBT::Action::Installer.new(entry)
    }
  # ======================================================================= #
  # === :compile_into_home_dir
  # ======================================================================= #
  when :compile_into_home_dir,
       :home_dir
    require 'rbt/utility_scripts/compile_into_home_dir.rb'
    RBT::CompileIntoHomeDir.new(_)
  # ======================================================================= #
  # === :home_dir_without_symlinking
  # ======================================================================= #
  when :home_dir_without_symlinking,
       :home_dir_without_symlink
    require 'rbt/utility_scripts/compile_into_home_dir_without_symlinking.rb'
    RBT::CompileIntoHomeDirWithoutSymlinking.new(_)
  # ======================================================================= #
  # === :parse_help
  # ======================================================================= #
  when :parse_help,
       :parse_configure_help
    require 'rbt/utility_scripts/parse_configure_help.rb'
    RBT::ParseConfigureHelp.new(_)
  # ======================================================================= #
  # === :query_file_association
  # ======================================================================= #
  when :query_file_association
    require 'rbt/utility_scripts/query_file_association.rb'
    RBT::QueryFileAssociation.new(_)
  # ======================================================================= #
  # === :make
  # ======================================================================= #
  when :make
    require 'rbt/make/make.rb'
    RBT::Make.new(_).run
  # ======================================================================= #
  # === :show_versions_of_these_programs
  #
  # Usage example:
  #
  #   show_versions_of_these_programs htop php ruby
  #
  # ======================================================================= #
  when :show_versions_of_these_programs
    require 'rbt/utility_scripts/show_versions_of_these_programs.rb'
    RBT::ShowVersionsOfThesePrograms.new(_)
  # ======================================================================= #
  # === :toolchain
  # ======================================================================= #
  when :toolchain
    require 'rbt/utility_scripts/toolchain.rb'
    RBT::Toolchain.new(_)
  # ======================================================================= #
  # === :chainer
  # ======================================================================= #
  when :chainer
    require 'rbt/utility_scripts/chainer.rb'
    RBT::Chainer.new(_)
  # ======================================================================= #
  # === :check_for_binary_duplicates
  # ======================================================================= #
  when :check_for_binary_duplicates
    require 'rbt/toplevel_methods/check_for_binary_duplicates.rb'
    RBT.check_for_binary_duplicates    
  # ======================================================================= #
  # === :create_programs_url_file
  # ======================================================================= #
  when :create_programs_url_file
    require 'rbt/actions/individual_actions/information/create_program_version_url_file.rb'
    RBT.create_programs_url_file
  # ======================================================================= #
  # === :create_log_directory
  #
  # This entry point can be used to create a new default log
  # directory for the RBT gem.
  # ======================================================================= #
  when :create_log_directory,
       :log_directory
    require 'rbt/toplevel_methods/files_and_directories_related_methods.rb'
    RBT.create_log_directory
  # ======================================================================= #
  # === :report_total_size_of_all_archives
  #
  # Invocation example:
  #
  #   raction report_total_size_of_all_archives
  #
  # ======================================================================= #
  when :report_total_size_of_all_archives
    require 'rbt/toplevel_methods/archive_related_code.rb'
    RBT.report_total_size_of_all_archives
  # ======================================================================= #
  # === :create_html_page_for_these_programs
  #
  # Invocation example:
  #
  #   create_html_page_for_these_programs php ruby libx11 zlib
  #
  # ======================================================================= #
  when :create_html_page_for_these_programs
    require 'rbt/toplevel_methods/html.rb'
    _ = _
    if _.is_a?(String) and _.include?(' ')
      _ = _.split(' ')
    end
    RBT.create_html_page_for_these_programs(_)
  # ======================================================================= #
  # === :create_programs_version_html_file
  #
  # Commandline invocation example:
  #
  #   raction create_programs_version_html_file
  #
  # ======================================================================= #
  when :create_programs_version_html_file
    require 'rbt/toplevel_methods/html.rb'
    RBT.create_programs_version_html_file
  # ======================================================================= #
  # === :find_url_for
  # ======================================================================= #
  when :find_url_for
    require 'rbt/toplevel_methods/url.rb'
    RBT.find_url_for(_)
  # ======================================================================= #
  # === :find_likely_directory
  # ======================================================================= #
  when :find_likely_directory
    require 'rbt/actions/individual_actions/find_likely_directory/find_likely_directory.rb'
    RBT.find_likely_directory(_)
  # ======================================================================= #
  # === :binary_of
  # ======================================================================= #
  when :binary_of
    require 'rbt/utility_scripts/binary_name_belongs_to_which_program.rb'
    RBT::BinaryNameBelongsToWhichProgram.new(_)
  # ======================================================================= #
  # === :headers
  # ======================================================================= #
  when :headers
    require 'rbt/actions/individual_actions/headers/headers.rb'
    RBT.headers(ARGV).report
  # ======================================================================= #
  # === :remove_symlinks
  # ======================================================================= #
  when :remove_symlinks
    require 'rbt/utility_scripts/remove_symlinks.rb'
    RBT::RemoveSymlinks.new(_)
  # ======================================================================= #
  # === :show_available_tags
  # ======================================================================= #
  when :show_available_tags
    require 'rbt/toplevel_methods/show_available_tags.rb'
    RBT.show_available_tags(:default, :be_quiet)
  # ======================================================================= #
  # === :download
  # ======================================================================= #
  when :download,
       :rbt_download # A necessary "alias".
    require 'rbt/toplevel_methods/download.rb'
    RBT.download(_)
  # ======================================================================= #
  # === :libtool
  # ======================================================================= #
  when :libtool
    require 'rbt/libtool/libtool.rb'
    RBT.libtool(_)
  # ======================================================================= #
  # === :gather_information
  # ======================================================================= #
  when :gather_information
    require 'rbt/actions/individual_actions/information/gather_information.rb'
    RBT.gather_information(_)
  # ======================================================================= #
  # === :multi_url_displayer
  # ======================================================================= #
  when :multi_url_displayer,
       :multi_URL_displayer
    require 'rbt/cookbooks/multi_url_displayer/multi_url_displayer.rb'
    RBT::Cookbooks::MultiUrlDisplayer.new(_)
  # ======================================================================= #
  # === :create_pkgconfig_file
  # ======================================================================= #
  when :create_pkgconfig_file
    require 'rbt/generate_files/create_pkgconfig_file.rb'
    RBT::CreatePkgconfigFile.new(_)
  # ======================================================================= #
  # === :install_this_rubygem
  #
  # Usage example:
  #
  #   RBT.action(:install_this_rubygem, 'path_to_the.gem')
  #
  # Commandline invocation example:
  #
  #   raction install_gem /home/x/src/rails/rails-7.0.1.gem
  #
  # ======================================================================= #
  when :install_this_rubygem,
       :install_this_gem,
       :install_gem
    RBT.install_this_rubygem(_)
  # ======================================================================= #
  # === :build_detector
  #
  # Commandline invocation example:
  #
  #   raction build_detector
  #
  # ======================================================================= #
  when :build_detector
    require 'rbt/utility_scripts/build_detector.rb'
    RBT::BuildDetector.new(_).report
  # ======================================================================= #
  # === :raw_cookbook
  #
  # Usage example:
  #
  #   RBT.action(:raw_cookbook, 'glib')
  #
  # ======================================================================= #
  when :raw_cookbook,
       :raw
    require 'rbt/actions/individual_actions/cookbooks/raw_cookbook/raw_cookbook.rb'
    RBT.raw_cookbook(_, options_hash, &block)
  # ======================================================================= #
  # === :check_this_cookbook_file_for_errors
  #    
  # Commandline invocation example:
  #
  #   raction check_this_cookbook_file_for_errors ruby
  #
  # ======================================================================= #
  when :check_this_cookbook_file_for_errors
    require 'rbt/toplevel_methods/check_this_cookbook_file_for_errors.rb'
    RBT.check_this_cookbook_file_for_errors(_)
  # ======================================================================= #
  # === :remove_outdated_archives
  #
  # Commandline invocation example:
  #
  #   raction remove_outdated_archives
  #
  # ======================================================================= #
  when :remove_outdated_archives
    require 'rbt/utility_scripts/remove_outdated_archives.rb'
    RBT::RemoveOutdatedArchives.new(_)
  # ======================================================================= #
  # === :scookie
  # ======================================================================= #
  when :scookie
    require 'rbt/toplevel_methods/report_extended_information_about_this_program.rb'
    RBT.report_extended_information_about_this_program(_)
  # ======================================================================= #
  # === :find_alternative_archive
  #
  # Usage example:
  #
  #   RBT.action(:find_alternative_archive, '$MY_SRC/gdkpixbuf/gdk-pixbuf')
  #
  # Commandline invocation example:
  #
  #   raction find_alternative_archive $MY_SRC/gdkpixbuf/gdk-pixbuf
  #
  # ======================================================================= #
  when :find_alternative_archive,
       :alternative_archive,
       :return_alternative_archive
    require 'rbt/actions/individual_actions/find_alternative_archive/find_alternative_archive.rb'
    return RBT.return_alternative_archive(_)
  # ======================================================================= #
  # === :generate_programs_version_yaml_file
  #
  # Usage example:
  #
  #   RBT.action(:generate_programs_version_yaml_file)
  #
  # Commandline invocation example:
  #
  #   raction generate_programs_version_yaml_file
  #
  # ======================================================================= #
  when :generate_programs_version_yaml_file
    require 'rbt/toplevel_methods/generate_programs_version_yaml_file.rb'
    RBT.generate_programs_version_yaml_file
  # ======================================================================= #
  # === :try_to_find_shortcut_for_a_chain_compiled_program
  #
  # Usage example:
  #
  #   RBT.action(:try_to_find_shortcut_for_a_chain_compiled_program, 'kde1')
  #
  # Commandline invocation example:
  #
  #   raction shortcut_to_chain_compiled_program kde1
  #
  # ======================================================================= #
  when :try_to_find_shortcut_for_a_chain_compiled_program,
       :shortcut_to_chain_compiled_program
    require 'rbt/toplevel_methods/try_to_find_shortcut_for_a_chain_compiled_program.rb'
    e RBT.try_to_find_shortcut_for_a_chain_compiled_program(_)
  # ======================================================================= #
  # === :get_all_files_from
  #
  # Usage example:
  #
  #   RBT.action(:get_all_files_from, '/home/x/src/htop/')
  #
  # ======================================================================= #
  when :get_all_files_from
    RBT.get_all_files_from(_)
  # ======================================================================= #
  # === :infer_build_system
  #
  # Usage example:
  #
  #   RBT.action(:infer_build_system)
  #
  # Commandline invocation example:
  #
  #   raction installer php
  #
  # ======================================================================= #
  when :infer_build_system,
       :infer
    require 'rbt/actions/individual_actions/infer_build_system/infer_build_system.rb'
    RBT.infer_then_report_the_build_system(_)
  # ======================================================================= #
  # === :fast_return_file_size_of_this_program
  #
  # Usage example:
  #
  #   RBT.action(:fast_return_file_size_of_this_program, 'glib')
  #
  # ======================================================================= #
  when :fast_return_file_size_of_this_program
    require 'rbt/toplevel_methods/fast_return_file_size_of_this_program.rb'
    RBT.fast_return_file_size_of_this_program(_, &block)
  # ======================================================================= #
  # === :check_for_invalid_entries_in_this_cookbook
  # ======================================================================= #
  when :check_for_invalid_entries_in_this_cookbook
    require 'rbt/actions/individual_actions/checks_and_validations/check_for_invalid_entries_in_this_cookbook.rb'
    RBT::Action::Cookbooks::CheckForInvalidEntriesInThisCookbook.new(_)
  # ======================================================================= #
  # === nil
  # ======================================================================= #
  when nil
    e 'Please provide a valid action to the RBT.action() '\
      'method (nil was supplied).'
  else # else tag
    e "#{rev}Not a registered action: "\
      "#{action_that_is_desired} "\
      "(class: #{action_that_is_desired.class})"
  end
end

.action_compile(compile_this_program, &block) ⇒ Object

#

RBT.action_compile

This provides a simplified “compile-action”.

Invocation example:

RBT.acompile(:htop)
#


2138
2139
2140
2141
2142
2143
# File 'lib/rbt/actions/actions.rb', line 2138

def self.action_compile(
    compile_this_program,
    &block
  )
  RBT.action(:Installer, compile_this_program.to_s, &block)
end

.aggregate_information_from_the_expanded_cookbooks(optional_argument1, extract_to = :default) ⇒ Object

#

RBT.aggregate_information_from_the_expanded_cookbooks

#


170
171
172
173
174
175
# File 'lib/rbt/actions/individual_actions/information/aggregate_information_from_the_expanded_cookbooks.rb', line 170

def self.aggregate_information_from_the_expanded_cookbooks(
    optional_argument1,
    extract_to = :default
  )
  RBT::Action::AggregateInformationFromTheExpandedCookbooks.new
end

.all_binaries?Boolean

#

RBT.all_binaries?

Get back all registered binaries.

This is guaranteed to return a Hash.

#

Returns:

  • (Boolean)


46
47
48
# File 'lib/rbt/toplevel_methods/all_binaries.rb', line 46

def self.all_binaries?
  ALL_BINARIES
end

.all_headers?Boolean

#

RBT.all_headers?

#

Returns:

  • (Boolean)


227
228
229
# File 'lib/rbt/registered/registered_headers.rb', line 227

def self.all_headers?
  RBT::Cookbooks.all_headers?
end

.all_libraries?Boolean

#

RBT.all_libraries?

Get back all registered libraries.

This is guaranteed to return a Hash.

#

Returns:

  • (Boolean)


51
52
53
# File 'lib/rbt/toplevel_methods/all_libraries.rb', line 51

def self.all_libraries?
  ALL_LIBRARIES
end

.all_tags?Boolean

#

RBT.all_tags?

#

Returns:

  • (Boolean)


39
40
41
# File 'lib/rbt/registered/registered_tags.rb', line 39

def self.all_tags?
  ALL_TAGS
end

.all_urls(optional_commands = nil) ⇒ Object

#

RBT.all_urls

This is simply a convenience method.

#


231
232
233
# File 'lib/rbt/cookbooks/all_urls/all_urls.rb', line 231

def self.all_urls(optional_commands = nil)
  RBT::Cookbooks::AllUrls.new(optional_commands)
end

.append_error_message(i) ⇒ Object

#

RBT.append_error_message

#


35
36
37
# File 'lib/rbt/toplevel_methods/error_message.rb', line 35

def self.append_error_message(i)
  @error_message << i
end

.append_what_into(what, into) ⇒ Object

#

RBT.append_what_into

#


1429
1430
1431
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1429

def self.append_what_into(what, into)
  RBT::SaveFile.append_what_into(what, into)
end

.apply_sed_operations(i = ARGV, &block) ⇒ Object

#

RBT.apply_sed_operations

#


203
204
205
# File 'lib/rbt/utility_scripts/apply_sed_operations.rb', line 203

def self.apply_sed_operations(i = ARGV, &block)
  RBT::ApplySedOperations.new(i, &block)
end

.are_we_on_gobolinux?Boolean

#

RBT.are_we_on_gobolinux?

This method can help us when we wish to determine whether we are on GoboLinux or whether we are not.

Note that this will return a “static” result. If you need a value that is dynamic, you ought to query an instance variable instead.

#

Returns:

  • (Boolean)


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/rbt/toplevel_methods/gobolinux.rb', line 35

def self.are_we_on_gobolinux?
  require 'rbt/constants/constants.rb'
  return_this = false
  use_this_env_key = 'IS_ON_GOBOLINUX'
  if ENV.has_key? use_this_env_key
    if ENV[use_this_env_key].to_s == '1'
      return_this = true
    end
  elsif File.exist? ::RBT.file_is_on_gobolinux
    return_this = true
  elsif GOBOLINUX_LAYOUT.to_s == '1' # The constant GOBOLINUX_LAYOUT is a String.
    return_this = true
  elsif File.exist?(RBT.file_is_on_gobolinux) and
        (File.read(RBT.file_is_on_gobolinux).strip.to_s == '1')
    return_this = true
  elsif is_this_a_real_gobolinux_system?
    return_this = true
  end
  return return_this
end

.array_all_BLFS_entriesObject

This method will return an Array of all BLFS entries. It will not hold any specific information about the programs that hold these BLFS entries.

#


555
556
557
558
559
560
561
562
563
564
565
# File 'lib/rbt/actions/individual_actions/cookbooks/blfs/blfs.rb', line 555

def self.array_all_BLFS_entries
  array = []
  all_yaml_files = Dir["#{cookbook_directory?}*.yml"]
  content_of_all_yaml_files = all_yaml_files.map {|entry|
    "#{File.read(entry)}\n"
  }.join("\n")
  array = content_of_all_yaml_files.scan(
    /^ blfs:\n - (.+)$/ # Grab the relevant entries here.
  ).flatten
  return array
end

.array_all_BLFS_entries_attributedObject

#

RBT.array_all_BLFS_entries_attributed

This method will (silently) return an Array with all entries that have the BLFS tag.

This method is similar to RBT.array_all_BLFS_entries, but it will also return all BLFS entries associated with the corresponding program name.

This method used grep in the past, but will use Dir[] and .scan() since as of 21.05.2020 instead. This should make it work better on windows specifically, for instance.

The result will look like this:

["libpcap",
 "https://www.linuxfromscratch.org/blfs/view/svn/basicnet/libpcap.html"],
["xulrunner",
 "https://www.linuxfromscratch.org/blfs/view/7.5/x/xulrunner.html"],

Usage example:

x = RBT.return_all_blfs_entries; pp x; ''
#


592
593
594
595
596
597
598
599
600
601
602
# File 'lib/rbt/actions/individual_actions/cookbooks/blfs/blfs.rb', line 592

def self.array_all_BLFS_entries_attributed
  array = []
  all_yaml_files = Dir["#{cookbook_directory?}*.yml"]
  content_of_all_yaml_files = all_yaml_files.map {|entry|
    "#{File.read(entry)}\n"
  }.join("\n")
  array = content_of_all_yaml_files.scan(
    /^(.+):\n^ blfs:\n - (.+)$/
  )
  return array
end

.array_all_rubygemsObject

#

RBT.array_all_rubygems

This method will return all rubygems, as an Array.

This can then be used in other programs, such as in RBT to batch-install all rubygems.

#


42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/rbt/toplevel_methods/rubygems.rb', line 42

def self.array_all_rubygems
  # ======================================================================= #
  # This is a bit hack-ish, but it is also fast. We will scan for entries
  # that hold the content 'url1:'; and also the substring '.gem' within
  # that entry. Other entries will be ignored.
  # ======================================================================= #
  array = []
  # ======================================================================= #
  # Obtain all .yml files first:
  # ======================================================================= #
  all_yaml_files = Dir["#{RBT.individual_cookbooks_directory?}*.yml"]
  all_yaml_files.each {|path_to_the_yaml_file|
    name_of_the_program = File.basename(path_to_the_yaml_file.sub(/\.yml$/,''))
    dataset_of_the_program = File.read(path_to_the_yaml_file)
    if dataset_of_the_program =~ /^ url1: .*\.gem$/
      # =================================================================== #
      # In this case we will assume that it is a ruby .gem file, so we
      # add it into the Array that will be returned.
      # =================================================================== #
      array << name_of_the_program
    end
  }
  array.sort # Keep it sorted, for easier reading.
end

.array_binary_duplicates(from_this_directory = :default, to = :default) ⇒ Object

#

RBT.array_binary_duplicates

This method will return an Array of all “/usr/bin/” binary duplicates, or from wherever else you wish to get the listing of duplicates. The default target is “/usr/bin/” but you could also pass in the argument “/usr/bin/”, as second argument to this method.

The first argument to this method is the directory where your main binaries should reside at. On GoboLinux-like systems, this will default to ‘/System/Index/bin’.

Invocation example for this method from within ruby code:

array = RBT.array_binary_duplicates
#


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/rbt/toplevel_methods/check_for_binary_duplicates.rb', line 31

def self.array_binary_duplicates(
    from_this_directory = :default,
    to                  = :default
  )
  # ======================================================================= #
  # The following two case-menus will handle the :default arguments
  # passed. The default is, on my home system, for '/System/Index/bin/'
  # as the first argument, and for '/usr/bin/' as the second argument
  # to this method here.
  # ======================================================================= #
  case from_this_directory
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    from_this_directory = RBT.sysbin_directory?
  end
  case to
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    to = '/usr/bin/'
  end
  array = []
  Dir["#{from_this_directory}*"].each {|this_file| # Return the Array here.
    name_of_the_program = File.basename(this_file)
    target_file = "#{to}#{name_of_the_program}"
    if File.exist? target_file
      array << target_file
    end
  }
  return array
end

.array_these_ruby_gems_were_updated?Boolean

#

RBT.array_these_ruby_gems_were_updated?

#

Returns:

  • (Boolean)


20
21
22
# File 'lib/rbt/toplevel_methods/rubygems.rb', line 20

def self.array_these_ruby_gems_were_updated?
  @array_these_ruby_gems_were_updated
end

.audio_directory?Boolean

#

RBT.audio_directory?

Where to keep audio/sound files. (Not a very important constant; it is mostly for my own home system really.)

#

Returns:

  • (Boolean)


26
27
28
# File 'lib/rbt/configuration/configuration.rb', line 26

def self.audio_directory?
  @configuration.audio_dir
end

.author_name?Boolean

#

RBT.author_name?

#

Returns:

  • (Boolean)


314
315
316
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 314

def self.author_name?
  'Robert A. Heiler'
end

.automatically_create_package?Boolean

#

RBT.automatically_create_package?

Whether or not to create a package automatically.

#

Returns:

  • (Boolean)


82
83
84
# File 'lib/rbt/configuration/configuration.rb', line 82

def self.automatically_create_package?
  @configuration.automatically_create_package
end

.autoswitch_python?Boolean

#

RBT.autoswitch_python?

Whether to autoswitch python or whether to not autoswitch python.

If set to true then RBT will attempt to switch to another python version, if it is available. It will try to do so only once, though.

#

Returns:

  • (Boolean)


174
175
176
# File 'lib/rbt/configuration/configuration.rb', line 174

def self.autoswitch_python?
  RBT.configuration?.autoswitch_python
end

.available_programs?(extra_arguments = nil) ⇒ Boolean

#

RBT.available_programs?

This method will return an Array of all available (registered or otherwise made known) programs.

By default it will return a list of programs from the given .yml files.

The optional argument allows us to also use abbreviations, if the argument is the Symbol called :include_abbreviations, :include_aliases or :with_aliases. (These symbols are aliases and do the same.)

The reason why this is not enabled by default is primarily because many other files are only interested in the directly registered programs.

The aliases will at first appear in a Hash, with key->value pairs such as:

"gnomewe"=>"gnomeweather"

Obviously we are here only interested in the keys, which is why the code below will use the method .keys().

Keep in mind that whenever you wish to compile one such program, you need to check to which the program may point at.

#

Returns:

  • (Boolean)


384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 384

def self.available_programs?(
    extra_arguments = nil
  )
  array = determine_available_programs
  case extra_arguments
  # ======================================================================= #
  # === :include_abbreviations
  # ======================================================================= #
  when :include_abbreviations,
       :include_aliases,
       :with_aliases,
       :with_abbreviations
    keys = @hash_aliases_to_the_available_programs.keys
    array << keys
  else
    if extra_arguments.is_a? Symbol
      e "Warning - not registered Symbol called :#{extra_arguments.to_s}"
    end
  end
  # ======================================================================= #
  # The resulting Array that will be returned from this method will
  # always be sorted and contain only unique entries:
  # ======================================================================= #
  array = array.flatten.uniq.sort
  array # Return the Array finally.
end

.backup_program(i) ⇒ Object

#

RBT.backup_program

#


123
124
125
# File 'lib/rbt/utility_scripts/backup_program.rb', line 123

def self.backup_program(i)
  RBT::BackupProgram.new(i)
end

.batch_compile(i = ARGV, try_to_use_chained_programs = true) ⇒ Object

#

RBT.batch_compile

This method can be used to batch compile programs.

The second argument to this method controls as to whether we will make use of chained programs or not.

#


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rbt/toplevel_methods/batch_compile.rb', line 17

def self.batch_compile(
    i                           = ARGV,
    try_to_use_chained_programs = true
  )
  require 'rbt/constants/constants.rb'
  require 'rbt/requires/require_actions.rb'
  i = [i].flatten.compact
  compile_object = action(:Installer) { :do_not_run_yet }
  i.each {|compile_this_program|
    if compile_this_program.is_a?(String) and compile_this_program.include?(',')
      compile_this_program = compile_this_program.split(',').map(&:strip)
    end
    # ===================================================================== #
    # Obtain the Array next that will hold our chained programs.
    # ===================================================================== #
    if RBT.chained_programs?.include? compile_this_program and
      try_to_use_chained_programs 
      compile_this_program = RBT.chained_programs?[compile_this_program]
    end
    compile_object.set_compile_these_programs(i)
    compile_object.run
    compile_object.reset
  }
end

.blfs_instance(i = ARGV, &block) ⇒ Object

#

RBT.blfs_instance

This method will guarantee that a new instance of class Blfs is returned.

#


537
538
539
540
541
542
543
544
545
546
# File 'lib/rbt/actions/individual_actions/cookbooks/blfs/blfs.rb', line 537

def self.blfs_instance(
    i = ARGV,
    &block
  )
  if block_given?
    return RBT::Action::Cookbooks::Blfs.new(i, &block)
  else
    return RBT::Action::Cookbooks::Blfs.new(i) # { :no_colours_be_quiet }
  end
end

.build_directory(i = nil, &block) ⇒ Object

#

RBT.build_directory

#


342
343
344
345
346
347
# File 'lib/rbt/actions/individual_actions/build_directory/build_directory.rb', line 342

def self.build_directory(
    i = nil, # This is deliberately nil by default.
    &block
  )
  RBT::Action::BuildDirectory.new(i, &block)
end

.build_type?Boolean

#

RBT.build_type?

This should default to the current directory.

The method will return a Symbol, such as :configure or :cmake.

If the build type can not be determined then :unknown will be returned.

Usage examples:

RBT.build_type? # => :configure
RBT.build_type? # => :cmake
#

Returns:

  • (Boolean)


265
266
267
# File 'lib/rbt/utility_scripts/build_detector.rb', line 265

def self.build_type?
  RBT::BuildDetector.build_type?
end

.chain_compile(i = ARGV) ⇒ Object

#

RBT.chain_compile

#


225
226
227
# File 'lib/rbt/utility_scripts/chain_compile.rb', line 225

def self.chain_compile(i = ARGV)
  RBT::ChainCompile.new(i) { :require_compile_base }
end

.chained_programs?(i = RBT.file_cookbook_chained_programs) ⇒ Boolean

#

RBT.chained_programs?

Simply return the dataset from the yaml file here.

The file that is used here is the file chained_programs.yml, which you can access via:

bl $RSRC/rbt/lib/rbt/yaml/chained_programs.yml
#

Returns:

  • (Boolean)


699
700
701
702
703
# File 'lib/rbt/constants/constants.rb', line 699

def self.chained_programs?(
    i = RBT.file_cookbook_chained_programs
  )
  YAML.load_file(i)
end

.change_directory(i) ⇒ Object

#

RBT.change_directory

#


180
181
182
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 180

def self.change_directory(i)
  Dir.chdir(i)
end

.check_and_report_whether_file_exists(i, optional_cookbook_object = nil) ⇒ Object

#

RBT.check_and_report_whether_file_exists

The first argument to this method must be the path to the archive.

#


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rbt/toplevel_methods/report_extended_information_about_this_program.rb', line 18

def self.check_and_report_whether_file_exists(
    i,
    optional_cookbook_object = nil
  )
  i = i.to_s
  unless File.exist? i
    opnn; Colours.ewarn 'This archive does not exist locally, at'
    opnn; Colours.ewarn "  `#{Colours.sfile(i)}#{swarn('`')}"
    if optional_cookbook_object
      if optional_cookbook_object.do_not_download?
        opne 'This is, however had, no problem as it will not'
        opne 'be downloaded anyway.'
      end
    end
    cliner :lightblue
  end
end

.check_for_available_versions(i = ARGV, run_already = true, &block) ⇒ Object

#

RBT.check_for_available_versions

#


261
262
263
264
265
266
267
# File 'lib/rbt/utility_scripts/check_for_available_versions.rb', line 261

def self.check_for_available_versions(
    i           = ARGV,
    run_already = true,
    &block
  )
  RBT::Cookbooks::CheckForAvailableVersions.new(i, run_already, &block)
end

.check_for_binary_duplicatesObject

#

RBT.check_for_binary_duplicates

This method will check for binary duplicates in the directory /usr/bin/.

#


72
73
74
75
76
77
78
79
# File 'lib/rbt/toplevel_methods/check_for_binary_duplicates.rb', line 72

def self.check_for_binary_duplicates
  array_binary_duplicates.each {|target_file|
    surrounded_target_file = "`#{target_file}`"
    colourized_target_file = sfile(surrounded_target_file)
    padded_and_colourized_target_file = colourized_target_file.ljust(70)
    e "#{rev}Yes, #{padded_and_colourized_target_file} #{rev}is a duplicate."
  }
end
#

This method is mostly an ad-hoc method. It will try to remove entries such as /home/Programs/Libsndfile/Current1.0.31 specifically.

#


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/rbt/checks_and_validations/check_for_faulty_current_symlinks.rb', line 31

def self.check_for_faulty_current_symlinks(
    in_this_directory
  )
  if in_this_directory.is_a? Array
    in_this_directory = in_this_directory.first
  end
  if in_this_directory.nil?
    in_this_directory = ::RBT.programs_dir?
  end
  in_this_directory = in_this_directory.dup
  in_this_directory << '/' unless in_this_directory.end_with? '/'
  all_current_symlinks = Dir[in_this_directory+'**/**'].select {|entry|
    File.symlink?(entry) and entry.include?('/Current')
  }
  # ======================================================================= #
  # Next, distinguish between:
  #
  #   "/home/Programs/Libsndfile/Current"
  #
  # and:
  #
  #   "/home/Programs/Libsndfile/Current1.0.31"
  #
  # ======================================================================= #
  all_faulty_current_symlinks = all_current_symlinks.select {|entry|
    last_char = entry[-1, 1]
    (last_char =~ /\d+/)
  }
  if all_faulty_current_symlinks.empty?
    opn(namespace: 'RBT'); e 'No faulty symlinks were found.'
    opn(namespace: 'RBT'); e 'The directory that was checked was `'+
                             ::Colours.sdir(in_this_directory)+
                             rev+'`.'
  else
    opne 'Faulty symlinks were found. These will be removed next.'
    all_faulty_current_symlinks.each {|entry|
      opne 'Next removing the faulty symlink at '+entry+'.'
      remove_symlink(entry)
    }
  end
end

.check_for_invalid_entries_in_this_cookbook(i = ARGV, &block) ⇒ Object

#

RBT.check_for_invalid_entries_in_this_cookbook

This method will also check for invalid entries in the given cookbook .yml file.

#


432
433
434
435
436
437
# File 'lib/rbt/actions/individual_actions/checks_and_validations/check_for_invalid_entries_in_this_cookbook.rb', line 432

def self.check_for_invalid_entries_in_this_cookbook(
    i = ARGV,
    &block
  )
  return RBT::Action::Cookbooks::CheckForInvalidEntriesInThisCookbook.new(i, :do_not_run_yet, &block)
end

.check_for_mate_desktop_updates(i = ARGV) ⇒ Object

#

RBT.check_for_mate_desktop_updates

#


166
167
168
# File 'lib/rbt/check_for_updates/check_for_mate_desktop_updates.rb', line 166

def self.check_for_mate_desktop_updates(i = ARGV)
  RBT::Cookbooks::CheckForMateDesktopUpdates.new(i)
end

.check_if_source_directories_existObject

#

RBT.check_if_source_directories_exist

#


190
191
192
# File 'lib/rbt/cookbooks/check_for_existing_source_directories.rb', line 190

def self.check_if_source_directories_exist
  RBT::Cookbooks::CheckIfSourceDirectoriesExist.new
end

.check_this_cookbook_file_for_errors(this_file = "#{RUBY_SRC_RBT_COOKBOOKS}jasper.yml") ⇒ Object

#

RBT.check_this_cookbook_file_for_errors

The first argument should be an existing .yml file holding the dataset that may be faulty.

#


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/rbt/toplevel_methods/check_this_cookbook_file_for_errors.rb', line 60

def self.check_this_cookbook_file_for_errors(
    this_file =
      "#{RUBY_SRC_RBT_COOKBOOKS}jasper.yml"
  )
  if this_file.is_a? Array
    this_file = this_file.first
  end
  if this_file.nil?
    this_file = "#{RUBY_SRC_RBT_COOKBOOKS}jasper.yml"
  end
  unless this_file.end_with?('.yml')
    unless File.exist? '.yml'
      this_file = project_yaml_dir?+'cookbooks/'+this_file+'.yml'
    end
  end
  if File.exist? this_file
    registered_cookbook_entries = RBT.registered_cookbook_entries?
    dataset = YAML.load_file(this_file)
    key = dataset.keys.first
    available_entries_from_the_cookbooks_file = dataset[key].keys
    # ===================================================================== #
    # Next, obtain the entries that were not registered. Keep in mind
    # that this Array may be entry.
    # ===================================================================== #
    these_entries_were_not_registered = available_entries_from_the_cookbooks_file.reject {|entry|
      registered_cookbook_entries.include? entry
    }
    unless these_entries_were_not_registered.empty?
      opn; e 'The file at `'+sfile(this_file)+'`'
      opn; e 'contains at the least one erroneous entry.'
      these_entries_were_not_registered.each {|this_entry_is_not_included|
        opn; e 'The entry `'+sfancy(this_entry_is_not_included)+rev+
               '` is not registered.'
      }
    else
      opn; e rev+'Everything is fine for the file '+
             sfile(this_file)+rev+'.'
      opn; e "#{rev}It has #{RBT.violet('no incorrect entries')}."
    end
  else
    opn; e "#{rev}No file exists at #{sfile(this_file)}#{rev}."
  end
end

.check_whether_this_yaml_file_has_two_url1_entries(i = ARGV) ⇒ Object

#

RBT.check_whether_this_yaml_file_has_two_url1_entries

The argument to this method should be the local file path, e. g. “foobar.yml”, as a String. Make sure that the file exists before calling this method here.

Usage example:

RBT.check_whether_this_yaml_file_has_two_url1_entries('xcbutilerrors.yml')
#


419
420
421
422
423
424
# File 'lib/rbt/actions/individual_actions/checks_and_validations/check_for_invalid_entries_in_this_cookbook.rb', line 419

def self.check_whether_this_yaml_file_has_two_url1_entries(
    i = ARGV
  )
  _ = RBT::Action::Cookbooks::CheckForInvalidEntriesInThisCookbook.new(i) { :do_not_run_yet }
  return _.check_whether_this_yaml_file_has_two_url1_entries(:default, i)
end

.chmod(this_file, permission = 0755) ⇒ Object

#

RBT.chmod (chmod tag)

Use this method to chmod a file or a directory. It also works with several files/directories passed in as Array.

#


166
167
168
169
170
171
172
173
174
175
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 166

def self.chmod(
    this_file,
    permission = 0755
  )
  if this_file.is_a? Array
    this_file.each { |file| chmod(file, permission) }
  else
    File.chmod(permission.to_i, this_file)
  end
end

.chroot_compile(this_program = ARGV, use_this_as_prefix = '/Depot/Chroot/usr/') ⇒ Object

#

RBT.chroot_compile

This method can be used to chroot-compile a given program, that is, to compile it INTO the chroot. The default prefix for that chroot environment will be /usr/. This is currently a hardcoded path.

This is mostly a “hackish” method in that I needed it to quickly compile programs into my main chroot, for when I build it up.

#


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rbt/toplevel_methods/chroot_and_chown_related_code.rb', line 23

def self.chroot_compile(
    this_program       = ARGV,
    use_this_as_prefix = '/Depot/Chroot/usr/' # The default prefix target.
  )
  require 'rbt/requires/require_actions.rb'
  if this_program.is_a? Array
    this_program.flatten!
    this_program.compact!
    this_program.map! {|entry|
      if entry =~ /^\d+$/ # If it is a number only, such as 1, 2, 3 etc.
        file_installation_procedure = RBT.file_installation_procedere
        if File.exist? file_installation_procedure
          dataset = YAML.load_file(file_installation_procedere)['default']
          entry = dataset[entry.to_i - 1]
        else
          no_file_exists_at(file_installation_procedure)
        end
      end
      entry
    }
  end
  # ======================================================================= #
  # Finally delegate towards class RBT::Compile.
  # ======================================================================= #
  action(:Installer, program) {{
    use_this_as_prefix: use_this_as_prefix
  }}
end

.cleanup_system_tags(i = ARGV) ⇒ Object

#

RBT.cleanup_system_tags

#


146
147
148
# File 'lib/rbt/utility_scripts/cleanup_system_tags.rb', line 146

def self.cleanup_system_tags(i = ARGV)
  RBT::CleanupSystemTags.new(i)
end

.cliner(use_this_token = '=', use_this_colour = nil, &block) ⇒ Object

#

RBT.cliner

This method accepts block-parameters such as :unicode, which will be “converted” into a corresponding horizontal line via a certain unicode block-symbol.

Usage example:

RBT.cliner('_', :steelblue)
#


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/rbt/toplevel_methods/cliner.rb', line 41

def self.cliner(
    use_this_token  = '=',
    use_this_colour = nil,
    &block
  )
  case use_this_token
  # === :do_not_use_colours
  when :do_not_use_colours
    use_this_token = '='
    use_this_colour = nil
  # === :default
  when :default
    use_this_token = '='
  end
  case use_this_colour
  when :default
    use_this_colour = nil
  end
  # ======================================================================= #
  # === Handle blocks given to this method next
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    when :unicode_middle_horizontal_bar
      begin
        # ================================================================= #
        # Fetch the unicode block here.
        # ================================================================= #
        require 'roebe/requires/require_unicode.rb'
        use_this_token = ::Roebe.horizontal_double_bar
      rescue LoadError
      end
    when :unicode
      begin
        # ================================================================= #
        # Fetch the unicode block here.
        # ================================================================= #
        require 'roebe/requires/require_unicode.rb'
        use_this_token = ::Roebe.return_horizontal_unicode_block
      rescue LoadError
      end
    end
  end
  if use_this_token.is_a? Hash
    if use_this_token.has_key? :use_colour
      use_this_colour = use_this_token[:use_colour]
      use_this_token = '=' # Restore the default in this case.
    end
  end
  case use_this_token
  when nil, :default
    use_this_token = '=' # <- Restore to the default in this case.
  end
  if use_this_colour
    # Support e. g. "konsole_dodgerblue" next.
    if use_this_colour.is_a?(Symbol) or
      ( use_this_colour.to_s.start_with?('konsole_dodgerblue') and
       !use_this_colour.to_s.include?('colour_') )
      # ================================================================= #
      # In this case, rewrite the colour-code a little, such as from
      # 'konsole_dodgerblue' towards 'konsole_colour_blue'.
      # ================================================================= #
      unless use_this_colour.is_a? Symbol
        use_this_colour = 'konsole_colour_'+use_this_colour.to_s.split('_').last
      end
    end
    e ::Colours.send(use_this_colour, (use_this_token * 80))
  else
    if use_this_token.is_a? Symbol
      if ::Colours.respond_to?(use_this_token)
        use_this_token = ::Colours.send(use_this_token, '=')
      else
        use_this_token = ::Colours::HtmlColoursMethods.send(use_this_token, '=')
      end
    end
    e (use_this_token * 80)
  end 
end

.cmake(i = ARGV, &block) ⇒ Object

#

RBT.cmake

#


447
448
449
# File 'lib/rbt/cmake/cmake.rb', line 447

def self.cmake(i = ARGV, &block)
  RBT::Cmake.new(i, &block)
end

.colour_make(&block) ⇒ Object

#

RBT.colour_make

#


708
709
710
# File 'lib/rbt/make/make.rb', line 708

def self.colour_make(&block)
  RBT::Make.new(&block).run
end

.colour_make_install(i = nil, run_already = true, &block) ⇒ Object

#

RBT.colour_make_install

#


96
97
98
99
100
101
102
# File 'lib/rbt/make/colour_make_install.rb', line 96

def self.colour_make_install(
    i           = nil,
    run_already = true,
    &block
  )
  RBT::ColourMakeInstall.new(i, run_already, &block)
end

.colourize_parser(i = ARGV) ⇒ Object

#

RBT.colourize_parser

#


888
889
890
# File 'lib/rbt/misc/colourize_parser.rb', line 888

def self.colourize_parser(i = ARGV)
  RBT::ColourizeParser.new(i)
end

.commandline_options?Boolean

#

RBT.commandline_options?

#

Returns:

  • (Boolean)


24
25
26
# File 'lib/rbt/commandline/commandline.rb', line 24

def self.commandline_options?
  @commandline_options
end

.compile(this_program = nil, optional_arguments = nil) ⇒ Object

#

RBT.compile

The first argument should be the name of the program that you wish to compile, such as :htop or ‘htop’.

#


13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
# File 'lib/rbt/actions/individual_actions/software_manager/misc.rb', line 13234

def self.compile(
    this_program       = nil,
    optional_arguments = nil
  )
  _ = RBT::Action::SoftwareManager.new(this_program, :do_not_run_already)
  # ========================================================================= #
  # Pass any extra arguments into the menu() interface.
  # ========================================================================= #
  _.menu(optional_arguments) if optional_arguments
  _.run
end

.compile_strategies?Boolean

#

RBT.compile_strategies?

#

Returns:

  • (Boolean)


318
319
320
# File 'lib/rbt/actions/individual_actions/statistics/compile_strategies.rb', line 318

def self.compile_strategies?
  RBT::Action::Statistics::CompileStrategies.new
end

.compile_these_programs?Boolean

#

RBT.compile_these_programs?

#

Returns:

  • (Boolean)


99
100
101
# File 'lib/rbt/toplevel_methods/compile_these_programs.rb', line 99

def self.compile_these_programs?
  @compile_these_programs
end

.compile_via_appdir_prefix_without_symlinking(i = ARGV) ⇒ Object

#

RBT.compile_via_appdir_prefix_without_symlinking

This method will compile via a versioned AppDir approach, but will not symlink after compilation has finished.

#


15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rbt/toplevel_methods/compile_via_appdir_prefix_without_symlinking.rb', line 15

def self.compile_via_appdir_prefix_without_symlinking(i = ARGV)
  require 'rbt/requires/require_actions.rb'
  i = [i].flatten.compact
  i.each {|this_program|
    _ = actions(:Installer, this_program) {{
      run_already: :do_not_run_yet,
      symlink_after_compilation_has_finished: false
    }}
    _.do_use_an_appdir_prefix
    _.run
  }
end

.compile_via_environment_variable_as_prefix(compile_these_programs = ARGV, use_this_environment_variable = :default) ⇒ Object

#

RBT.compile_via_environment_variable_as_prefix

#


165
166
167
168
169
170
171
172
# File 'lib/rbt/utility_scripts/compile_via_environment_variable_as_prefix.rb', line 165

def self.compile_via_environment_variable_as_prefix(
    compile_these_programs        = ARGV,
    use_this_environment_variable = :default
  )
  RBT::CompileViaEnvironmentVariableAsPrefix.new(
    compile_these_programs, use_this_environment_variable
  )
end

.configuration?Boolean

#

RBT.configuration?

Query method over the configuration-object.

#

Returns:

  • (Boolean)


33
34
35
# File 'lib/rbt/configuration/configuration_instance_variable.rb', line 33

def self.configuration?
  @configuration
end

.configuration_directory?Boolean

#

RBT.configuration_directory?

#

Returns:

  • (Boolean)


37
38
39
# File 'lib/rbt/constants/configuration_directory.rb', line 37

def self.configuration_directory?
  @configuration_directory
end

.configuration_has_been_initialized_already?Boolean

#

RBT.configuration_has_been_initialized_already?

#

Returns:

  • (Boolean)


140
141
142
# File 'lib/rbt/configuration/initialize_configuration.rb', line 140

def self.configuration_has_been_initialized_already?
  !@configuration.nil?
end

.configure_appdir_prefix(i = return_pwd) ⇒ Object

#

RBT.configure_appdir_prefix

This method will return the AppDir prefix, based on the given input, which defaults to the current working directory.

#


53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/rbt/toplevel_methods/configure_appdir_prefix.rb', line 53

def self.configure_appdir_prefix(
    i = return_pwd
  )
  i = i.first if i.is_a? Array
  if i.nil? or i.empty?
    i = return_pwd
  end
  target = File.basename(i)
  _ = './configure --prefix='+
      return_appdir_prefix(target)
  e _
end

.configure_has_a_higher_priority_than_meson?(this_file = RBT.file_build_system_priorities) ⇒ Boolean

#

RBT.configure_has_a_higher_priority_than_meson?

This method will return true if “configure” has a higher priority than “meson”. A yaml file keeps track of these priorities, so if you wish to change the priority, you have to modify the content of that .yml file.

The name of that yaml file:

build_systems_priorities.yml
#

Returns:

  • (Boolean)


29
30
31
32
33
34
# File 'lib/rbt/toplevel_methods/configure_has_a_higher_priority_than_meson.rb', line 29

def self.configure_has_a_higher_priority_than_meson?(
    this_file = RBT.file_build_system_priorities
  )
  array = YAML.load_file(this_file)
  array.index('configure') < array.index('meson')
end

.consider_changing_the_tab_title(i = return_program_name_then_hyphen_then_the_program_version, shall_we_rename_the_tab_title = :default_behaviour) ⇒ Object

#

RBT.consider_changing_the_tab_title (shell tag)

Use this method to change the title of a tab in a Terminal like Bash.

#


469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 469

def self.consider_changing_the_tab_title(
    i                             = return_program_name_then_hyphen_then_the_program_version,
    shall_we_rename_the_tab_title = :default_behaviour # By default we will rename the tab title.
  )
  if i.is_a?(Array) and (i.size == 2)
    shall_we_rename_the_tab_title = i.last
    i = i.first
  end
  case shall_we_rename_the_tab_title
  # ======================================================================= #
  # === :do_rename_the_tab
  # ======================================================================= #
  when :do_rename_the_tab,
       :do_rename,
       :default,
       :default_behaviour,
       nil
    shall_we_rename_the_tab_title = true
  end
  # ======================================================================= #
  # First check whether we ought to rename the tab title or not.
  # ======================================================================= #
  if shall_we_rename_the_tab_title
    case i
    # ===================================================================== #
    # === :default
    # ===================================================================== #
    when :default
      # This is the current hardcoded default. May change at a later time.
      i = return_program_name_then_hyphen_then_the_program_version
    # ===================================================================== #
    # === :clear
    # ===================================================================== #
    when :clear
      i = '.'
    end
    # ===================================================================== #
    # Query whether Roebe is available or not.
    # ===================================================================== #
    if Object.const_defined?(:Roebe) and
       shall_we_rename_the_tab_title # Only use it if the user enabled this.
      if Roebe.respond_to? :rename_konsole_title_to
        # ================================================================= #
        # Rename the konsole-title here.
        # ================================================================= #
        Roebe.rename_konsole_title_to(i, :be_quiet)
      else
        e "The namespace #{sfancy('Roebe')} does not respond to the method"
        e 'rename_konsole_title_to()'
        e 'Either the functionality is missing - or something has not'
        e 'been properly required. Either way, we can not rename the'
        e 'konsole tab for now.'
      end
    end
  end unless i.empty?
end

.convert_date_format(i = ARGV) ⇒ Object

#

RBT.convert_date_format

#


180
181
182
# File 'lib/rbt/cookbooks/convert_date_format.rb', line 180

def self.convert_date_format(i = ARGV)
  RBT::Cookbooks::ConvertDateFormat.new(i)
end

.convert_global_env(i) ⇒ Object

#

RBT.convert_global_env

#


12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rbt/toplevel_methods/convert_global_env.rb', line 12

def self.convert_global_env(i)
  unless Object.const_defined? :ConvertGlobalEnv
    begin
      require 'convert_global_env'
    rescue LoadError; end
  end
  i = i.first if i.is_a? Array
  if Object.const_defined? :ConvertGlobalEnv and
     i.include?('$') # Assume an ENV variable here.
    i = ConvertGlobalEnv.convert(i.dup).dup
  end
  return i
end

.cookbook_aliasesObject

#

RBT.cookbook_aliases

This will return the registered/available keys, in a sorted manner.

This will have about 331 entries (as of August 2018).

#


58
59
60
# File 'lib/rbt/aliases/aliases.rb', line 58

def self.cookbook_aliases
  COOKBOOK_ALIASES.keys.sort
end

.cookbook_aliases?Boolean

#

RBT.cookbook_aliases?

#

Returns:

  • (Boolean)


47
48
49
# File 'lib/rbt/aliases/aliases.rb', line 47

def self.cookbook_aliases?
  COOKBOOK_ALIASES
end

.cookbook_directory?Boolean

#

RBT.cookbook_directory?

Provide a pointer, through this query method, towards the directory where the individual cookbooks are kept.

#

Returns:

  • (Boolean)


36
37
38
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 36

def self.cookbook_directory?
  @cookbook_directory
end

.copy_recursively(what, where_to = '/usr/', be_verbose = false) ⇒ Object

#

RBT.copy_recursively

We can use a call to system(), or the pure ruby version, in order to recursively copy files. But you may not enough information if the pure ruby version is used.

“noop” means “No Op” aka “No Operation”. “No Op” is a dummy task that always completes successfully. It is most often used in a task whose role is to delete files.

The method signature upstream is:

cp_r(src, dest, preserve: nil, noop: nil, verbose: nil, dereference_root: true, remove_destination: nil) (mod_func)
#


1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1326

def self.copy_recursively(
    what,
    where_to   = '/usr/',
    be_verbose = false
  )
  if what.is_a? String
    what << '.' unless what.end_with? '.'
  end
  begin
    ::FileUtils.cp_r(
      what,
      where_to
    )#,
    #  nil,       # for preserve
    #  nil,       # for noop
    #  be_verbose # for verbose
    #)
  rescue Exception => error
    pp error
  end
end

.copy_these_archives(i = ARGV) ⇒ Object

#

RBT.copy_these_archives

#


126
127
128
# File 'lib/rbt/utility_scripts/copy_these_archives.rb', line 126

def self.copy_these_archives(i = ARGV)
  RBT::CopyTheseArchives.new(i)
end

.cornflowerblue(i = '', use_colours = use_colours? ) ⇒ Object

#

RBT.cornflowerblue

#


36
37
38
39
40
41
42
# File 'lib/rbt/colours/html_colours.rb', line 36

def self.cornflowerblue(
    i           = '',
    use_colours = use_colours?
  )
  return COLOURS::HtmlColoursMethods.cornflowerblue(i) if use_colours
  return i
end

.create_app_dir_skeleton(i = ARGV, &block) ⇒ Object

#

RBT.create_app_dir_skeleton

#


813
814
815
816
817
818
# File 'lib/rbt/actions/individual_actions/create_app_dir_skeleton/create_app_dir_skeleton.rb', line 813

def self.create_app_dir_skeleton(
    i = ARGV,
    &block
  )
  return RBT::Action::CreateAppDirSkeleton.new(i, &block)
end

.create_cookbook_yaml_file(i = 'php') ⇒ Object

#

RBT.create_cookbook_yaml_file

#


544
545
546
# File 'lib/rbt/cookbooks/create_cookbook_yaml_file/create_cookbook_yaml_file.rb', line 544

def self.create_cookbook_yaml_file(i = 'php')
  RBT::Cookbooks::CreateCookbookYamlFile.new(i)
end

.create_directory(where = '/Depot/Packages/', use_this_mode = 0755, be_verbose = :be_quiet, do_use_opnn = true, &block) ⇒ Object

#

RBT.create_directory

Internal Wrapper to create a directory.

We will also check if a Dir exists before actually creating it. This is the method of choice for creating a directory. Use it for all the RBT scripts, whenever you need to create a directory.

#


391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 391

def self.create_directory(
    where         = '/Depot/Packages/',
    use_this_mode = 0755,
    be_verbose    = :be_quiet,
    do_use_opnn   = true,
    &block
  )
  _yielded = nil # Not currently in use as of Dec 2022.
  if block_given?
    _yielded = yield
  end
  case use_this_mode
  when :be_verbose
    be_verbose = :be_verbose
    use_this_mode = :default
  end
  if where.is_a? Array
    where.each {|entry|
      create_directory(
        entry, use_this_mode, be_verbose, do_use_opnn
      )
    }
  else
    if File.directory? where
      unless where.end_with? '/' # Append a /.
        where = where.dup if where.frozen?
        where << '/'
      end
    end
    case use_this_mode
    when :default # Default value is 0755.
      use_this_mode = 0755
    when Hash
      if use_this_mode.has_key? :verbosity
        use_this_mode = use_this_mode.delete(:verbosity)
      end
      use_this_mode = 0755
    when '', true
      use_this_mode = 0755
    when :be_verbose
      use_this_mode = 0755
      be_verbose = true
    end
    # ===================================================================== #
    # Handle special symbols given to be_verbose.
    # ===================================================================== #
    case be_verbose
    when Hash
      # =================================================================== #
      # === :verbosity
      # =================================================================== #
      if be_verbose.has_key? :verbosity
        be_verbose = be_verbose.delete(:verbosity)
      end
    # ===================================================================== #
    # === :be_quiet
    # ===================================================================== #
    when :be_quiet,
         :be_silent
      be_verbose = false
    end
    case do_use_opnn
    when :do_not_use_opn,
         :do_not_use_opnn
      do_use_opnn = false
    end
    if File.exist? where
      if be_verbose
        opnn if do_use_opnn
        e "Directory `#{sdir(where)}` already exists, thus"
        opnn if do_use_opnn
        e 'skipping creating a new one.'
      end
    else
      if where
        if be_verbose
          opnn if do_use_opnn
          e "Creating the directory `#{sdir(where)}` next."
        end
        unless File.directory? where
          options_hash = {
            mode: use_this_mode, verbose: false
          }
          # =============================================================== #
          # The variable where can be a String such as 
          # "/home/Programs/Tepl/Current/yaml/". We have
          # to keep in mind that the mkdir-part may fail,
          # so a rescue clause has to be used.
          # =============================================================== #
          begin
            FileUtils.mkdir_p(where, **options_hash)
          rescue Errno::EEXIST
            e "The directory `#{sdir(where)}` can not be created"
            e 'as some target, or an incorrect symlink, '\
              'already exists.' 
          end
          # if be_verbose
          #   opnn if do_use_opnn
          #   e "Can not write into the directory `#{sdir(where)}` "\
          #     "due to insufficient permissions."
          # end
        end
      else
        opnn if do_use_opnn; e 'No directory was given.'
      end
    end
  end
end

.create_gobolinux_recipe(i = ARGV, &block) ⇒ Object

#

RBT.create_gobolinux_recipe

Easier module-method instantiation.

#


457
458
459
460
461
462
# File 'lib/rbt/linux/gobolinux/create_recipe.rb', line 457

def self.create_gobolinux_recipe(
    i = ARGV,
    &block
  )
  RBT::Linux::Gobolinux::CreateRecipe.new(i, &block)
end

.create_html_page_for_these_programs(array = ARGV) ⇒ Object

#

RBT.create_html_page_for_these_programs

This method works on an Array as its input. This Array should be about programs that you want to see an auto-generated webpage containing some information about this program.

#


81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/rbt/toplevel_methods/html.rb', line 81

def self.create_html_page_for_these_programs(array = ARGV)
  if array.is_a?(String) and
     array.start_with?(':')
    array = array.to_s.delete(':').to_sym
  end
  if array.is_a? Symbol
    require 'rbt/utility_scripts/search_for_tags/search_for_tags.rb'
    # ===================================================================== #
    # Handle special cases such as KDE5.
    # ===================================================================== #
    case array # case tag
    # ===================================================================== #
    # === cookbooks --create_html_page_for_these_programs=:kde5
    # ===================================================================== #
    when :kde, :kde5
      array = RBT.return_all_programs_that_match_this_tag(:kde5)
    # ===================================================================== #
    # === cookbooks --create_html_page_for_these_programs=:kde5_toolchain
    # ===================================================================== #
    when :kde5_toolchain
      # =================================================================== #
      # This variant here should be equivalent to LFS/BLFS, in the proper
      # order. This thus requires a yaml file.
      # =================================================================== #
      dataset = load_yaml(RBT.file_cookbook_chained_programs)
      array = dataset['kde5_foundation']+
              dataset['kde5_plasma']+
              dataset['kde5_applications']+
              dataset['kde5_porting_aids']
      if array.is_a? String # Well ... :)
        array.delete!(' ')
        array = array.split(',')
      end
    end
  end
  if array.is_a? Array
    if array.first.is_a?(String) and array.first.include?(',') # <- Input such as ["php,kio,ruby"]
      array = array.first.split(',')
    end
    array.flatten!
    if array.size > 20
      opn; e 'More than 20 entries were given (exactly '+
             sfancy(array.size.to_s)+'). This may take a while.'
    end
    @html_page_content = "<html>".dup
    begin
      require 'cyberweb'
      @html_page_content << Cyberweb.return_unicode_meta
    rescue LoadError; end
    @html_page_content << "<head><title>HTML Pages for programs</title>"\
                          "<style>pre { font-size: 1.4em; }</style>"\
                          "</head><body><hr>\n".dup # Reset again.
    array.each_with_index {|this_program, index| index += 1
      # =================================================================== #
      # For each program, we do the same actions:
      #
      #   (1) Obtain the dataset via Cookbooks::Cookbook.new() OR
      #       from the expanded directory containing all yaml files.
      #   (2) 
      # =================================================================== #
      if File.directory?(RBT.directory_expanded_cookbooks) and
         File.exist?(target_file = "#{RBT.directory_expanded_cookbooks}#{this_program}.yml")
        dataset = load_yaml(target_file)
        remote_url  = dataset['url1'.to_sym]
        description = dataset['raw_description'.to_sym]
        licence     = dataset['licence'.to_sym]
        homepage    = dataset['homepage'.to_sym].to_s
        binaries    = dataset['binaries'.to_sym]
        libraries   = dataset['libraries'.to_sym]
      else
        dataset = action(:SanitizeCookbook, this_program)
        remote_url  = dataset.url1?
        description = dataset.raw_description?
        licence     = dataset.licence?
        homepage    = dataset.homepage?
        binaries    = dataset.binaries?
        libraries   = dataset.binaries?
      end
      if licence.is_a? Array
        licence = licence.join(', ')
      end
      @html_page_content << "<p>\n<h3 style=\"color:darkgreen\"><b style=\"color:darkblue\">"\
                            "#{index})</b> #{this_program}</h3><br>\n"
      @html_page_content <<
        "  <span style=\"margin-left: 1em; font-weight:bold; color: darkblue\">wget #{remote_url}<span><br><br>\n"
      unless description.to_s.empty? # <- Ignore empty descriptions.
        @html_page_content << "<pre>#{description}</pre>\n"
      end
      # =================================================================== #
      # Add the binaries next:
      # =================================================================== #
      if binaries and binaries.is_a?(Array) and !binaries.empty?
        @html_page_content << "Binaries:<br><br>\n"
        binaries.each {|this_binary|
          @html_page_content << "<span style=\"margin-left:2em\">→ #{this_binary}<span><br>\n"
        }
        @html_page_content << "<br>\n"
      end
      # =================================================================== #
      # Add the libraries next:
      # =================================================================== #
      if libraries and libraries.is_a?(Array) and !libraries.empty?
        @html_page_content << "Libraries:<br><br>\n"
        libraries.each {|this_binary|
          @html_page_content << "<span style=\"margin-left:2em\">→ #{this_binary}<span><br>\n"
        }
        @html_page_content << "<br>\n"
      end
      @html_page_content << "licence: #{licence}<br><br>\n"
      @html_page_content << "homepage: <a href=\"#{homepage}\">#{homepage}</a><br>\n"
      @html_page_content << "</p><br><hr>\n"
    }
    # ===================================================================== #
    # Next, store that HTML page somewhere.
    # ===================================================================== #
    what = @html_page_content
    into = "#{log_dir?}programs.html"
    opn; e "Storing these #{sfancy(array.size)} #{rev}programs into the file:"
    e
    e "  #{sfile(into)}"
    e
    write_what_into(what, into)
    @html_page_content = ''.dup # Clear it again here.
  else
    opn; e 'This method requires an Array as input.'
  end
end

.create_log_directory(_ = log_directory? ) ⇒ Object

#

RBT.create_log_directory

This method will create the log directory, e. g. “/tmp/rbt/” or wherever else the user has set this directory to be at.

#


204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 204

def self.create_log_directory(
    _ = log_directory?
  )
  if _
    unless !File.directory?(_)
      opn; e "Creating the directory `#{sdir(_)}` now."
      FileUtils.mkdir_p(_)
    else
      opn; e "The directory at `#{sdir(_)}` already exists."
    end
  else
    opn; e 'No directory could be created as no input was given.'
  end
end

.create_program_version_url_file(also_show_last_update = :default) ⇒ Object

#

RBT.create_program_version_url_file

The boolean argument that can be passed to this method determines as to whether we will also show the time when the program has been last updated. By default this is true, meaning that we WILL show when a program has been last updated.

To invoke this method from the commandline, do:

rbt --create_program_version_url_file
#


248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/rbt/actions/individual_actions/information/create_program_version_url_file.rb', line 248

def self.create_program_version_url_file(
    also_show_last_update = :default # Since Feb 2018, we will show the last update by default.
  )
  if also_show_last_update and also_show_last_update.is_a?(Array) and
     also_show_last_update.empty?
    also_show_last_update = :default
  end
  case also_show_last_update # case tag
  # ========================================================================= #
  # === :also_show_last_update
  # ========================================================================= #
  when :also_show_last_update,
       :include_last_update,
       :default
    also_show_last_update = true
  end
  RBT::Action::CreateProgramVersionUrlFile.new {{ show_last_update: also_show_last_update }}
end

.create_programs_version_html_file(use_this_file = RBT.file_programs_version) ⇒ Object

#

RBT.create_programs_version_html_file

Commandline invocation example:

rbt --create_programs_version_html_file

The default input file can be found at:

/Depot/Temp/rbt/CookbookDirectory/programs_version_url.txt
#


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/rbt/toplevel_methods/html.rb', line 31

def self.create_programs_version_html_file(
    use_this_file =
      RBT.file_programs_version
  )
  updated_when = "#{RBT.return_date} #{RBT.return_time}"
  # ======================================================================= #
  # Generate a .html file.
  # ======================================================================= #
  if File.exist? use_this_file
    if use_this_file.end_with? '.yml'
      dataset = YAML.load_file(use_this_file)
      _ = ''.dup
      dataset.each_pair {|key, value|
        padded_key = ("#{key}:").ljust(50)
        _ << "  <b>#{padded_key} #{value}</b>\n"
      }
      dataset = _
    end
    dataset = '<html><title>Programs of Cookbooks Version: '+RBT.version?+
              ' Last updated: '+updated_when+
              '</title><body>
              Last update: <b>'+updated_when+'</b><br>
              <pre style="font-size: 1.4em">'+
              dataset+'</pre></body></html>'
    # ======================================================================= #
    # Store that file next:
    # ======================================================================= #
    use_this_file = "#{RBT.temp_directory?}programs_version.html"
    opn; e "Generating a new file at "\
           "`#{::Colours.sfile(use_this_file)}#{::Colours.rev}`."
    write_what_into(
      dataset, use_this_file
    ) # Store it here.
  else
    no_file_exists_at(use_this_file)
  end
end

.create_registered_tagsObject

#

RBT.create_registered_tags

This method can be used to create (aka update) the registered tags file - aka “registered_tags.yml”.

#


248
249
250
# File 'lib/rbt/registered/registered_tags.rb', line 248

def self.create_registered_tags
  RegisteredTags.new
end

.create_shell_script_containing_these_program_versionsObject

#

RBT.create_shell_script_containing_these_program_versions

#


222
223
224
# File 'lib/rbt/shell/create_shell_script_containing_these_program_versions.rb', line 222

def self.create_shell_script_containing_these_program_versions
  RBT::CreateShellScriptContainingTheseProgramsVersions.new
end

.create_simple_version_fileObject

#

RBT.create_simple_version_file

This method has been specifically created to allow the Java bindings in the RBT project to compile stuff.

#


590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 590

def self.create_simple_version_file
  hash = {}
  target_directory = RBT.base_dir_to_store_expanded_cookbooks?
  if File.directory? target_directory
    all_files = Dir[target_directory+'*.yml']
    all_files.each {|this_file|
      dataset = YAML.load_file(this_file)
      program_name = dataset[:program_name]
      program_path = dataset[:program_path]
      hash[program_name] = program_path
    }
    what = hash.map {|key, value| "#{key.downcase}: #{value}\n" }.join
    into = "#{log_dir?}simple_version_file.md"
    e "#{rev}Storing into `#{sfile(into)}`."
    write_what_into(what, into)
  else
    e "No directory at #{sdir(target_directory)}."
  end
end

.create_snapcraft_file(i) ⇒ Object

#

RBT.create_snapcraft_file

Simpler toplevel module-method for creating a snapcraft file.

#


434
435
436
# File 'lib/rbt/generate_files/create_snapcraft_file.rb', line 434

def self.create_snapcraft_file(i)
  RBT::CreateSnapcraftFile.new(i)
end

.crimson(i) ⇒ Object

#

RBT.crimson

#


90
91
92
93
# File 'lib/rbt/colours/html_colours.rb', line 90

def self.crimson(i)
  return COLOURS::HtmlColoursMethods.crimson(i) if use_colours?
  return i
end

.cyan(i) ⇒ Object

#

RBT.cyan

#


66
67
68
69
# File 'lib/rbt/colours/html_colours.rb', line 66

def self.cyan(i)
  return COLOURS::HtmlColoursMethods.cyan(i) if use_colours?
  return i
end

.debug?Boolean

#

RBT.debug?

Easier query-method as to whether we will debug or whether we will not.

#

Returns:

  • (Boolean)


28
29
30
# File 'lib/rbt/toplevel_methods/debug.rb', line 28

def self.debug?
  SHALL_WE_DEBUG
end

.debug_tracer(i = @debug_counter) ⇒ Object

#

RBT.debug_tracer

This method can be used to trace debug steps.

#


42
43
44
45
# File 'lib/rbt/toplevel_methods/debug.rb', line 42

def self.debug_tracer(i = @debug_counter)
  e steelblue('Debug-Step-'+i.to_s+': We are here, '\
    'at line '+__LINE__.to_s+'.')
end

.dependency_chain(of_this_program = ARGV) ⇒ Object

#

RBT.dependency_chain

This method will calculate the full dependency chain of all given programs.

Usage example:

dependencies = RBT.dependency_chain(%w( php ruby python )) # => ["httpd", "libxml2 >= 2.6.31", "mysql", "sqlite3", and more ...
#


339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 339

def self.dependency_chain(of_this_program = ARGV)
  array = []
  of_this_program = [of_this_program].flatten.compact
  # ======================================================================= #
  # Always work on an Array past this point.
  # ======================================================================= #
  of_this_program.each {|this_program|
    target_file = RBT.path_to_expanded_directory?+this_program+'.yml'
    if File.exist? target_file
      dataset = YAML.load_file(target_file)
      deps_on = dataset[:required_deps_on]
      array << deps_on
    end
  }
  # ======================================================================= #
  # Now we finished the first iteration. Add another iteration now.
  # ======================================================================= #
  new_array = []
  array.flatten!
  array.each {|inner_entry|
    if inner_entry.include? ' >'
      inner_entry = inner_entry.split(' >').first
    end
    inner_entry = RBT.path_to_expanded_directory?+inner_entry+'.yml'
    if File.exist? inner_entry
      dataset = YAML.load_file(inner_entry)
      deps_on = dataset[:required_deps_on]
      new_array << deps_on
    end
  }
  new_array.flatten!
  array << new_array
  array.flatten!
  array.uniq!
  return array
end

.depends_on_cmake?(i = nil) ⇒ Boolean

#

RBT.depends_on_cmake?

This method will only query the original cookbook-dataset, whether the project at hand depends on cmake or whether it does not.

#

Returns:

  • (Boolean)


55
56
57
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 55

def self.depends_on_cmake?(i = nil)
  i and i.include? 'cmake'
end

.depends_on_ninja?(i = nil) ⇒ Boolean

#

RBT.depends_on_ninja?

#

Returns:

  • (Boolean)


82
83
84
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 82

def self.depends_on_ninja?(i = nil)
  i and i.include? 'ninja'
end

.depends_on_python?(i = nil) ⇒ Boolean

#

RBT.depends_on_python?

Whether python is registered as a dependency.

#

Returns:

  • (Boolean)


75
76
77
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 75

def self.depends_on_python?(i = nil)
  i and i.include? 'python'
end

.depends_on_waf?(i = nil) ⇒ Boolean

#

RBT.depends_on_waf?

#

Returns:

  • (Boolean)


89
90
91
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 89

def self.depends_on_waf?(i = nil)
  i and i.include? 'waf'
end

.depot_directory?Boolean

#

RBT.depot_directory?

#

Returns:

  • (Boolean)


1184
1185
1186
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1184

def self.depot_directory?
  @depot_directory
end

.determine_appdir_prefix_from_this_input(name_of_the_program = 'htop', version_of_the_program = nil) ⇒ Object

#

RBT.determine_appdir_prefix_from_this_input

This method will return a String such as “/Programs/Htop/1.1.1/” or “/home/Programs/Htop/1.1.1/”.

Since as of August 2022, if the input includes a ‘/’ then no modification will be made. This is done primarily for compatibility reasons.

#


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/rbt/toplevel_methods/determine_appdir_prefix_from_this_input.rb', line 29

def self.determine_appdir_prefix_from_this_input(
    name_of_the_program    = 'htop',
    version_of_the_program = nil
  )
  if name_of_the_program.is_a? Array
    name_of_the_program = name_of_the_program.first
  end
  name_of_the_program = 'htop' if name_of_the_program.nil?
  if name_of_the_program and name_of_the_program.include?('/')
    return name_of_the_program # Return it here in this case.
  end
  new_prefix = ''.dup
  # ======================================================================= #
  # Append the "/Programs/" string next, or whatever else the user
  # designated as his or her programs-directory:
  # ======================================================================= #
  new_prefix << programs_directory? 
  if name_of_the_program.nil?
    e 'Please supply a valid argument to this method.'
    e
    e 'A valid input-argument may be:'
    e
    e '  foobar-1.0'
    e
    raise 'A program-name (String) is required.' 
  end
  # ======================================================================= #
  # === Safeguard against improper versions
  # ======================================================================= #
  if version_of_the_program.nil?
    if name_of_the_program.include?('-')
      version_of_the_program = ProgramInformation.return_version(name_of_the_program)
      name_of_the_program = ProgramInformation.return_name(name_of_the_program)
    else
      version_of_the_program = 'Current/'
    end
  end
  new_prefix << name_of_the_program.capitalize
  new_prefix << '/'
  if version_of_the_program
    new_prefix << "#{version_of_the_program}/"
  end
  return rds(new_prefix)
end

.determine_appdir_prefix_from_this_input_by_guessing_the_program_version(this_program) ⇒ Object

#

RBT.determine_appdir_prefix_from_this_input_by_guessing_the_program_version

This method is similar to the method defined in return_version_of_this_program.rb, but rather than using ‘Current/’ we will assume from the most current version in use of the program at hand (the first argument to this method).

#


19
20
21
22
23
24
25
26
# File 'lib/rbt/toplevel_methods/determine_appdir_prefix_from_this_input_by_guessing_the_program_version.rb', line 19

def self.determine_appdir_prefix_from_this_input_by_guessing_the_program_version(
    this_program
  )
  require 'rbt/toplevel_methods/return_version_of_this_program.rb'
  require 'rbt/toplevel_methods/determine_appdir_prefix_from_this_input.rb'
  use_this_version = RBT.return_version_of_this_program(this_program)
  return RBT.determine_appdir_prefix_from_this_input(this_program, use_this_version)
end

.determine_available_programs(load_which_dataset = :default) ⇒ Object

#

RBT.determine_available_programs

This method will determine how many .yml files exist in the cookbook directory at hand.

Always keep the result (alphabetically) sorted.

Note that if we use a sqlite database then we could use this instead.

#


332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 332

def self.determine_available_programs(
    load_which_dataset = :default
  )
  case load_which_dataset
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default,
       :raw_cookbook_directory
    target = "#{RBT.cookbook_directory?}*.yml"
    Dir[target].map {|entry|
      File.basename(entry.sub(/\.yml$/,''))
    }.sort
  end
end

.determine_host_architectureObject

#

RBT.determine_host_architecture

If you ever want to determine the host architecture, make use of this method here. This method will return a String, containing the host computer’s architecture. (x86_64 essentially means 64 bit binaries)

Invocation example:

RBT.determine_host_architecture # => "x86_64"
#


23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rbt/toplevel_methods/determine_host_architecture.rb', line 23

def self.determine_host_architecture
  # ======================================================================= #
  # We use uname to query the host architecture. This will thus
  # not work on Windows. An alternative would be to use:
  #   RbConfig::CONFIG['host']
  # This is now what we will use.
  # ======================================================================= #
  # this_architecture = `uname -m`.to_s.chomp
  this_architecture = RbConfig::CONFIG['host']
  if this_architecture.include? '-'
    this_architecture = this_architecture.split('-').first
  end
  return this_architecture
end

.directory_expanded_cookbooks?Boolean

#

RBT.directory_expanded_cookbooks?

On my home system, this method will return the following String:

"/home/Temp/rbt/expanded_cookbooks/"
#

Returns:

  • (Boolean)


897
898
899
# File 'lib/rbt/constants/constants.rb', line 897

def self.directory_expanded_cookbooks?
  "#{RBT.rbt_log_directory?}expanded_cookbooks/"
end

.directory_yaml_expanded_cookbooksObject

#

RBT.directory_yaml_expanded_cookbooks

On my home system, this may yield:

/usr/lib/ruby/site_ruby/3.0.0/rbt/yaml/expanded_cookbooks/
#


928
929
930
# File 'lib/rbt/constants/constants.rb', line 928

def self.directory_yaml_expanded_cookbooks
  "#{RBT.project_yaml_directory?}expanded_cookbooks/"
end

.disable_coloursObject

#

RBT.disable_colours

This method can be used to disable the use of colours for the whole RBT project.

#


47
48
49
# File 'lib/rbt/colours/use_colours.rb', line 47

def self.disable_colours
  @use_colours = false
end

.disable_md5sum_calculationObject

#

RBT.disable_md5sum_calculation

Use this method to disable the md5sum calculation altogether.

#


43
44
45
# File 'lib/rbt/toplevel_methods/md5sum.rb', line 43

def self.disable_md5sum_calculation
  @display_md5sum = false
end

.disable_opnObject

#

RBT.disable_opn

#


34
35
36
# File 'lib/rbt/toplevel_methods/opn.rb', line 34

def self.disable_opn
  @use_opn = false
end

.display_barplot_statisticsObject

#

RBT.display_barplot_statistics

#


71
72
73
# File 'lib/rbt/actions/individual_actions/statistics/display_barplot_statistics.rb', line 71

def self.display_barplot_statistics
  RBT::Action::Statistics::DisplayBarplotStatistics.new
end

.display_md5sum?Boolean

#

RBT.display_md5sum?

Tell us whether we will display the md5sum values or whether we will not.

#

Returns:

  • (Boolean)


34
35
36
# File 'lib/rbt/toplevel_methods/md5sum.rb', line 34

def self.display_md5sum?
  @display_md5sum
end

.do_install(this_program = ARGV) ⇒ Object

#

RBT.do_install

This could also use RBT::Action::SoftwareManager.compile().

#


13224
13225
13226
# File 'lib/rbt/actions/individual_actions/software_manager/misc.rb', line 13224

def self.do_install(this_program = ARGV)
  action(:SoftwareManager, this_program)
end

.do_not_register_into_the_yaml_databaseObject

#

RBT.do_not_register_into_the_yaml_database

#


58
59
60
# File 'lib/rbt/utility_scripts/register_program_files_into_yaml_database.rb', line 58

def self.do_not_register_into_the_yaml_database
  @register_program_files_into_yaml_database = false
end

.do_not_show_namesObject

#

RBT.do_not_show_names

#


45
46
47
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 45

def self.do_not_show_names
  @show_names = false
end

.do_not_show_names?Boolean

#

RBT.do_not_show_names?

This is the reverse complement to RBT.show_the_classname?.

#

Returns:

  • (Boolean)


165
166
167
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 165

def self.do_not_show_names?
  !RBT.show_the_classname?
end

.do_not_show_the_classnameObject

#

RBT.do_not_show_the_classname

#


147
148
149
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 147

def self.do_not_show_the_classname
  @do_show_the_classname = false
end

.do_show_the_classnameObject

#

RBT.do_show_the_classname

#


135
136
137
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 135

def self.do_show_the_classname
  @do_show_the_classname = true
end

.dodgerblue(i) ⇒ Object

#

RBT.dodgerblue

#


58
59
60
61
# File 'lib/rbt/colours/html_colours.rb', line 58

def self.dodgerblue(i)
  return COLOURS::HtmlColoursMethods.dodgerblue(i) if use_colours?
  return i
end

.does_include_this_binary?(i, perform_a_deep_check = false) ⇒ Boolean

#

RBT.does_include_this_binary?

This will return true if we have a binary with that name.

Usage examples:

RBT.does_include_this_binary? 'xxd'
RBT.has_this_binary? 'xzcmp'
#

Returns:

  • (Boolean)


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/rbt/toplevel_methods/all_binaries.rb', line 69

def self.does_include_this_binary?(
    i, perform_a_deep_check = false
  )
  all_binaries = all_binaries?
  # ======================================================================= #
  # This entry point is for checking input such as "matescreenshot",
  # which could be "mate-screenshot". Note that as of January 2020
  # this is only enabled for binaries - not sure if we need to enable
  # this for other input-type as well, but binaries make the most
  # sense.
  # ======================================================================= #
  if perform_a_deep_check
    all_binaries.transform_keys! {|entry| entry.delete('-') }
  end
  all_binaries.has_key?(i)
end

.does_include_this_library?(i) ⇒ Boolean

#

RBT.does_include_this_library?

This will return true if we have a binary with that name.

Usage example:

RBT.does_include_this_library? 'libc.so'
RBT.has_this_library? 'xzcmp'
RBT.is_this_library_included? 'xzcmp'
#

Returns:

  • (Boolean)


93
94
95
# File 'lib/rbt/toplevel_methods/does_include.rb', line 93

def self.does_include_this_library?(i)
  all_libraries?.has_key?(i)
end

.does_this_cookbook_file_have_any_erroneous_entry?(this_file = "#{RUBY_SRC_RBT_COOKBOOKS}jasper.yml") ⇒ Boolean

#

RBT.does_this_cookbook_file_have_any_erroneous_entry?

This method will return a boolen value - true or false.

If true then the cookbook file in question has had an erroneous entry.

#

Returns:

  • (Boolean)


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rbt/toplevel_methods/check_this_cookbook_file_for_errors.rb', line 27

def self.does_this_cookbook_file_have_any_erroneous_entry?(
    this_file = "#{RUBY_SRC_RBT_COOKBOOKS}jasper.yml"
  )
  if this_file.is_a? Array
    this_file = this_file.first
  end
  if this_file.nil?
    this_file = "#{RUBY_SRC_RBT_COOKBOOKS}jasper.yml"
  end
  if File.exist? this_file
    registered_cookbook_entries = RBT.registered_cookbook_entries?
    dataset = YAML.load_file(this_file)
    key = dataset.keys.first
    available_entries_from_the_cookbooks_file = dataset[key].keys
    # ===================================================================== #
    # Next, obtain the entries that were not registered. Keep in mind
    # that this Array may be entry.
    # ===================================================================== #
    these_entries_were_not_registered = available_entries_from_the_cookbooks_file.reject {|entry|
      registered_cookbook_entries.include? entry
    }
    !these_entries_were_not_registered.empty?
  else
    false # You have to ensure that the file exists on your own.
  end
end

.does_this_file_exist?(i = FILE_SCONS, prepend_this_for_the_check = nil) ⇒ Boolean

#

RBT.does_this_file_exist?

This method will check whether a given file exists or whether it does not.

The second argument can be used to determine whether we shall use a file at a particular position on the filesystem, e. g. like ‘../include/’ that can be passed. This would check for the file at the directory below the current one, within the include/ subdirectory.

#

Returns:

  • (Boolean)


267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 267

def self.does_this_file_exist?(
    i                          = FILE_SCONS,
    prepend_this_for_the_check = nil
  )
  if i.is_a? Array
    i = i.first
  end
  i = i.to_s unless i.is_a? String # We need a String past this point.
  if prepend_this_for_the_check
    unless prepend_this_for_the_check.is_a? String
      if prepend_this_for_the_check == true
        # ================================================================= #
        # true values are converted into '../' strings.
        # ================================================================= #
        prepend_this_for_the_check = '../'.dup
      end
    end
    i = i.dup.prepend(
      prepend_this_for_the_check.dup
    )
  end
  File.exist? i
end

.does_this_file_exist_and_is_it_a_file?(i) ⇒ Boolean

#

RBT.does_this_file_exist_and_is_it_a_file?

This method will add an additional File.file? check.

#

Returns:

  • (Boolean)


735
736
737
738
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 735

def self.does_this_file_exist_and_is_it_a_file?(i)
  i = i.to_s
  does_this_file_exist?(i) && File.file?(i)
end

.does_this_remote_url_exist?(i) ⇒ Boolean

#

RBT.does_this_remote_url_exist?

This method will make use of class Wget to query whether a remote URL exists.

To test this method, try:

i = 'https://github.com/linuxwacom/libwacom/releases/download/libwacom-1.6/libwacom-1.6.tar.bz2'
RBT.does_this_remote_url_exist? i
#

Returns:

  • (Boolean)


132
133
134
# File 'lib/rbt/toplevel_methods/url.rb', line 132

def self.does_this_remote_url_exist?(i)
  Wget.check_if_remote_file_exists(i)
end

.does_this_yaml_file_have_two_url1_entries?(i) ⇒ Boolean

#

RBT.does_this_yaml_file_have_two_url1_entries?

#

Returns:

  • (Boolean)


403
404
405
# File 'lib/rbt/actions/individual_actions/checks_and_validations/check_for_invalid_entries_in_this_cookbook.rb', line 403

def self.does_this_yaml_file_have_two_url1_entries?(i)
  RBT.check_whether_this_yaml_file_has_two_url1_entries(i) == true
end

.download(i = ARGV, optional_use_this_version = nil) ⇒ Object

#

RBT.download

This method can be used to download a remote source archive, if the argument is a symbol. Additionally direct URLs can also be given.

The second argument is optional. If given then the method will attempt to download only a specific version from the remote location. In order for this to work, the method may first have to “probe” whether the remote file exists. For this functionality, wget it used.

In general the method depends on “wget”, largely due to reasons of simplicity.

Invocation examples:

RBT.download :htop
RBT.download :php
RBT.download :libx11
#


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/rbt/toplevel_methods/download.rb', line 35

def self.download(
    i                         = ARGV,
    optional_use_this_version = nil
  )
  # ======================================================================= #
  # Treat all input as an Array.
  # ======================================================================= #
  i = [i].flatten.compact
  i.each {|remote_url|
    # ===================================================================== #
    # === Handle symbols next
    #
    # Symbols will be treated differently, as we can assume that a user
    # normally would not pass in a Symbol to the method. So if we see
    # a Symbol, then we can also handle this situation in a special
    # manner.
    # ===================================================================== #
    if remote_url.is_a? Symbol
      case remote_url
      # =================================================================== #
      # === :pwd
      # =================================================================== #
      when :pwd # This is special - we will take the dirname.
        remote_url = File.basename(return_pwd).to_s
        if Object.const_defined?(ProgramInformation) and
          (remote_url =~ /\d+/) # ← And if it has at the least one number.
          remote_url = ProgramInformation.return_short_name(remote_url)
        end
        remote_url = remote_url.delete('-').to_sym
      end
      # RBT.location_of?() is available in rbt/toplevel_methods/url.rb
      remote_url = RBT.location_of?(remote_url) # ← This should return an Array.
      if remote_url.is_a? Array
        remote_url = remote_url.first
      end
    end
    # ===================================================================== #
    # Next, honour the situation where the user wants to specifically
    # download a specific version of a program.
    # ===================================================================== #
    if optional_use_this_version
      if optional_use_this_version.is_a? Hash
        if optional_use_this_version.has_key? :version
          optional_use_this_version = optional_use_this_version[:version]
        end
      end
      _ = optional_use_this_version
      # =================================================================== #
      # else it does not exist, so we try other archive formats. This
      # will be handled by the following Array.
      # =================================================================== #
      array_formats_to_check_for = %w(
        .tar.xz
        .tar.gz
        .tar.bz2
      )
      # =================================================================== #
      # The old URL will already be available in the variable remote_url.
      # =================================================================== #
      remote_url = RBT.return_remote_url_from_this_input(
        remote_url, optional_use_this_version
      )
      require 'wget'
      if Wget.check_if_remote_file_exists(remote_url)
        array_formats_to_check_for = [] # Clear it here.
      else
        # ================================================================= #
        # We reject the ones that we already have checked before:
        # ================================================================= #
        array_formats_to_check_for.reject! {|entry|
          remote_url.end_with? entry
        }
        unless array_formats_to_check_for.empty?
          array_formats_to_check_for.each {|inner_entry|
            if Wget.check_if_remote_file_exists(inner_entry)
              # =========================================================== #
              # The next check is not ideal, but it may suffice for now.
              # After all we only need at the least one remote URl that
              # can be used.
              # =========================================================== #
              remote_url = inner_entry
            end
          }
        end
      end
    end
    if remote_url.empty?
      e "#{rev}The given #{crimson('URL')} was not found - "\
        "thus, no download can occur."
    else
      e "#{rev}Next downloading from the remote "\
        "URL `#{sfancy(remote_url)}#{rev}`."
      use_this_command = "wget #{remote_url}"
      e use_this_command
      result = `#{use_this_command} 2>&1`
      if result.include? 'ERROR 404: Not Found'
        e "#{rev}No archive/program was found at the remote url #{remote_url}."
      end
      if File.exist? File.basename(remote_url)
        e "#{rev}Success! The file can be found at `"\
          "#{sfile(
            File.absolute_path(File.basename(remote_url))
          )}#{rev}`."
      end
    end
  }
end

.download_all_source_archives(i = ARGV) ⇒ Object

#

RBT.download_all_source_archives

This is a tiny wrapper-method that allows the user to download all registered source archives.

#


149
150
151
# File 'lib/rbt/toplevel_methods/download.rb', line 149

def self.download_all_source_archives(i = ARGV)
  action(:DownloadAllSourceArchives, i)
end

.dual_compile(this_program = ARGV) ⇒ Object

#

RBT.dual_compile

This method will first compile a program in the traditional manner, via the prefix /usr, before it will compile the same program again via its AppDir prefix.

#


17
18
19
20
21
22
23
24
# File 'lib/rbt/toplevel_methods/dual_compile.rb', line 17

def self.dual_compile(
    this_program = ARGV
  )
  [this_program].flatten.compact.each {|entry|
    action(:Installer, entry) {{ use_this_prefix: :trad   }} # (1) First  compilation run.
    action(:Installer, entry) {{ use_this_prefix: :appdir }} # (2) Second compilation run.
  }
end

.e(i = '') ⇒ Object

#

RBT.e

This method is just a little (short) wrapper over puts.

#


46
47
48
# File 'lib/rbt/toplevel_methods/e_and_esystem.rb', line 46

def self.e(i = '')
  puts i
end

.editor?(i = @use_this_editor) ⇒ Boolean

#

RBT.editor?

#

Returns:

  • (Boolean)


38
39
40
41
42
# File 'lib/rbt/toplevel_methods/editor.rb', line 38

def self.editor?(
    i = @use_this_editor
  )
  return i
end

.efancy(i = '') ⇒ Object

#

RBT.efancy

#


162
163
164
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 162

def self.efancy(i = '')
  e sfancy(i)
end

.eimp(i = '', use_colours = RBT.use_colours?) ⇒ Object

#

RBT.eimp

#


188
189
190
191
192
193
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 188

def self.eimp(
    i           = '',
    use_colours = RBT.use_colours?
  )
  e RBT.simp(i, use_colours)
end

.email?Boolean

#

RBT.email?

#

Returns:

  • (Boolean)


321
322
323
324
325
326
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 321

def self.email?
  begin
    require 'rbt/configuration/configuration.rb'
  rescue LoadError; end
  RBT.configuration?.email.to_s
end

.enable_md5sum_calculationObject

#

RBT.enable_md5sum_calculation

Use this method to disable the md5sum calculation altogether.

#


52
53
54
# File 'lib/rbt/toplevel_methods/md5sum.rb', line 52

def self.enable_md5sum_calculation
  @display_md5sum = true
end

.enable_module_programs(also_add_reader_methods = true) ⇒ Object

#

RBT.enable_module_programs

This method will be invoked when we require the cookbooks project in a special manner.

We add the individual cookbooks onto the Cookbooks. namespace directly there.

This will then allow us to call methods such as:

RBT.htop

Do note that we will also radically override already existing methods, so this is functionality that should be used with care.

Testing this method can happen either like this:

RBT.enable_module_programs; RBT.htop
require 'rbt/module_programs'; htop = RBT.htop
require 'rbt/toplevel_methods/module_programs.rb'; RBT.enable_module_programs; htop = RBT.htop.hash?
#


34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/rbt/toplevel_methods/module_programs.rb', line 34

def self.enable_module_programs(
    also_add_reader_methods = true
  )
  require 'rbt/requires/require_actions.rb'
  require 'rbt/requires/require_the_cookbook_class.rb'
  available_programs?.each {|this_program|
    self.class.class_eval {
      _ = this_program.to_sym
      if respond_to? _
        # This here happens when we enable the methods.
        # This is just here as a placeholder, if we ever want
        # to debug this.
      else
        # ::RBT.e 'Defining the method `'+_.to_s+'` next.' # <- This is more o a debug-statement.
        define_method(_) { # Simply delegate to class Cookbook then.
          action(:sanitize_cookbook, this_program, :fast)
        }
        # ================================================================= #
        # We will additionally add reader-methods, if the argument is
        # set to true. These reader methods will directly return the
        # dataset, as a Hash.
        #
        # This can be tested like so in IRB:
        #
        #   require 'rbt/module_programs'; x = RBT.htop.hash?
        #
        # ================================================================= #
        if also_add_reader_methods
          define_method("#{_}?") { # Simply delegate to class Cookbook then.
            action(:sanitize_cookbook, this_program, :fast).hash?
          }
        end
      end
    }
  }
end

.enable_opnObject

#

RBT.enable_opn

#


41
42
43
# File 'lib/rbt/toplevel_methods/opn.rb', line 41

def self.enable_opn
  @use_opn = true
end

.encoding?Boolean

#

RBT.encoding?

Query-method to ask which main encoding is in use for the RBT suite.

#

Returns:

  • (Boolean)


35
36
37
# File 'lib/rbt/encoding/encoding.rb', line 35

def self.encoding?
  USE_THIS_ENCODING
end

.ensure_that_the_required_directories_exist(use_this_as_directory = RBT.store_into_this_directory?, be_verbose = false) ⇒ Object

#

RBT.ensure_that_the_required_directories_exist

This method ensures that the base-directory exists.

This can also be invoked from the commandline, by issuing:

rbt --ensure-that-the-required-directories-exist
#


273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 273

def self.ensure_that_the_required_directories_exist(
    use_this_as_directory = RBT.store_into_this_directory?,
    be_verbose            = false
  )
  if block_given?
    yielded = yield
    case yielded
    when :be_verbose
      be_verbose = true
    when :be_quiet
      be_verbose = false
    end
  end
  if Dir.exist?(use_this_as_directory)
    if be_verbose
      opn; e "The directory at `#{use_this_as_directory}` "\
             "already exists."
    end
  else
    target = File.dirname(use_this_as_directory)
    if File.writable?(target)
      require 'fileutils'
      opn; e "Creating directory `#{use_this_as_directory}`."
      FileUtils.mkdir_p(use_this_as_directory)
    else
      e "Can not write into the directory "\
        "`#{use_this_as_directory}` as it is not writable. "\
        "Consider using"
      e 'another setting for temp_directory.yml perhaps.'
      e
      e 'This file can be found here:'
      e
      e "  #{file_temp_directory}"
      e
    end
  end
end

.error_message?Boolean

#

RBT.error_message?

#

Returns:

  • (Boolean)


28
29
30
# File 'lib/rbt/toplevel_methods/error_message.rb', line 28

def self.error_message?
  @error_message
end

.esystem(i = '', use_this_colour = nil) ⇒ Object

#

RBT.esystem

This method will output which system-command will be run; and then this command will be run, via system().

The argument to this method determines the system command at hand.

#


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/rbt/toplevel_methods/e_and_esystem.rb', line 17

def self.esystem(
    i               = '',
    use_this_colour = nil
  )
  if i.is_a? Array
    i.each {|entry| esystem(entry) }
  else
    if use_this_colour
      case use_this_colour
      # =================================================================== #
      # === :fancy_colours
      # =================================================================== #
      when :fancy_colours
        use_this_colour = :mediumslateblue
      end
      e ::Colours.send(use_this_colour, i)+
        ::Colours.rev
    else
      e i
    end
    system i
  end
end

.ewarn(i = '') ⇒ Object

#

RBT.ewarn

#


139
140
141
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 139

def self.ewarn(i = '')
  e ::RBT.swarn(i)
end

.expand_cookbooks(i = ARGV, &block) ⇒ Object

#

RBT.expand_cookbooks

The first argument to this method should be the program-name whose .yml file we wish to autogenerate, such as ‘subversion’ or ‘htop’ or ‘ruby’.

It will then be expanded to its full, correct dataset.

#


293
294
295
296
297
298
# File 'lib/rbt/actions/individual_actions/cookbooks/expand_cookbooks/expand_cookbooks.rb', line 293

def self.expand_cookbooks(
    i = ARGV,
    &block
  )
  return RBT::Action::Cookbooks::ExpandCookbooks.new(i, &block)
end

.expanded_cookbook(i = ARGV, &block) ⇒ Object

#

RBT.expanded_cookbook

#


103
104
105
106
107
108
# File 'lib/rbt/actions/individual_actions/cookbooks/expanded_cookbook/expanded_cookbook.rb', line 103

def self.expanded_cookbook(
    i = ARGV,
    &block
  )
  return RBT::Action::Cookbooks::ExpandedCookbook.new(i, &block)
end

.extract(optional_argument1, extract_to = :default, &block) ⇒ Object

#

RBT.extract

This toplevel-method can be used to extract an archive, such as “foobar-1.2.3.tar.xz”.

The functionality depends on the gem called extracter, so users have to install that gem - for instance via “gem install extracter”.

The second argument to this method should be the target directory onto which the archive will be extracted to. So, for instance, if the argument is ‘/tmp/’, then the archive will be extracted right into that directory.

Usage examples:

RBT.extract(ARGV)
RBT.extract('/tmp/foobar-1.0.tar.xz','/Depot/j/')
#


279
280
281
282
283
284
285
286
287
288
# File 'lib/rbt/actions/individual_actions/extract/extract.rb', line 279

def self.extract(
    optional_argument1,
    extract_to = :default, # Where to extract the archive at hand.
    &block
  )
  _ = RBT::Action::Extract.new(:do_not_run_yet, &block)
  _.set_extract_this_program(optional_argument1)
  _.invoke_class_extracter(:default_programs, extract_to)
  return _
end

.fast_return_file_size_of_this_program(i, use_this_as_database_backend = :use_the_expanded_cookbooks) ⇒ Object

#

RBT.fast_return_file_size_of_this_program

This method will quickly return the file size of the given input program. It relies on the expanded cookbook dataset for this.

Invocation example from ruby:

RBT.fast_return_file_size_of_this_program(:htop) # => 213004
#


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/rbt/toplevel_methods/fast_return_file_size_of_this_program.rb', line 26

def self.fast_return_file_size_of_this_program(
    i,
    use_this_as_database_backend = :use_the_expanded_cookbooks
  )
  use_this_as_the_key = :archive_size
  if i.is_a? Array
    i = i.join(' ').strip
  end
  i = i.to_s unless i.is_a? String
  case use_this_as_database_backend
  # ======================================================================= #
  # === :default
  #
  # This is the default entry point. We will use the expanded cookbooks.
  # ======================================================================= #
  when :default,
       :use_the_expanded_cookbooks
    base_dir_to_store_expanded_cookbooks = RBT.base_dir_to_store_expanded_cookbooks?
    if File.directory? base_dir_to_store_expanded_cookbooks
      # =================================================================== #
      # Obtain the path to the expanded-cookbook .yml file next.
      # =================================================================== #
      target_file = "#{base_dir_to_store_expanded_cookbooks}#{i}.yml"
      if File.exist? target_file
        dataset = YAML.load_file(target_file)
        archive_size = dataset[use_this_as_the_key]
        return archive_size
      else
        no_file_exists_at(target_file)
      end
    else
      e "#{rev}No directory exists at "\
        "#{base_dir_to_store_expanded_cookbooks}"
    end
  # ======================================================================= #
  # === :SQL
  #
  # This entry point was added in August 2022, to support sqlite databases.
  # ======================================================================= #
  when :SQL,
       :sql,
       :use_sqlite
    unless RBT.const_defined?(:CompileViaSQLDatabase)
      require 'rbt/requires/require_compile_via_sql_database.rb'
    end
    location_of_the_database = RBT::CompileViaSQLDatabase.location_of_the_database?
    result = `sqlite3 #{location_of_the_database} "select * from REGISTERED_PROGRAMS where PROGRAM_NAME = '#{i}';"`
    if result.include? '|'
      splitted = result.split('|')
      # The stored file size is at position 11.
      return splitted[11].to_i
    end
  end
end

.favicon?Boolean

#

RBT.favicon?

This is currently hardcoded. Users of RBT will not need this image, so it is ok to use a hardcoded path.

#

Returns:

  • (Boolean)


616
617
618
619
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 616

def self.favicon?
  '/home/x/programming/ruby/src/rbt/img/'\
  'COOKBOOKS_LOGO.png'
end

.feedback_available_programsObject

#

RBT.feedback_available_programs

This method will report to the user, in a more verbose manner, which specific programs are registered in the RBT-project.

#


310
311
312
313
314
315
316
317
318
319
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 310

def self.feedback_available_programs
  result = ''.dup # Build up the return String.
  opn; e "Feedbacking all available programs next,"\
         " #{available_programs.size} of them."
  available_programs?.each_with_index {|entry, index|
    index += 1
    result << "(#{simp(index.to_s.rjust(3))}) #{sfancy(entry)}#{N}"
  }
  e result
end

.feedback_description_of(i = ARGV) ⇒ Object

#

RBT.feedback_description_of

#


69
70
71
# File 'lib/rbt/actions/individual_actions/information/feedback_description_of.rb', line 69

def self.feedback_description_of(i = ARGV)
  RBT::Action::Cookbooks::FeedbackDescriptionOf.new(i)
end

.feedback_description_of_via_sanitize_cookbook(i) ⇒ Object

#

RBT.feedback_description_of_via_sanitize_cookbook

Delegate towards the method .feedback_description_of().

Invocation example:

RBT.feedback_description_of(:htop)
#


6345
6346
6347
6348
6349
# File 'lib/rbt/actions/individual_actions/cookbooks/sanitize_cookbook/sanitize_cookbook.rb', line 6345

def self.feedback_description_of_via_sanitize_cookbook(i)
  i = i.first if i.is_a? Array
  _ = RBT::Action::Cookbooks::SanitizeCookbook.new(i)
  _.feedback_description
end

.feedback_licenses(i = ARGV) ⇒ Object

#

RBT.feedback_licenses

#


175
176
177
# File 'lib/rbt/cookbooks/feedback_licenses.rb', line 175

def self.feedback_licenses(i = ARGV)
  RBT::Cookbooks::FeedbackLicenses.new(i)
end

.feedback_program_description(i = ARGV) ⇒ Object

#

RBT.feedback_program_description

This method will feedback the description of the program at hand, on the commandline. By default it will make use of the expanded dataset, by using :fast. If you want to make use of the simple dataset that may have to be sanitized (and thus will be slower), change this to :slow instead.

#


21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rbt/toplevel_methods/feedback_program_description.rb', line 21

def self.feedback_program_description(
    i = ARGV
  )
  require 'rbt/actions/actions.rb'
  i = i.first if i.is_a? Array
  raw_cookbook = action(:raw_cookbook, i) { :use_the_expanded_dataset }
  hash = raw_cookbook.hash?
  # ======================================================================= #
  # Note that the key is a Symbol, at the least since as of May 2022.
  # ======================================================================= #
  use_this_key = 'description'.to_sym
  description = hash[use_this_key]
  e RBT.wrap_at(description.lstrip, 80)
end

.feedback_url(i = ARGV) ⇒ Object

#

RBT.feedback_url

#


67
68
69
# File 'lib/rbt/cookbooks/display_cookbook_dataset/feedback/feedback_url.rb', line 67

def self.feedback_url(i = ARGV)
  RBT::Cookbooks::DisplayCookbookDataset::Feedback.feedback_url
end

.file_abbreviations(project_yaml_directory = RBT.project_yaml_directory?) ⇒ Object

#

RBT.file_abbreviations

Note that this file will store only abbreviations to the programs, not the name of the program at hand.

On my home system this file may reside here:

/home/x/programming/ruby/src/rbt/lib/rbt/yaml/abbreviations_to_the_programs/abbreviations_to_the_programs.yml
#


194
195
196
197
198
199
# File 'lib/rbt/constants/constants.rb', line 194

def self.file_abbreviations(
    project_yaml_directory = RBT.project_yaml_directory?
  )
  "#{project_yaml_directory}"\
  "abbreviations_to_the_programs/abbreviations_to_the_programs.yml"
end

.file_allowed_tagsObject

#

RBT.file_allowed_tags

This method will return the path to the allowed_tags (a yaml file).

#


684
685
686
# File 'lib/rbt/constants/constants.rb', line 684

def self.file_allowed_tags
  "#{RBT.project_yaml_directory?}specification/allowed_tags.yml"
end

.file_available_programsObject

#

RBT.file_available_programs

#


885
886
887
# File 'lib/rbt/constants/constants.rb', line 885

def self.file_available_programs
  "#{RBT.project_yaml_directory?}available_programs/available_programs.yml"
end

.file_available_programs_versionsObject

#

RBT.file_available_programs_versions

#


753
754
755
# File 'lib/rbt/constants/constants.rb', line 753

def self.file_available_programs_versions
  "#{RBT.project_yaml_directory?}programs_version/available_programs_versions.md"
end

.file_base_template_for_cookbook_yaml_filesObject

#

RBT.file_base_template_for_cookbook_yaml_files

This constant specifies the path to the base-template file that can be used for creating new .yml files, for the RBT::Cookbooks namespace.

This used to be the constant FILE_BASE_TEMPLATE_FOR_COOKBOOK_YAML_FILES until August 2022.

#


841
842
843
844
# File 'lib/rbt/constants/constants.rb', line 841

def self.file_base_template_for_cookbook_yaml_files
  "#{RBT.project_base_directory?}cookbooks/"\
  "template/base_template_for_cookbook_yaml_files.md"
end

.file_build_system_prioritiesObject

#

RBT.file_build_system_priorities

#


778
779
780
781
# File 'lib/rbt/constants/constants.rb', line 778

def self.file_build_system_priorities
  "#{RBT.project_yaml_directory?}"\
  "build_systems_priorities/build_systems_priorities.yml"
end

.file_coloursObject

#

RBT.file_colours

This method will point to the .yml file that users can modify if they want to use different colours.

#


37
38
39
# File 'lib/rbt/colours/use_colours.rb', line 37

def self.file_colours
  "#{RBT.project_yaml_directory?}colours/colours.yml"
end

.file_compiled_programsObject

#

RBT.file_compiled_programs

This method will return a location such as “/Depot/Temp/rbt/compiled_programs.yml”.

Note that from this you can also obtain the “last compiled program”.

#


153
154
155
# File 'lib/rbt/configuration/configuration.rb', line 153

def self.file_compiled_programs
  "#{RBT.rbt_log_directory?}compiled_programs.yml"
end

.file_compiled_programs?Boolean

#

RBT.file_compiled_programs?

Specify the target location for the compiled_programs.yml file.

#

Returns:

  • (Boolean)


124
125
126
# File 'lib/rbt/configuration/configuration.rb', line 124

def self.file_compiled_programs?
  "#{RBT.rbt_log_directory?}compiled_programs.yml"
end

.file_configure_database?Boolean

#

RBT.file_configure_database?

#

Returns:

  • (Boolean)


115
116
117
# File 'lib/rbt/configuration/configuration.rb', line 115

def self.file_configure_database?
  "#{RBT.rbt_log_directory?}configure_command_database.yml"
end

.file_cookbook_aliasesObject

#

RBT.file_cookbook_aliases

Simply return where the cookbook_aliases.yml file resides.

This is, for instance, here:

/Programs/Ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rbt/yaml/cookbook_aliases.yml
#


647
648
649
# File 'lib/rbt/constants/constants.rb', line 647

def self.file_cookbook_aliases
  "#{RBT.project_yaml_directory?}cookbook_aliases/cookbook_aliases.yml"
end

.file_cookbook_chained_programsObject

#

RBT.file_cookbook_chained_programs

This is the preferred way to determine where the file “cookbook_chained_programs.yml” can be found.

On my home system in April 2021, this yielded the following path:

/usr/lib/ruby/site_ruby/3.0.0/rbt/yaml/chained_programs/chained_programs.yml
#


916
917
918
# File 'lib/rbt/constants/constants.rb', line 916

def self.file_cookbook_chained_programs
  "#{RBT.project_yaml_directory?}chained_programs/chained_programs.yml"
end

.file_database_installed_filesObject

#

RBT.file_database_installed_files

On my system, this will be at:

/Depot/Information/database_installed_files.yml
#


101
102
103
# File 'lib/rbt/configuration/configuration.rb', line 101

def self.file_database_installed_files
  "#{YAML_DATABASE_DIRECTORY}database_installed_files.yml"
end

.file_debugObject

#

RBT.file_debug

This method will refer to the debug.yml file.

#


670
671
672
# File 'lib/rbt/constants/constants.rb', line 670

def self.file_debug
  "#{RBT.configuration_directory?}debug.yml"
end

.file_global_flagsObject

#

RBT.file_global_flags

#


812
813
814
# File 'lib/rbt/constants/constants.rb', line 812

def self.file_global_flags
  "#{RBT.project_yaml_directory?}global_flags.yml"
end

.file_installation_procedereObject

#

RBT.file_installation_procedere

This may refer to the path of the file called ‘installation_procedere.yml’.

#


770
771
772
773
# File 'lib/rbt/constants/constants.rb', line 770

def self.file_installation_procedere
  "#{RBT.project_yaml_directory?}"\
  "installation_procedere/installation_procedere.yml"
end

.file_is_on_gobolinuxObject

#

RBT.file_is_on_gobolinux

This file may be generated by RBT if you issue any of the following commands:

rbt --is-on-gobolinux
rbt --isongobolinux
rbt isongobolinux
#


944
945
946
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 944

def self.file_is_on_gobolinux
  "#{RBT.log_directory?}is_on_gobolinux"
end

.file_last_compiled_programObject

#

RBT.file_last_compiled_program

#


980
981
982
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 980

def self.file_last_compiled_program
  "#{RBT.log_directory?}last_compiled_programs.yml"
end

.file_last_symlinked_program?Boolean

#

RBT.file_last_symlinked_program?

#

Returns:

  • (Boolean)


973
974
975
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 973

def self.file_last_symlinked_program?
  "#{RBT.log_directory?}last_symlinked_program.yml"
end

.file_ldd_dataset?Boolean

#

RBT.file_ldd_dataset?

#

Returns:

  • (Boolean)


140
141
142
# File 'lib/rbt/utility_scripts/simplified_ldd_output.rb', line 140

def self.file_ldd_dataset?
  "#{RBT.log_dir?}sanitized_ldd_dataset.yml"
end

.file_meson_buildObject

#

RBT.file_meson_build

#


89
90
91
# File 'lib/rbt/constants/constants.rb', line 89

def self.file_meson_build
  FILE_MESON_BUILD
end

.file_predefined_installation_instructions(use_this_directory = RBT.project_yaml_directory?) ⇒ Object

#

RBT.file_predefined_installation_instructions

Method to return where the file location is. There used to be a constant available called FILE_PREDEFINED_INSTALLATION_INSTRUCTIONS but this was removed in January 2019.

#


31
32
33
34
35
36
37
# File 'lib/rbt/constants/predefined_installation_instructions.rb', line 31

def self.file_predefined_installation_instructions(
    use_this_directory = 
      RBT.project_yaml_directory?
  ) 
  "#{use_this_directory}"\
  "predefined_installation_instructions/predefined_installation_instructions.yml"
end

.file_programs_directoryObject

#

RBT.file_programs_directory

#


861
862
863
# File 'lib/rbt/constants/constants.rb', line 861

def self.file_programs_directory
  "#{RBT.project_yaml_directory?}configuration/programs_directory.yml"
end

.file_programs_versionObject

#

RBT.file_programs_version

#


661
662
663
# File 'lib/rbt/constants/constants.rb', line 661

def self.file_programs_version
  "#{RBT.project_yaml_directory?}programs_version/programs_version.yml"
end

.file_programs_version_urlObject

#

RBT.file_programs_version_url

This is the path to the .md file that keeps track of the programs-version and URL entries.

#


966
967
968
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 966

def self.file_programs_version_url
  "#{RBT.log_dir?}CookbookDirectory/programs_version_url.md"
end

.file_registered_binariesObject

#

RBT.file_registered_binaries

This method should be used preferentially, rather than the older constant.

#


93
94
95
# File 'lib/rbt/toplevel_methods/all_binaries.rb', line 93

def self.file_registered_binaries
  "#{RBT.yaml_directory_for_the_registered_yaml_files?}binaries.yml"
end

.file_registered_cookbook_entries(use_this_directory = yaml_directory? ) ⇒ Object

#

RBT.file_registered_cookbook_entries

Tell use where the file registered_cookbook_entries.yml is stored.

On my home system this may return a String such as:

/home/Programs/Ruby/2.7.1/lib/ruby/site_ruby/2.7.0/rbt/yaml/specification/registered_cookbook_entries.yml
#


600
601
602
603
604
# File 'lib/rbt/constants/constants.rb', line 600

def self.file_registered_cookbook_entries(
    use_this_directory = yaml_directory?
  )
  "#{use_this_directory}specification/registered_cookbook_entries.yml"
end

.file_registered_gir_filesObject

#

RBT.file_registered_gir_files

#


29
30
31
# File 'lib/rbt/registered/registered_gir_files.rb', line 29

def self.file_registered_gir_files
  FILE_REGISTERED_GIR_FILES
end

.file_registered_headersObject

#

RBT.file_registered_headers

#


878
879
880
# File 'lib/rbt/constants/constants.rb', line 878

def self.file_registered_headers
  "#{RBT.project_yaml_directory?}registered/headers.yml"
end

.file_registered_librariesObject

#

RBT.file_registered_libraries

#


40
41
42
# File 'lib/rbt/toplevel_methods/all_libraries.rb', line 40

def self.file_registered_libraries
  "#{RBT.yaml_directory_for_the_registered_yaml_files?}libraries.yml"
end

.file_registered_m4_filesObject

#

RBT.file_registered_m4_files

#


24
25
26
# File 'lib/rbt/registered/registered_m4_files.rb', line 24

def self.file_registered_m4_files
  "#{RBT.yaml_directory_for_the_registered_yaml_files?}m4.yml"
end

.file_registered_pkgconfig_filesObject

#

RBT.file_registered_pkgconfig_files

#


29
30
31
# File 'lib/rbt/registered/registered_pkgconfig_files.rb', line 29

def self.file_registered_pkgconfig_files
  FILE_REGISTERED_PKGCONFIG_FILES
end

.file_registered_tags?Boolean

#

RBT.file_registered_tags?

#

Returns:

  • (Boolean)


23
24
25
# File 'lib/rbt/registered/registered_tags.rb', line 23

def self.file_registered_tags?
  "#{RBT.yaml_directory?}registered_tags/registered_tags.yml"
end

.file_rename_tab_title(use_this_directory = @configuration_directory) ⇒ Object

#

RBT.file_rename_tab_title

#


548
549
550
551
552
# File 'lib/rbt/constants/constants.rb', line 548

def self.file_rename_tab_title(
    use_this_directory = @configuration_directory
  )
  "#{use_this_directory}rename_tab_title.yml"
end

.file_ruby_gem_install_optionsObject

#

RBT.file_ruby_gem_install_options

#


654
655
656
# File 'lib/rbt/constants/constants.rb', line 654

def self.file_ruby_gem_install_options
  "#{RBT.project_yaml_directory?}ruby_gem_install_options.yml"
end

.file_short_tutorial?Boolean

#

RBT.file_short_tutorial?

#

Returns:

  • (Boolean)


255
256
257
# File 'lib/rbt/constants/constants.rb', line 255

def self.file_short_tutorial?
  FILE_SHORT_TUTORIAL
end

.file_source_directoryObject

#

RBT.file_source_directory

#


695
696
697
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 695

def self.file_source_directory
  "#{RBT.configuration_directory?}source_directory.yml"
end

.file_source_directory?Boolean

#

RBT.file_source_directory?

This method may return a path such as:

/home/Programs/Ruby/2.7.1/lib/ruby/site_ruby/2.7.0/rbt/yaml/configuration/configuration/source_directory.yml
#

Returns:

  • (Boolean)


746
747
748
# File 'lib/rbt/constants/constants.rb', line 746

def self.file_source_directory?
  "#{RBT.configuration_directory?}source_directory.yml"
end

.file_specification_of_registered_cookbook_entries(use_this_directory = yaml_directory? ) ⇒ Object

#

RBT.file_specification_of_registered_cookbook_entries

#


609
610
611
612
613
# File 'lib/rbt/constants/constants.rb', line 609

def self.file_specification_of_registered_cookbook_entries(
    use_this_directory = yaml_directory?
  )
  "#{use_this_directory}specification/specification_of_registered_cookbook_entries.yml"
end

.file_statusObject

#

RBT.file_status

#


131
132
133
# File 'lib/rbt/configuration/configuration.rb', line 131

def self.file_status
  "#{RBT.rbt_log_directory?}status.yml"
end

.file_storing_the_time_it_took_to_compile_programsObject

#

RBT.file_storing_the_time_it_took_to_compile_programs

Since as of August 2022 this is now a query-method.

This method can be used to query where the yaml-“database” is kept that contains our compile-times.

#


956
957
958
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 956

def self.file_storing_the_time_it_took_to_compile_programs 
  "#{RBT.log_directory?}database_storing_compile_times.yml"
end

.file_temp_directoryObject

#

RBT.file_temp_directory

This reader method will return the location to the file named “temp_directory.yml”, as a String.

On my system, the method may return a String such as

"/Programs/Ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rbt/yaml/configuration/temp_directory.yml"
#


538
539
540
541
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 538

def self.file_temp_directory
   "#{RBT.configuration_directory?}"\
   "temp_directory.yml"
end

.file_use_colours?(use_this_directory = @configuration_directory) ⇒ Boolean

#

RBT.file_use_colours?

This method will point to a path such as:

/Programs/Ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rbt/yaml/configuration/use_colours.yml
#

Returns:

  • (Boolean)


562
563
564
565
566
# File 'lib/rbt/constants/constants.rb', line 562

def self.file_use_colours?(
    use_this_directory = @configuration_directory
  )
  "#{use_this_directory}use_colours.yml"
end

.file_use_psych_or_syckObject

#

RBT.file_use_psych_or_syck

#


49
50
51
# File 'lib/rbt/constants/configuration_directory.rb', line 49

def self.file_use_psych_or_syck
  "#{@configuration_directory}use_psych_or_syck.yml"
end

.file_use_yaml_database_for_tagsObject

#

RBT.file_use_yaml_database_for_tags

#


734
735
736
# File 'lib/rbt/constants/constants.rb', line 734

def self.file_use_yaml_database_for_tags
  "#{RBT.configuration_directory?}use_yaml_database_for_tags.yml"
end

.file_windows_cookbookObject

#

RBT.file_windows_cookbook

#


760
761
762
# File 'lib/rbt/constants/constants.rb', line 760

def self.file_windows_cookbook
  "#{RBT.project_yaml_directory?}windows/cookbook.yml"
end

.filelist_parser(i) ⇒ Object

#

RBT.filelist_parser

#


229
230
231
# File 'lib/rbt/linux/slackware/filelist_parser.rb', line 229

def self.filelist_parser(i)
  RBT::Linux::Slackware::FilelistParser[i]
end

.filter_for_valid_program_names(i = ARGV, &block) ⇒ Object

#

RBT.filter_for_valid_program_names

Invocation examples:

RBT.filter_for_valid_program_names('mate1')   # => "matedesktop"
RBT.filter_for_valid_program_names('libarch') # => "libarchive"
#


152
153
154
155
156
157
# File 'lib/rbt/actions/individual_actions/filter_for_valid_program_names/filter_for_valid_program_names.rb', line 152

def self.filter_for_valid_program_names(
    i = ARGV,
    &block
  )
  return RBT::Action::FilterForValidProgramNames.new(i, &block).result?
end

.find_alternative_archive(i = ARGV) ⇒ Object

#

RBT.find_alternative_archive

#


193
194
195
# File 'lib/rbt/actions/individual_actions/find_alternative_archive/find_alternative_archive.rb', line 193

def self.find_alternative_archive(i = ARGV)
  RBT::Action::FindAlternativeArchive.new(i)
end

.find_cookbook_alias_for(i) ⇒ Object

#

RBT.find_cookbook_alias_for

This method can be used to find a specific alias for a real, existing (and registered) program of the RBT suite.

Usage example:

RBT.find_cookbook_alias_for 'perlx'
#


535
536
537
# File 'lib/rbt/aliases/aliases.rb', line 535

def self.find_cookbook_alias_for(i)
  RBT::Cookbooks::Aliases.new(i).value?
end

.find_headers(i = ARGV) ⇒ Object

#

RBT.find_headers

This method exists mostly because it is more convenient to type it.

Invocation example:

RBT.find_headers('libxcb')
#


125
126
127
# File 'lib/rbt/cookbooks/find_headers.rb', line 125

def self.find_headers(i = ARGV)
  RBT::Cookbooks::FindHeaders.new(i)
end

.find_likely_directory(i = ARGV, options_hash = {}, &block) ⇒ Object

#

RBT.find_likely_directory

#


135
136
137
138
139
140
141
# File 'lib/rbt/actions/individual_actions/find_likely_directory/find_likely_directory.rb', line 135

def self.find_likely_directory(
    i            = ARGV,
    options_hash = {},
    &block
  )
  RBT::Action::FindLikelyDirectory.new(i, &block)
end

.find_multiple_versionsObject

#

RBT.find_multiple_versions

#


113
114
115
# File 'lib/rbt/utility_scripts/find_multiple_versions.rb', line 113

def self.find_multiple_versions
  RBT::Cookbooks::FindMultipleVersions.new
end

.find_url_for(i = ARGV, return_as_string = false) ⇒ Object

#

RBT.find_url_for

Use this method to find a specific URL quickly.

The method will return the first URL always, also called “url1”.

The method will also try to return url2 - and hence return an Array, if possible. Keep this in mind that you may have an Array as result from this method.

Usage examples:

RBT.find_url_for()
RBT.find_url_for(:htop) # => ["http://hisham.hm/htop/releases/2.2.0/htop-2.2.0.tar.gz", "http://hisham.hm/htop/index.php?page=downloads"]
RBT.url_for? :patch # => ["https://ftp.gnu.org/pub/gnu/patch/patch-2.7.6.tar.xz", "http://ftp.gnu.org/gnu/patch/?C=M;O=D"]
#


72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/rbt/toplevel_methods/url.rb', line 72

def self.find_url_for(
    i                = ARGV,
    return_as_string = false
  )
  case return_as_string
  when :return_as_string
    return_as_string = true
  end
  i = i.first if i.is_a? Array
  i = i.to_s
  # ======================================================================= #
  # Next, we will try to use the expanded dataset, if it exists. This
  # will be MUCH faster than instantiating a new ruby object, as is
  # done in the else clause. The drawback is that the expanded dataset
  # may not always have the most-up-to-date content.
  # ======================================================================= #
  expanded_file = RBT.return_location_to_this_programs_yaml_file(i)
  if File.exist? expanded_file
    if i.end_with? '.yml'
      i = i.dup if i.frozen?
      i.sub!(/\.yml$/,'')
    end
    dataset = YAML.load_file(expanded_file)
    if dataset.has_key?(i)
      dataset = dataset[i]
    end
    url1 = dataset['url1'] # Is a String.
    url2 = dataset['url2'] # Is a String.
  else
    # ===================================================================== #
    # Else we will instantiate a new, costly Cookbook instance.
    # ===================================================================== #
    _ = RBT.raw_cookbook(i)
    url1 = _.url1? # Return the URL here.
    url2 = _.url2?
  end
  url1 = url1.to_s.strip
  url2 = url2.to_s.strip
  if return_as_string
    url1.to_s
  else
    return [url1, url2]
  end
end

.fix_chown_root_entries_in_this_file(this_file = 'Makefile') ⇒ Object

#

RBT.fix_chown_root_entries_in_this_file

This method can be used to replace all “chown root:root” entries with “chown 0:0” entries. It may be necessary for when we have setup a chroot.

#


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/rbt/toplevel_methods/chroot_and_chown_related_code.rb', line 59

def self.fix_chown_root_entries_in_this_file(
    this_file = 'Makefile'
  )
  what = ''.dup
  if File.exist? this_file
    File.readlines(this_file).each {|this_entry|
      if this_entry.include? 'chown root:root'
        this_entry.gsub!(/root:root/, '0:0')
      end
      what << this_entry
    }
    e "#{rev}Now modifying the file `#{sfile(this_file)}#{rev}`."
    write_what_into(what, this_file)
  end
end
#
#


219
220
221
222
223
224
225
# File 'lib/rbt/utility_scripts/check_for_invalid_current_symlinks.rb', line 219

def self.fix_incorrect_symlinks
  unless Object.const_defined?(:RBT) and
         RBT.const_defined?(:CheckForInvalidCurrentSymlinks)
    require 'rbt/utility_scripts/check_for_invalid_current_symlinks.rb'
  end
  ::RBT::CheckForInvalidCurrentSymlinks.new('--autocorrect')
end

.fix_libtool_la_file_from_saved_fileObject

#

RBT.fix_libtool_la_file_from_saved_file

#


488
489
490
# File 'lib/rbt/libtool/libtool.rb', line 488

def self.fix_libtool_la_file_from_saved_file
  RBT::Libtool.new.remove_the_last_faulty_libtool_entry_stored_in_a_file
end

.forestgreen(i = '', use_colours = use_colours?) ) ⇒ Object

#

RBT.forestgreen

#


170
171
172
173
# File 'lib/rbt/colours/html_colours.rb', line 170

def self.forestgreen(i = '', use_colours = use_colours?)
  return COLOURS::HtmlColoursMethods.forestgreen(i) if use_colours
  return i
end

.gather_information(i = ARGV) ⇒ Object

#

RBT.gather_information

#


378
379
380
381
382
# File 'lib/rbt/actions/individual_actions/information/gather_information.rb', line 378

def self.gather_information(
    i = ARGV
  )
  RBT::Action::GatherInformation.new(i)
end

.generate_global_yaml_databaseObject

#

RBT.generate_global_yaml_database

#


113
114
115
# File 'lib/rbt/generate_files/create_global_yaml_database.rb', line 113

def self.generate_global_yaml_database
  RBT::Cookbooks::CreateGlobalYamlDatabase.new
end

.generate_homepage(i = ARGV) ⇒ Object

#

RBT.generate_homepage

#


528
529
530
# File 'lib/rbt/cookbooks/generate_homepage/generate_homepage.rb', line 528

def self.generate_homepage(i = ARGV)
  RBT::Cookbooks::GenerateHomepage.new(i)
end

.generate_pdf_tutorialObject

#

RBT.generate_pdf_tutorial

#


96
97
98
# File 'lib/rbt/generate_files/generate_pdf_tutorial.rb', line 96

def self.generate_pdf_tutorial
  RBT::GeneratePdfTutorial.new
end

.generate_pdf_tutorial_then_upload_itObject

#

RBT.generate_pdf_tutorial_then_upload_it

Use this method to upload the .pdf tutorial to a remote host.

#


105
106
107
108
109
110
111
112
# File 'lib/rbt/generate_files/generate_pdf_tutorial.rb', line 105

def self.generate_pdf_tutorial_then_upload_it
  RBT.generate_pdf_tutorial
  # Next comes the upload part.
  require 'ftp_paradise/without_gui_bindings'
  connection = FtpParadise.connect to: :shevy
  connection.set_to_binary_mode
  connection.upload_this_file RBT::GeneratePdfTutorial.store_pdf_file_where?
end

.generate_programs_version_yaml_file(use_this_dataset = nil) ⇒ Object

#

RBT.generate_programs_version_yaml_file

This method will create one big yaml file that is a Hash. This big Hash will have the name of all programs and the corresponding version of said programs.

The key will be the name of the program and the value will be the respective program version.

You can also pass in your own dataset. If you do so, remember to use a hash, with specific key->value pairs that reflect the name of the program and the specific version of said program.

You can invoke this method from the commandline, by issuing:

rbt --generate_version_file
#


36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/rbt/toplevel_methods/generate_programs_version_yaml_file.rb', line 36

def self.generate_programs_version_yaml_file(
    use_this_dataset = nil
  )
  _ = ''.dup # We will append onto this String.
  unless use_this_dataset # This is the default behaviour/clause.
    hash = {} # We store into this hash here.
    target = RUBY_SRC_DIR_RBT_YAML+
             'programs_version/available_programs_versions.md'
    if is_on_roebe?
      e 'Reading in the dataset from this file:'
      e
      e sfile("  #{target}")
      e
    end
    unless File.exist? target
      e 'No file was found at '+sfile(target)+'.'
      exit
    end
    dataset = File.readlines(target)
    dataset.each {|line|
      splitted = line.split(' ').map(&:strip)
      opn; e "Now working on the program "\
             "`#{Colours::HtmlColoursMethods.lightgray(splitted[0])}`."
      # =================================================================== #
      # Add onto the Hash next. Should keep it as a String.
      # =================================================================== #
      hash[splitted[0].downcase] = splitted[1].to_s
    }
    use_this_dataset = hash
  end
  use_this_dataset.each_pair {|key, value|
    value = '"'+value.to_s+'"' unless value.include? '"'
    _ << key.to_s+': '+value.to_s+N
  }
  # ======================================================================= #
  # Ok, now we should have all programs and the respective version
  # at hand - we can store it next. In the past, this made use of
  # YAML.dump() but for some strange reason, YAML.dump() gave strange
  # results; which is why I decided to generate the .yml file
  # on my own.
  # ======================================================================= #
  what = _
  into = "#{RBT.yaml_directory?}programs_version/programs_version.yml"
  opn; e "Will also store into `#{sfile(into)}#{rev}`."
  write_what_into(what, into) # Store into the file programs_version.yml
  # ======================================================================= #
  # Store for my home-system as well.
  # ======================================================================= #
  if is_roebe? # On my system.
    into = "#{RUBY_SRC_DIR_RBT}yaml/programs_version/programs_version.yml"
    opn; e "Will also store into `#{sfile(into)}#{rev}`."
    write_what_into(what, into)
  end
end

.generate_shell_completion(i = :all) ⇒ Object

#

RBT.generate_shell_completion

#


249
250
251
# File 'lib/rbt/generate_files/generate_shell_completion.rb', line 249

def self.generate_shell_completion(i = :all)
  RBT::GenerateShellCompletion.new(i)
end

.generate_slackware_description_file(i, &block) ⇒ Object

#

RBT.generate_slackware_description_file

#


354
355
356
357
358
359
360
# File 'lib/rbt/linux/slackware/generate_slack_desc_file.rb', line 354

def self.generate_slackware_description_file(
    i, &block
  )
  object = RBT::Linux::Slackware::GenerateSlackDescFile[i, &block]
  result = object.path?
  return result
end

.generate_sql_tableObject

#

RBT.generate_sql_table

#


253
254
255
# File 'lib/rbt/sql/generate_sql_table.rb', line 253

def self.generate_sql_table
  RBT::GenerateSqlTable.new
end

.get_all_directories_from(here = return_pwd, return_full_path = false) ⇒ Object

#

RBT.get_all_directories_from

This will return all directories.

Invocation example:

RBT.get_all_directories_from('/home/x/src/')
#


247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 247

def self.get_all_directories_from(
    here             = return_pwd,
    return_full_path = false
  )
  here << '/' unless here.end_with? '/'
  _ = Dir["#{here}*"]
  _.select! {|entry| File.directory?(entry) }
  result = _.map {|entry| "#{entry}/" }
  if return_full_path
    result.map! {|line| File.absolute_path(line) }
  end
  return result.sort # Keep the result sorted.
end

.get_all_files_from(this_dir = return_pwd, return_full_path = true, include_hidden_files = false) ⇒ Object

#

RBT.get_all_files_from

We will only obtain files through this method here.

#


1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1278

def self.get_all_files_from(
    this_dir             = return_pwd,
    return_full_path     = true,
    include_hidden_files = false
  )
  this_dir = return_pwd if this_dir.nil?
  _ = this_dir.dup
  _ << '/*' unless _.end_with? '/*'
  _ = rds(_) # Make use of RBT:rds() here.
  _ = Dir[_].select {|entry| File.file?(entry) }
  return _
end

.get_dateObject

#

RBT.get_date

As of Sep 2014, this method will return a string such as:

"12 Jan 2015"
#


41
42
43
44
45
46
47
48
# File 'lib/rbt/time/time.rb', line 41

def self.get_date
  current_day = Time.now.strftime('%d') # This will return a string such as "30".
  current_day+
  ' '+
  Date::MONTHNAMES[Date.today.month][0,3]+ # Only obtain the first three letters.
  ' '+
  ::Time.now.strftime('%Y')
end

.get_extended_dateObject

#

RBT.get_extended_date

This method is similar to RBT.get_date, but we will not truncate the name of the month. So we may return a String such as “12 January 2023”.

#


56
57
58
59
60
61
62
# File 'lib/rbt/time/time.rb', line 56

def self.get_extended_date
  current_day   = Time.now.strftime('%d') # This will return a string such as "30".
  current_month = Date::MONTHNAMES[Date.today.month]
  return "#{current_day}"\
         " #{current_month}"\
         " #{::Time.now.strftime('%Y')}"
end

.get_files_and_directories_from(here = return_pwd) ⇒ Object

#

RBT.get_files_and_directories_from

Simply combine RBT.get_all_directories_from and RBT.get_files_from via this method here.

#


152
153
154
155
156
157
158
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 152

def self.get_files_and_directories_from(
    here = return_pwd
  )
  _ = get_all_directories_from(here)+
      get_all_files_from(here)
  return _.flatten
end

.gitty(i = ARGV) ⇒ Object

#

RBT.gitty

#


140
141
142
# File 'lib/rbt/utility_scripts/gitty.rb', line 140

def self.gitty(i = ARGV)
  RBT::Gitty.new(i)
end

.gobolinux_naming_convention(i) ⇒ Object

#

RBT.gobolinux_naming_convention

Easier toplevel method for accessing the functionality of class RBT::GobolinuxNamingConvention.

#


142
143
144
145
# File 'lib/rbt/linux/gobolinux/gobolinux_naming_convention.rb', line 142

def self.gobolinux_naming_convention(i)
  i = i.first if i.is_a? Array
  RBT::Gobolinux::NamingConvention.new(i).translated_name?
end

.gold(i = '') ⇒ Object

#

RBT.gold

#


146
147
148
149
# File 'lib/rbt/colours/html_colours.rb', line 146

def self.gold(i = '')
  return COLOURS::HtmlColoursMethods.gold(i) if use_colours?
  return i
end
#

This method will either extract the given user input, such as “htop-2.2.tar.gz”, or it may attempt to download the remote dataset associated with a given program at hand.

#


241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/rbt/actions/individual_actions/extract/extract.rb', line 241

def self.handle_this_extract_related_user_input(
    i
  )
  i = [i].flatten.compact.each {|user_input|
    if File.exist? user_input
      RBT.extract(user_input)
    else
      RBT.download(user_input.to_sym)
      possible_matches = Dir[user_input.to_s+'*']
      this_directory = possible_matches.select {|line|
        File.file?(line) and is_an_archive?(line)
      }.first
      RBT.extract(this_directory)
      exit
    end
  }
end

.has_an_error_occurred?Boolean

#

RBT.has_an_error_occurred?

#

Returns:

  • (Boolean)


21
22
23
# File 'lib/rbt/toplevel_methods/error_message.rb', line 21

def self.has_an_error_occurred?
  !@error_message.empty?
end

.hash_aliases_to_the_available_programs?Boolean

#

RBT.hash_aliases_to_the_available_programs?

Query method over the available aliases to the given programs. This will include the abbreviations, too.

Usage example:

RBT.hash_aliases_to_the_available_programs?['libxshmfenc'] # => "libxshmfence"
#

Returns:

  • (Boolean)


128
129
130
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 128

def self.hash_aliases_to_the_available_programs?
  @hash_aliases_to_the_available_programs
end

.hash_registered_binaries?Boolean

#

RBT.hash_registered_binaries?

This method is similar to the method RBT.registered_binaries? - but rather than an Array we will return the original Hash.

#

Returns:

  • (Boolean)


247
248
249
# File 'lib/rbt/registered/registered_binaries.rb', line 247

def self.hash_registered_binaries?
  ALL_BINARIES
end

.headers(i = ARGV, options_hash = {}, &block) ⇒ Object

#

RBT.headers

#


173
174
175
176
177
178
179
# File 'lib/rbt/actions/individual_actions/headers/headers.rb', line 173

def self.headers(
    i            = ARGV,
    options_hash = {},
    &block
  )
  return RBT::Action::Headers.new(i, &block)
end

.highest(i = DISPLAY_N_PROGRAMS_BY_DEFAULT) ⇒ Object

#

RBT.highest

Easier toplevel API.

Usage example:

RBT.highest 123
#


385
386
387
# File 'lib/rbt/actions/individual_actions/information/highest.rb', line 385

def self.highest(i = DISPLAY_N_PROGRAMS_BY_DEFAULT)
  RBT::Action::Cookbooks::Highest.new(i)
end

.home_directory?Boolean

#

RBT.home_directory?

This should default towards /root or the user’s home directory.

For example, for the superuser on a system, this will expand into “/root/” or “/home/debug/”.

The method will ensure that a trailing ‘/’ is part of the result.

#

Returns:

  • (Boolean)


19
20
21
# File 'lib/rbt/toplevel_methods/home_directory.rb', line 19

def self.home_directory?
  ("#{ENV['HOME']}/").squeeze('/')
end

.homepage(i = ARGV) ⇒ Object

#

RBT.homepage

#


317
318
319
# File 'lib/rbt/cookbooks/homepage/homepage.rb', line 317

def self.homepage(i = ARGV)
  RBT::Cookbooks::Homepage.new(i)
end

.host_cpu?Boolean

#

RBT.host_cpu?

#

Returns:

  • (Boolean)


460
461
462
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 460

def self.host_cpu?
  HOST_CPU
end

.increment_program_version(i = ARGV) ⇒ Object

#

RBT.increment_program_version

#


423
424
425
# File 'lib/rbt/utility_scripts/increment_program_version/increment_program_version.rb', line 423

def self.increment_program_version(i = ARGV)
  RBT::Cookbooks::IncrementProgramVersion.new(ARGV)
end

.infer_build_system(i = ARGV) ⇒ Object

#

RBT.infer_build_system

#


200
201
202
203
# File 'lib/rbt/actions/individual_actions/infer_build_system/infer_build_system.rb', line 200

def self.infer_build_system(i = ARGV)
  _ = RBT::Action::InferBuildSystem.new(ARGV)
  return _.build_system?
end

.infer_then_report_the_build_system(i = ARGV) ⇒ Object

#

RBT.infer_then_report_the_build_system

#


192
193
194
195
# File 'lib/rbt/actions/individual_actions/infer_build_system/infer_build_system.rb', line 192

def self.infer_then_report_the_build_system(i = ARGV)
  _ = RBT::Action::InferBuildSystem.new(ARGV)
  return _.report
end

.infer_these_binaries_will_be_installed_by(this_program = ARGV) ⇒ Object

#

RBT.infer_these_binaries_will_be_installed_by

This method can be used to infer the binaries that may be installed by a given program at hand. This requires that the program has been installed already under an AppDir prefix.

#


802
803
804
805
806
# File 'lib/rbt/actions/individual_actions/cookbooks/suggest_cookbook_for/suggest_cookbook_for.rb', line 802

def self.infer_these_binaries_will_be_installed_by(
    this_program = ARGV
  )
  RBT.suggest_cookbook_for(this_program) { :do_not_report }.binaries?
end

.infer_these_libraries_will_be_installed_by(this_program = ARGV) ⇒ Object

#

RBT.infer_these_libraries_will_be_installed_by

This method can be used to infer the libraries that may be installed by a given program at hand. This requires that the program has been installed already under an AppDir prefix.

#


815
816
817
818
819
# File 'lib/rbt/actions/individual_actions/cookbooks/suggest_cookbook_for/suggest_cookbook_for.rb', line 815

def self.infer_these_libraries_will_be_installed_by(
    this_program = ARGV
  )
  RBT.suggest_cookbook_for(this_program) { :do_not_report }.libraries?
end

.initialize_configurationObject

#

RBT.initialize_configuration

Use a method to initialize the configuration for the RBT project.

#


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/rbt/configuration/initialize_configuration.rb', line 19

def self.initialize_configuration
  # ======================================================================= #
  # We will set the @configuration variable to a specific value here.
  # ======================================================================= #
  RBT.set_configuration(
    # ===================================================================== #
    # Load up the data from the directory. This requires the file called
    # 'configuration_directory.rb'.
    # ===================================================================== #
    configuration_directory? # <- This is a String such as "/Programs/Ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rbt/yaml/configuration/"
  )
  # ======================================================================= #
  # === enable_gobolinux_config
  #
  # Use a specific "template" when we are on a GoboLinux distribution.
  #
  # Do also note that in the more recent GoboLinux versions, say past
  # the year 2017, the directories have changed a bit. The following
  # code will ONLY honour the current versions, not the older legacy
  # GoboLinux versions.
  # ======================================================================= #
  if @configuration.respond_to?(:enable_gobolinux_config) and
     @configuration.enable_gobolinux_config
    RBT.set_system_directory('/System/') # === SYSTEM_DIR
    @system_index_directory    = "#{SYSTEM_DIR}Index/"
    RBT.set_source_directory('/Files/Compile/Source/') # /Files/Compile/Archives/
    RBT.set_programs_directory('/Programs/') # Hardcoded, on GoboLinux.
    RBT.set_temp_directory(SYSTEM_DIR+'Variable/tmp/') # CONFIG.temp_dir
    RBT.set_depot_directory('/Depot/')
    @system_links_directory    = "#{SYSTEM_DIR}Links/"
    RBT.set_packages_directory("#{DEPOT_DIR}Packages/") # This is not a Gobolinux Directory, though.
    @pkgconfig_directory       = "#{SYSTEM_LINKS_DIR}Libraries/pkgconfig/"
    RBT.set_sysbin_directory("#{SYSTEM_INDEX}bin/")
    RBT.set_syslib_directory("#{SYSTEM_INDEX}lib/")
    RBT.set_sysinclude_directory("#{SYSTEM_INDEX}include/")
    RBT.set_system_settings_directory("#{SYSTEM_DIR}Settings/")
    RBT.set_system_share_directory("#{SYSTEM_LINKS_DIR}Shared/")
    @system_libexec_directory      = "#{SYSTEM_INDEX}libexec/"
    @system_environment_directory  = "#{SYSTEM_LINKS_DIR}Environment/"
    @system_tasks_directory        = "#{SYSTEM_LINKS_DIR}Tasks/"
    @system_logs_directory         = "#{SYSTEM_DIR}Logs/"
    @system_kernel_directory       = "#{SYSTEM_DIR}Kernel/"
  else # ================================================================== #
       # Else, we will set the default variables here via the CONFIG
       # object. Keep a trailing / here.
    # ===================================================================== #
    # Keep a reference to the TEMP Directory used by the RBT Scripts here.
    # We will extract archives into this directory (the temp directory).
    # Before we will assign to the constant, we first have to do some
    # sanitizing.
    # ===================================================================== #
    _ = rds(
      @configuration.temp_directory
    )
    if _.include? '#' # Chop off in this case.
      _ = _[0, _.index('#')].strip
      _ << '/' unless _.end_with? '/'
    end
    # ===================================================================== #
    # _ may be "/Depot/Temp/rbt/".
    # ===================================================================== #
    RBT.set_temp_directory(_)
    # ===================================================================== #
    # Keep a reference to the Programs dir.
    # ===================================================================== #
    RBT.set_programs_directory(@configuration.programs_directory)
    # ===================================================================== #
    # === The source directory
    # ===================================================================== #
    RBT.set_source_directory(@configuration.source_directory) # Where to store all Source files.
    # ===================================================================== #
    # === The /System/ directory
    # ===================================================================== #
    RBT.set_system_directory(@configuration.system_directory) # '/System/'
    RBT.set_sysbin_directory(@configuration.sysbin_directory) # Standard sysbin directory.
    RBT.set_syslib_directory(@configuration.syslib_directory) # Standard syslib directory.
    RBT.set_sysinclude_directory(@configuration.sysinclude_dir) # Standard include directory.
    # SYSLIB_DIR+'/pkgconfig/' # including pkgconfig
    RBT.set_depot_directory(@configuration.depot_dir)
    @system_logs_directory = rds(@configuration.system_logs+'/') # SYSTEM_DIR+'Logs' # Where to keep our syslogs.
    RBT.set_log_directory # Default it to some value.
    # ===================================================================== #
    # === SYSTEM_SETTINGS_DIR
    #
    # Where to keep the /etc equivalent.
    # ===================================================================== #
    RBT.set_system_settings_directory(@configuration.system_settings_dir)
    # ===================================================================== #
    # === The Packages Dir
    #
    # On my system it is at /Depot/Packages.
    # ===================================================================== #
    RBT.set_packages_directory(@configuration.packages_directory)
    # ===================================================================== #
    # === MY_SYSSHARE
    #
    # Next, handle the SYSSHARE_DIR directory.
    # ===================================================================== #
    if ENV['MY_SYSSHARE']
      RBT.set_system_share_directory(ENV['MY_SYSSHARE'].dup)
    else
      RBT.set_system_share_directory(@configuration.sysshare_directory)
    end
    # ===================================================================== #
    # === PKGCONFIG_DIR
    #
    # PKGCONFIG_DIR is hardcoded for now.
    # ===================================================================== #
    @pkgconfig_directory = rds(@configuration.pkgconfig_dir+'/')
  end
end

.install_libstdc_plus_plus(shall_we_extract_the_tarball = true, use_this_gcc_version = :infer_automatically, to = RBT.log_dir?, use_this_as_target_prefix = RBT.programs_directory?) ⇒ Object

#

RBT.install_libstdc_plus_plus

The following code was taken/adapted from:

http://www.linuxfromscratch.org/lfs/view/stable/chapter05/gcc-libstdc++.html
#


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/rbt/toplevel_methods/install_libstdc_plus_plus.rb', line 19

def self.install_libstdc_plus_plus(
    shall_we_extract_the_tarball = true, # ← We could skip it, too.
    use_this_gcc_version         = :infer_automatically,
    to                           = RBT.log_dir?,
    use_this_as_target_prefix    = RBT.programs_directory?
  )
  require 'rbt/requires/require_extracter.rb'
  require 'rbt/toplevel_methods/e_and_esystem.rb'
  case use_this_gcc_version
  # ======================================================================= #
  # === :infer_automatically
  # ======================================================================= #
  when :infer_automatically, # or hardcode it: '10.1.0'
       :infer
    unless RBT.respond_to? :swift_return_version_of_this_program
      require 'rbt/requires/swift_version.rb'
    end
    use_this_gcc_version = RBT.swift_return_version_of_this_program(:gcc) 
  end
  what = "/home/x/src/gcc/gcc-#{use_this_gcc_version}.tar.xz"
  if shall_we_extract_the_tarball
    Extracter.what_to(what, to)
  end
  cd("#{to}#{use_this_gcc_version}/")
  use_this_as_host = 'x86_64-linux-gnu'
  target_dir = 'BUILD_FOR_LIBSTDC++'
  mkdir target_dir
  cd target_dir
  use_this_full_prefix_target = use_this_as_target_prefix+'Libstdc++/'+use_this_gcc_version
  _ = '../libstdc++-v3/configure           \
  --host='+use_this_as_host+'  \
  --prefix='+use_this_full_prefix_target+'                 \
  --disable-multilib              \
  --disable-nls                   \
  --disable-libstdcxx-threads     \
  --disable-libstdcxx-pch         \
  --with-gxx-include-dir='+use_this_as_target_prefix+'Gcc/Current/include/c++/'+use_this_gcc_version
  esystem _
  esystem 'make'
  esystem 'make install'
  action(:ToCurrent, use_this_full_prefix_target)
end

.install_this_rubygem(use_this_local_path, be_verbose = true) ⇒ Object

#

RBT.install_this_rubygem

This method can be used to install a rubygem (.gem) archive.

In August 2022 the code was a bit changed - the old code made use of RBT::Compile. During the rewrite of the RBT project in August 2022 the method was simplified, to just use a direct “gem install” command.

We also now use the –local flag, but we may have to adapt this in the future, if this method here should also install remote gems. For now we only support installing local .gem files though.

Usage example:

RBT.install_this_rubygem('/tmp/thor-1.2.0.gem')
#


554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 554

def self.install_this_rubygem(
    use_this_local_path,
    be_verbose = true
  )
  unless RBT.const_defined?(:Installer)
    require 'rbt/requires/require_the_installer_class.rb'
  end
  # ======================================================================= #
  # The old code up until August 2022:
  #
  #   compile_object = RBT::Action::Installer.new(:do_not_run_yet)
  #   compile_object.determine_the_dataset_for_this_program(i)
  #   compile_object.set_program_path(compile_object.cookbook_dataset_program_path?)
  #   compile_object.install_this_ruby_gem(:default, :do_not_exit)
  #
  # ======================================================================= #
  cmd = "gem install --local #{use_this_local_path}"
  _ = RBT.file_ruby_gem_install_options
  if File.exist? _
    cmd = cmd.dup
    cmd << " #{File.read(_)}"
    cmd.strip!
  end
  if be_verbose
    esystem cmd
  else
    system cmd
  end
end

.is_an_abbreviation?(i) ⇒ Boolean

#

RBT.is_an_abbreviation?

Usage example:

RBT.is_an_abbreviation? 'libxshmfe' # => true
RBT.is_an_abbreviation? 'x11'       # => true
RBT.is_an_abbreviation? 'libx11'    # => false
#

Returns:

  • (Boolean)


113
114
115
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 113

def self.is_an_abbreviation?(i)
  RBT.hash_aliases_to_the_available_programs?.has_key? i
end

.is_an_alias?(i) ⇒ Boolean

#

RBT.is_an_alias?

This method will return true if the input is an alias, and otherwise it will return false.

We will get rid of ‘:’ in the input.

To test this method, do:

RBT.is_an_alias? 'htop'
RBT.is_an_alias? 'blkid'
#

Returns:

  • (Boolean)


87
88
89
# File 'lib/rbt/aliases/aliases.rb', line 87

def self.is_an_alias?(i)
  RBT::Cookbooks::Aliases.new(i).is_an_alias?
end

.is_an_archive?(i) ⇒ Boolean

#

RBT.is_an_archive?

This method will return true if the given input is considered to be an archive; and false otherwise.

#

Returns:

  • (Boolean)


23
24
25
26
27
28
29
30
31
32
# File 'lib/rbt/toplevel_methods/archive_related_code.rb', line 23

def self.is_an_archive?(i)
  if i.is_a? Array
    i.map {|entry| is_an_archive?(entry) }
  else
    ARRAY_REGISTERED_ARCHIVES.any? {|entry|
      entry = entry.to_s unless entry.is_a?(String)
      i and i.end_with?(entry)
    }
  end
end

.is_included?(i, honour_aliases = true) ⇒ Boolean

#

RBT.is_included?

This method can be used to query whether a given input is included or whether it is not - that is, if the input may be a program that is registered in the RBT project.

By default we will also include aliases, but this can be disabled, such as by using the Symbol :do_not_check_for_aliases as the second argument to this method.

Remember that all aliases in use are stored in a yaml file. If you want to add new aliases or change the existing ones, you may have to modify that yaml file.

In principle, we could also restrict this method here to only-aliases but I found that the API reads differently than this intent.

Usage examples for this method:

RBT.is_included? 'abiword' # => true
RBT.is_included? 'aclocal'
#

Returns:

  • (Boolean)


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/rbt/toplevel_methods/does_include.rb', line 35

def self.is_included?(
    i,
    honour_aliases = true
  )
  if i
    require 'rbt/aliases/aliases.rb'
    i = i.join(' ').strip if i.is_a? Array
    # ===================================================================== #
    # We need a String past this point.
    # ===================================================================== #
    i = i.to_s unless i.is_a? String
    i.delete!(':') if i.include? ':' # We ignore ':' tokens.
    keys = available_programs?
    case honour_aliases
    # ===================================================================== #
    # === :default
    # ===================================================================== #
    when :default # Restore the default state in this case.
      honour_aliases = true
    # ===================================================================== #
    # === :do_not_honour_aliases
    # ===================================================================== #
    when :do_not_honour_aliases,
         :do_not_check_for_aliases,
         :do_not_use_aliases,
         :ignore_aliases,
         :user_disabled_this_setting_via_the_commandline
      honour_aliases = false
    end
    if honour_aliases
      aliases = RBT::Cookbooks::Aliases.new(i)
      all_aliases = aliases.dataset
      # =================================================================== #
      # Merge the keys together next, starting with the default programs.
      # ==================================================================== #
      keys << all_aliases.keys
    end
    keys.flatten!
    return keys.include?(i)
  else
    false
  end
end

.is_on_64_bit?Boolean

#

RBT.is_on_64_bit?

#

Returns:

  • (Boolean)


41
42
43
# File 'lib/rbt/toplevel_methods/determine_host_architecture.rb', line 41

def self.is_on_64_bit?
  determine_host_architecture.include? '64'
end

.is_on_windows?Boolean

#

RBT.is_on_windows?

This method will return true if we are on windows; and false otherwise.

#

Returns:

  • (Boolean)


633
634
635
636
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 633

def self.is_on_windows?
  return true if RUBY_PLATFORM.include? 'win'
  return false
end

.is_roebe?Boolean

#

RBT.is_roebe?

This method is only useful on my home system, where the environment variable IS_ROEBE has been set to 1.

#

Returns:

  • (Boolean)


15
16
17
# File 'lib/rbt/toplevel_methods/roebe.rb', line 15

def self.is_roebe?
  "#{ENV['IS_ROEBE']}" == '1'
end

.is_this_a_real_gobolinux_system?Boolean

#

RBT.is_this_a_real_gobolinux_system?

This method queries whether we are on a real GoboLinux system.

In order to determine this, as a true or false answer, we will ONLY check on local file-paths and possibly directory-paths.

We will check for three targets.

#

Returns:

  • (Boolean)


20
21
22
23
24
# File 'lib/rbt/toplevel_methods/gobolinux.rb', line 20

def self.is_this_a_real_gobolinux_system?
  File.exist?('/System/Aliens') and 
  File.exist?('/System/Kernel/Boot/System.map') and
  File.symlink?('/System/Kernel/Boot/System.map')
end

.is_this_a_registered_gir_file?(i = 'Gtk+-3.0.gir') ⇒ Boolean

#

RBT.is_this_a_registered_gir_file?

#

Returns:

  • (Boolean)


181
182
183
184
# File 'lib/rbt/registered/registered_gir_files.rb', line 181

def self.is_this_a_registered_gir_file?(i = 'Gtk+-3.0.gir')
  dataset = YAML.load_file(file_registered_gir_files)
  dataset.has_key?(i)
end

.is_this_a_registered_m4_file?(i = 'pkg.m4') ⇒ Boolean

#

RBT.is_this_a_registered_m4_file?

#

Returns:

  • (Boolean)


196
197
198
199
200
201
202
203
# File 'lib/rbt/registered/registered_m4_files.rb', line 196

def self.is_this_a_registered_m4_file?(i = 'pkg.m4')
  if File.exist? file_registered_m4_files
    dataset = YAML.load_file(file_registered_m4_files)
    dataset.has_key?(i)
  else
    false
  end
end

.is_this_a_registered_pkgconfig_file?(i = 'xau.pc') ⇒ Boolean

#

RBT.is_this_a_registered_pkgconfig_file?

#

Returns:

  • (Boolean)


201
202
203
204
205
206
207
208
# File 'lib/rbt/registered/registered_pkgconfig_files.rb', line 201

def self.is_this_a_registered_pkgconfig_file?(i = 'xau.pc')
  if File.exist? file_registered_pkgconfig_files
    dataset = YAML.load_file(file_registered_pkgconfig_files)
    dataset.has_key?(i)
  else
    false
  end
end

.is_this_header_included?(i) ⇒ Boolean

#

RBT.is_this_header_included?

Usage example:

RBT.is_this_header_included?('libusb.h') # => false
#

Returns:

  • (Boolean)


239
240
241
# File 'lib/rbt/registered/registered_headers.rb', line 239

def self.is_this_header_included?(i)
  all_headers?.has_key?(i)
end

.is_this_partial_header_included?(i) ⇒ Boolean

#

RBT.is_this_partial_header_included?

This method is a bit more “forgiving” than the method RBT.is_this_header_included.

Usage example:

RBT.is_this_partial_header_included?('libusb.h') # => true
#

Returns:

  • (Boolean)


254
255
256
257
258
259
# File 'lib/rbt/registered/registered_headers.rb', line 254

def self.is_this_partial_header_included?(i)
  result = all_headers?.transform_keys {|entry|
    File.basename(entry)
  }
  result.has_key?(i)
end

.is_this_program_included?(this_program, optional_argument = nil) ⇒ Boolean

#

RBT.is_this_program_included?

This method can be used to determine whether the given input argument to this method is a registered program; aka whether this program is included as part of the RBT project. A boolean will thus be returned, true indicating inclusion, and false indicating that the input is NOT a registered program.

Any input that is assumed to be a program, and included (thus returning true via this method), is additionally assumed to have an associated .yml dataset that describes how this program can be installed.

If the second argument is given, and is the Symbol :include_abbreviations or :with_abbreviations, or any similar symbol, then the abbreviations will also be considered.

Usage examples:

RBT.is_this_program_included? 'gawk'
RBT.is_this_program_included? 'awk'
RBT.is_this_program_included? 'wwk', :include_abbreviations
#

Returns:

  • (Boolean)


157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 157

def self.is_this_program_included?(
    this_program,
    optional_argument = nil # <- Can be :include_abbreviations
  )
  result = RBT.determine_available_programs.include?(this_program)
  case optional_argument
  # ======================================================================= #
  # === :do_not_check_for_aliases
  # ======================================================================= #
  when :do_not_check_for_aliases
    # This clause will not check for aliases.
  # ======================================================================= #
  # === :include_abbreviations
  #
  # This is the default value - see the symbol :default.
  # ======================================================================= #
  when :include_abbreviations,
       :with_abbreviations,
       :with_aliases,
       :default
    # ===================================================================== #
    # Keep a reference to the Hash that stores the aliases to the
    # available programs at hand.
    # ===================================================================== #
    abbreviations = RBT.hash_aliases_to_the_available_programs
    if abbreviations.has_key? this_program
      result = true
    end
  end
  result
end

.is_this_version_higher_than_that_version?(a, b, report_all_errors_to_the_user = true) ⇒ Boolean

#

RBT.is_this_version_higher_than_that_version

#

Returns:

  • (Boolean)


379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 379

def self.is_this_version_higher_than_that_version?(
    a, b, report_all_errors_to_the_user = true
  )
  case report_all_errors_to_the_user
  # ======================================================================= #
  # === :do_not_report_any_errors
  # ======================================================================= #
  when :do_not_report_any_errors
    report_all_errors_to_the_user = false
  end
  begin
    a = Gem::Version.new(a)
    b = Gem::Version.new(b)
    a > b
  rescue Exception => error
    if report_all_errors_to_the_user
      e '-' * 80
      pp error
      e '-' * 80
      pp a
      pp b
      e '-' * 80
    end
  end
end

.is_xsel_available?Boolean

#

RBT.is_xsel_available?

#

Returns:

  • (Boolean)


743
744
745
746
747
748
749
750
751
752
753
754
755
756
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 743

def self.is_xsel_available?
  result = false
  _ = ENV['PATH']
  if _.include? ':'
    _ = _.split(':')
  end
  _ = [_]
  _.flatten.each {|entry|
    if File.exist?(entry+'xsel')
      result = true
    end
  }
  return result
end

.last_downloaded_fileObject

#

RBT.last_downloaded_file

#


33
34
35
# File 'lib/rbt/toplevel_methods/home_directory.rb', line 33

def self.last_downloaded_file
  "#{RBT.home_dir?}LAST_DOWNLOADED_FILE.md"
end

.last_update?Boolean

#

RBT.last_update?

#

Returns:

  • (Boolean)


52
53
54
# File 'lib/rbt/version/version.rb', line 52

def self.last_update?
  LAST_UPDATE
end

.ldd_dataset?Boolean

#

RBT.ldd_dataset?

#

Returns:

  • (Boolean)


147
148
149
# File 'lib/rbt/utility_scripts/simplified_ldd_output.rb', line 147

def self.ldd_dataset?
  YAML.load_file(RBT.file_ldd_dataset?)
end

.libtool(i = ARGV) ⇒ Object

#

RBT.libtool

Easier module-level method towards Libtool.

#


497
498
499
# File 'lib/rbt/libtool/libtool.rb', line 497

def self.libtool(i = ARGV)
  RBT::Libtool.new(i)
end

.lightblue(i) ⇒ Object

#

RBT.lightblue

#


82
83
84
85
# File 'lib/rbt/colours/html_colours.rb', line 82

def self.lightblue(i)
  return COLOURS::HtmlColoursMethods.lightblue(i) if use_colours?
  return i
end

.lightgreen(i = '') ⇒ Object

#

RBT.lightgreen

#


162
163
164
165
# File 'lib/rbt/colours/html_colours.rb', line 162

def self.lightgreen(i = '')
  return COLOURS::HtmlColoursMethods.lightgreen(i) if use_colours?
  return i
end

.lightsalmon(i = '') ⇒ Object

#

RBT.lightsalmon

#


122
123
124
125
# File 'lib/rbt/colours/html_colours.rb', line 122

def self.lightsalmon(i = '')
  return COLOURS::HtmlColoursMethods.lightsalmon(i) if use_colours?
  return i
end

.load_yaml(i) ⇒ Object

#

RBT.load_yaml

You may use this method when loading a yaml file in the RBT project.

#


68
69
70
# File 'lib/rbt/requires/require_yaml.rb', line 68

def self.load_yaml(i)
  YAML.load_file(i)
end

.local_check_for_latestObject

#

RBT.local_check_for_latest

#


179
180
181
# File 'lib/rbt/cookbooks/local_check_for_latest/local_check_for_latest.rb', line 179

def self.local_check_for_latest
  RBT::Cookbooks::LocalCheckForLatest.new
end

.log_directory?Boolean

#

RBT.log_directory?

Query method for the @log_directory variable. Prefer to use this method or any of its aliases rather than the constant called LOG_DIR.

On my home system this usually defaults to “/home/Temp/rbt/”.

#

Returns:

  • (Boolean)


873
874
875
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 873

def self.log_directory?
  @log_directory
end

.make_app_prefix(for_this_program = :infer) ⇒ Object

#

RBT.make_app_prefix

This method will ultimately execute a command such as this one here:

make PREFIX=/home/Programs/Xfce4-panel/4.14.3/ install
#


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rbt/toplevel_methods/make_app_prefix.rb', line 21

def self.make_app_prefix(
    for_this_program = :infer
  )
  begin
    require 'program_information'
  rescue LoadError; end
  if for_this_program.is_a? Array and for_this_program.empty?
    for_this_program = :default
  end
  case for_this_program
  # ======================================================================= #
  # === :infer
  #
  # This is the default entry point to this method.
  # ======================================================================= #
  when :infer,
       :default
    _ = File.basename(return_pwd)
    program_name    = ProgramInformation.return_name(_)
    program_version = ProgramInformation.return_version(_)
    target = programs_dir?+
             program_name.capitalize+'/'+
             program_version.to_s+'/'
    # esystem 'make PREFIX='+target
    cmd_to_run = "make PREFIX=#{target} install"
    e
    esystem cmd_to_run
    e
  end
end

.map_this_input_to_that_registered_program(i = ARGV, &block) ⇒ Object

#

RBT.map_this_input_to_that_registered_program

Usage example:

RBT.map_this_input_to_that_registered_program('mutool') # => "mupdf"
#


336
337
338
339
340
341
342
# File 'lib/rbt/actions/individual_actions/map_this_input_to_that_registered_program/map_this_input_to_that_registered_program.rb', line 336

def self.map_this_input_to_that_registered_program(
    i = ARGV,
    &block
  )
  i = i.first if i.is_a? Array
  return RBT::Action::MapThisInputToThatRegisteredProgram.new(i, &block)
end

.mediumaquamarine(i = '', use_colours = use_colours? ) ⇒ Object

#

RBT.mediumaquamarine

#


14
15
16
17
18
19
20
# File 'lib/rbt/colours/html_colours.rb', line 14

def self.mediumaquamarine(
    i           = '',
    use_colours = use_colours?
  )
  return COLOURS::HtmlColoursMethods.mediumaquamarine(i) if use_colours
  return i
end

.mediumseagreen(i = '', use_colours = use_colours? ) ⇒ Object

#

RBT.mediumseagreen

#


186
187
188
189
190
191
192
# File 'lib/rbt/colours/html_colours.rb', line 186

def self.mediumseagreen(
    i           = '',
    use_colours = use_colours?
  )
  return COLOURS::HtmlColoursMethods.mediumseagreen(i) if use_colours
  return i
end

.mediumslateblue(i) ⇒ Object

#

RBT.mediumslateblue

#


74
75
76
77
# File 'lib/rbt/colours/html_colours.rb', line 74

def self.mediumslateblue(i)
  return COLOURS::HtmlColoursMethods.mediumslateblue(i) if use_colours?
  return i
end

.meson_appdir_configure(i = ARGV) ⇒ Object

#

RBT.meson_appdir_configure

#


69
70
71
# File 'lib/rbt/actions/individual_actions/meson_appdir_configure/meson_appdir_configure.rb', line 69

def self.meson_appdir_configure(i = ARGV)
  RBT::Action::MesonAppdirConfigure.new(i)
end

.meson_appdir_prefix(i = :use_cwd_as_input) ⇒ Object

#

RBT.meson_appdir_prefix

The argument to this method defaults to the symbol called :use_cwd_as_input, which will be translated into the current working directory.

#


125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/rbt/toplevel_methods/meson.rb', line 125

def self.meson_appdir_prefix(
    i = :use_cwd_as_input
  )
  case i
  when :use_cwd_as_input
    i = return_pwd
  end
  i = File.basename(i)
  require 'program_information'
  this_program_name    = ProgramInformation.return_name(i).delete('-_')
  this_program_version = ProgramInformation.return_version(i)
  use_this_build_directory = 'BUILD_DIRECTORY_FOR_MESON'
  use_this_prefix = programs_dir?+
                    this_program_name.capitalize+
                    '/'+
                    this_program_version+
                    '/'
  esystem 'meson --prefix='+use_this_prefix+' '+use_this_build_directory
  cd use_this_build_directory
  esystem 'ninja'
  esystem 'ninja install'
  e "#{rev}If everything went fine then the program "\
    "#{sfancy(this_program_name)} #{rev}has been compiled"
  e "#{rev}successfully into the prefix `#{sfancy(use_this_prefix)}#{rev}`."
end

.meson_build_file_exists?(check_for_this_file = 'meson.build', prepend_this_for_the_check = nil) ⇒ Boolean

#

RBT.meson_build_file_exists?

When we check for the file called “meson.build”, we must also keep in mind that we may use a build directory. This is the reason why the following code uses a variable.

#

Returns:

  • (Boolean)


298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 298

def self.meson_build_file_exists?(
    check_for_this_file        = 'meson.build',
    prepend_this_for_the_check = nil
  )
  case check_for_this_file
  when :default
    check_for_this_file = 'meson.build'
  end
  does_this_file_exist?( # Call the above method again here.
    check_for_this_file, prepend_this_for_the_check
  )
end

.missing_use_this_build_system_entryObject

#

RBT.missing_use_this_build_system_entry

#


118
119
120
# File 'lib/rbt/checks_and_validations/missing_use_this_build_system_entry.rb', line 118

def self.missing_use_this_build_system_entry
  RBT::Cookbooks::MissingUseThisBuildSystemEntry.new
end

.n_BLFS_entries?Boolean

#

RBT.n_BLFS_entries?

This method will return a number, indicating how many BLFS entries are registered in the BLFS project.

#

Returns:

  • (Boolean)


610
611
612
# File 'lib/rbt/actions/individual_actions/cookbooks/blfs/blfs.rb', line 610

def self.n_BLFS_entries?
  return array_all_BLFS_entries.size
end

.n_padding_to_use_for_opn?Boolean

#

RBT.n_padding_to_use_for_opn?

#

Returns:

  • (Boolean)


55
56
57
# File 'lib/rbt/toplevel_methods/opn.rb', line 55

def self.n_padding_to_use_for_opn?
  @n_padding_to_use_for_opn
end

.n_programs_available?Boolean

#

RBT.n_programs_available?

Determine how many programs are registered in the RBT project.

#

Returns:

  • (Boolean)


425
426
427
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 425

def self.n_programs_available?
  RBT.available_programs?.size
end

.namespace?Boolean

#

RBT.namespace?

#

Returns:

  • (Boolean)


624
625
626
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 624

def self.namespace?
  inspect
end

.new_url_action(input = nil, run_already = true) ⇒ Object

#

RBT.new_url_action

A way to instantiate from the top-level module namespace.

#


450
451
452
# File 'lib/rbt/url_action/url_action.rb', line 450

def self.new_url_action(input = nil, run_already = true)
  ::RBT::UrlAction.new(input, run_already) # Delegate to class RBT::UrlAction here.
end

.no_file_exists_at(i) ⇒ Object

#

RBT.no_file_exists_at

#


251
252
253
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 251

def self.no_file_exists_at(i)
  e "#{rev}No file exists at #{sfile(i)}#{rev}."
end
#

This method combines the two configure options “–no-trad” and “–no-symlink” into RBT::Action::Installer.new.

#


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rbt/toplevel_methods/no_trad_no_symlink.rb', line 15

def self.no_trad_no_symlink(
    these_programs = ARGV
  )
  require 'rbt/requires/require_actions.rb'
  # ======================================================================= #
  # Make sure that RBT::Action::Installer is available next:
  # ======================================================================= #
  [these_programs].flatten.compact.each {|this_program|
    _ = action(:Installer, 
      [
        this_program,'--no-trad','--no-symlink'
      ]
    )
  }
end

.not_found_libraries(i = ARGV) ⇒ Object

#

RBT.not_found_libraries

#


238
239
240
# File 'lib/rbt/utility_scripts/not_found_libraries.rb', line 238

def self.not_found_libraries(i = ARGV)
  RBT::NotFoundLibraries.new(i)
end

.ntrad(i = ARGV, &block) ⇒ Object

#

RBT.ntrad

#


189
190
191
# File 'lib/rbt/actions/individual_actions/ntrad/ntrad.rb', line 189

def self.ntrad(i = ARGV, &block)
  RBT::Action::Ntrad.new(i, &block)
end

.olivedrab(i = '', use_colours = use_colours?) ) ⇒ Object

#

RBT.olivedrab

#


178
179
180
181
# File 'lib/rbt/colours/html_colours.rb', line 178

def self.olivedrab(i = '', use_colours = use_colours?)
  return COLOURS::HtmlColoursMethods.olivedrab(i) if use_colours
  return i
end

.opn(i = NAMESPACE, &block) ⇒ Object

#

RBT.opn (opn tag, opnn tag)

The argument to this method may be interpreted as a “namespace” to be used.

#


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/rbt/toplevel_methods/opn.rb', line 65

def self.opn(
    i = NAMESPACE,
    &block
  )
  if @use_opn
    if i.is_a? String
      i.delete!('.') if i.include? '.'
      i = { namespace: i }
    end
    # ======================================================================= #
    # Support a little bit of padding:
    # ======================================================================= #
    if i.is_a?(Hash) and
       RBT.n_padding_to_use_for_opn?
      i.update(padding: @n_padding_to_use_for_opn)
    end
    Opn.opn(i, &block) # The NAMESPACE constant is already a Hash.
  end
end

.orange(i = '') ⇒ Object

#

RBT.orange

#


154
155
156
157
# File 'lib/rbt/colours/html_colours.rb', line 154

def self.orange(i = '')
  return COLOURS::HtmlColoursMethods.orange(i) if use_colours?
  return i
end

.packages_directory?Boolean

#

RBT.packages_directory?

#

Returns:

  • (Boolean)


1017
1018
1019
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1017

def self.packages_directory?
  @packages_directory
end

.patch(i) ⇒ Object

#

RBT.patch

This will simply make use of the Linux patch command (and wget too).

#


16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rbt/toplevel_methods/patch.rb', line 16

def self.patch(i)
  if i.is_a? Array
    i.each {|entry| patch(entry) }
  else
    _ = File.basename(i)
    unless File.exist? _
      esystem "wget #{i}"
    end
    esystem "patch -Np1 -i #{_}"
  end
end

.permanently_disable_coloursObject

#

RBT.permanently_disable_colours

This method can be used to permanently disable the colours for the RBT project. This essentially just saves into the file ‘use_colours.yml’.

To invoke this method from the commandline, try this command:

rbt --permanently-disable-colours
#


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/rbt/colours/permanently_disable_colours.rb', line 23

def self.permanently_disable_colours
  into = RBT.file_use_colours?
  what = YAML.dump(false)
  message_for_the_user = 'Permanently disabling the colours for the '\
                         'RBT project.'
  opn; e message_for_the_user
  opn; e "(file: #{sfile(into)})"
  write_what_into(what, into)
  if is_on_roebe?
    into = "#{RUBY_SRC_DIR_AT_HOME}"\
           "rbt/lib/rbt/yaml/configuration/"\
           "#{File.basename(FILE_USE_COLOURS)}"
    opn; e message_for_the_user
    opn; e "(file: #{sfile(into)})"
    write_what_into(what, into)
  end
end

.permanently_set_source_directory(i) ⇒ Object

#

RBT.permanently_set_source_directory

Use this method if you wish to permanently modify the source directory, that is, the directory where our archives will be stored.

Invocation example from the commandline:

rbt --set_source_dir=/opt
rbt --permanently-set-base-directory-to=/opt
#


776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 776

def self.permanently_set_source_directory(i)
  i = i.dup if i.frozen?
  i << '/' unless i.end_with? '/'
  unless i.start_with? '/'
    i.prepend('/') # We require leading '/'.
  end
  # ======================================================================= #
  # Modify the yaml file next:
  # ======================================================================= #
  what = i
  into = RBT.file_source_directory
  write_what_into(what, into)
  if block_given?
    yielded = yield
    case yielded
    when :be_verbose
      e "We will permanently set to a new source "\
        "directory next (#{sdir(i)})"
    end
  end
  opn; e "Setting the new source directory to point towards `#{sdir(what)}`."
  opn; e "Storing into the file `#{sfile(into)}` next."
  # ======================================================================= #
  # And also modify it on my home system, if IS_ROEBE is true. This will
  # go right into the configuration/ subirectory.
  # ======================================================================= #
  if is_on_roebe?
    into = "#{RUBY_SRC_DIR_RBT}yaml/configuration/"\
           "#{File.basename(into)}"
    opn; e "Will also store into the file `#{sfile(into)}`."
    RBT.write_what_into(what, into)
  end
  RBT.set_source_base_directory(i) # And also sync it back.
  unless File.directory? i
    opne 'Since that directory does not exist, it will be created now.'
    mkdir(i) { :be_quiet }
  end
end

.permanently_set_temp_directory(i) ⇒ Object

#

RBT.permanently_set_temp_directory

Use this method if you wish to permanently modify the temp directory, that is, the directory we will extract to (or to a subdirectory in that directory).

#


567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 567

def self.permanently_set_temp_directory(i)
  case i
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default,
       :pwd,
       'pwd'
    i = return_pwd.dup # Return the current working directory here.
  # ======================================================================= #
  # === :home_directory
  # ======================================================================= #
  when :home_directory
    i = (ENV['HOME'].to_s+'/').squeeze('/')
  end
  # ======================================================================= #
  # Next, ensure trailing '/' character - unless the input includes
  # a '$' character.
  # ======================================================================= #
  unless i.include? '$'
    i << '/' unless i.end_with? '/'
  end
  opn; e "Setting the new temp directory to point towards `#{sdir(i)}`."
  # ======================================================================= #
  # Modify the yaml file next:
  # ======================================================================= #
  what = i
  into = RBT.file_temp_directory_yaml
  RBT.write_what_into(what, into)
  # ======================================================================= #
  # And also modify it on my home system, if IS_ROEBE is set to true.
  # ======================================================================= #
  if is_on_roebe?
    into = "#{RUBY_SRC_DIR_RBT_YAML_AT_HOME}configuration/"\
           "#{File.basename(into)}"
    RBT.write_what_into(what, into)
  end
  RBT.set_temp_directory(i) # And also sync it.
  unless File.directory? i
    opne 'Since that directory does not exist, it will be created now.'
    mkdir(i) { :be_quiet }
  end
  i # Also return the variable, so we can re-use it in other methods.
end

.pin_this_program(i) ⇒ Object

#

RBT.pin_this_program

This toplevel-method can be used to “pin” down a specific program.

Pinned-down programs can not be installed. Users can unpin a pinned-down program though.

#


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/rbt/toplevel_methods/pin_and_unpin.rb', line 17

def self.pin_this_program(i)
  require 'rbt/requires/require_raw_yaml.rb'
  if is_a_registered_program?(i)
    # ===================================================================== #
    # Store into this file:
    # ===================================================================== #
    into = "#{log_dir?}pinned_programs.yml"
    opne "Pinning the program #{sfancy(i)} next."
    array_these_programs_are_pinned = []
    if File.exist? into
      array_these_programs_are_pinned << YAML.load_file(into)
    end
    array_these_programs_are_pinned << i
    opne "Storing into #{sfile(into)} next."
    array_these_programs_are_pinned.uniq!
    write_what_into(
      YAML.dump(
        array_these_programs_are_pinned
      ),
      into
    )
  else
    opne "#{sfancy(i)}#{rev} can not be pinned because it is not registered."
  end
end

.pkgconfig_directory?Boolean

#

RBT.pkgconfig_directory

#

Returns:

  • (Boolean)


1260
1261
1262
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1260

def self.pkgconfig_directory?
  @pkgconfig_directory
end

.predefined_installation_instructions?Boolean

#

RBT.predefined_installation_instructions?

#

Returns:

  • (Boolean)


60
61
62
# File 'lib/rbt/constants/predefined_installation_instructions.rb', line 60

def self.predefined_installation_instructions?
  @predefined_installation_instructions
end

.prefix?Boolean

#

RBT.prefix?

#

Returns:

  • (Boolean)


423
424
425
# File 'lib/rbt/actions/individual_actions/prefix/prefix.rb', line 423

def self.prefix?
  @prefix
end

.programs_directory?Boolean

#

RBT.programs_directory?

Query the value of the toplevel @programs_directory instance variable.

#

Returns:

  • (Boolean)


121
122
123
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 121

def self.programs_directory?
  @programs_directory
end

.project_base_directory?Boolean

#

RBT.project_base_directory?

This method will yield to us the base directory of the RBT project.

For example, it will return a String such as:

/Programs/Ruby/2.6.0/lib/ruby/site_ruby/2.6.0/rbt/
/home/Programs/Ruby/2.7.1/lib/ruby/site_ruby/2.7.0/rbt/

It may be another path on your computer system, such as /usr/lib/ruby/site_ruby/2.7.0/rbt/.

#

Returns:

  • (Boolean)


30
31
32
# File 'lib/rbt/project/project.rb', line 30

def self.project_base_directory?
  RBT::PROJECT_BASE_DIRECTORY
end

.project_yaml_dir?Boolean

#

RBT.project_yaml_dir?

This is a query-method for the constant PROJECT_YAML_DIRECTORY.

#

Returns:

  • (Boolean)


67
68
69
# File 'lib/rbt/project/project.rb', line 67

def self.project_yaml_dir?
  "#{project_base_dir?}yaml/"
end

.publish_list_of_all_programs_version(file_programs_version = RBT.file_programs_version) ⇒ Object

#

RBT.publish_list_of_all_programs_version

To invoke this method, do:

rbt --publish-list-of-all-programs-version
#


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/rbt/toplevel_methods/ftp.rb', line 29

def self.publish_list_of_all_programs_version(
    file_programs_version = RBT.file_programs_version # This is the file 'programs_version.yml'
  )
  _ = ''.dup
  opn; e 'The file '+sfile(file_programs_version)+' will next '\
         'be FTP-uploaded/published.'
  hash = YAML.load_file(file_programs_version)
  hash.each_pair {|name_of_the_program, program_version|
    _ << name_of_the_program.ljust(28)+program_version.to_s+N
  }
  what = _
  into = "#{RBT.store_into_this_directory}programs_version.txt"
  opn; e 'Storing into `'+sfile(into)+'`.'
  RBT::SaveFile.write_what_into(what, into)
  RBT.upload_list_of_all_programs_version(into)
  # ========================================================================= #
  # Also upload a .html variant.
  # ========================================================================= #
  RBT.upload_list_of_all_programs_version(into, :html)
end

.query_binary_to_package(i = '/usr/bin/') ⇒ Object

#

RBT.query_binary_to_package

The input argument should be the path to the directory that you wish to test. By default we will use ‘/usr/bin/’ as a target here.

#


252
253
254
# File 'lib/rbt/utility_scripts/query_binary_to_package.rb', line 252

def self.query_binary_to_package(i = '/usr/bin/')
  RBT::QueryBinaryToPackage.new(i)
end

.query_header_to_package(i = '/usr/include/') ⇒ Object

#

RBT.query_header_to_package

The input argument should be the path to the directory that you wish to test. By default we will use ‘/usr/include/’ as a target here.

#


247
248
249
# File 'lib/rbt/utility_scripts/query_header_to_package.rb', line 247

def self.query_header_to_package(i = '/usr/include/')
  RBT::QueryHeaderToPackage.new(i)
end

.raw_cookbook(i = ARGV, options_hash = {}, &block) ⇒ Object

#

RBT.raw_cookbook

Ideally use this method to instantiate a new raw cookbook instance.

Since as of February 2024 this is part of the RBT::Action namespace.

#


1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
# File 'lib/rbt/actions/individual_actions/cookbooks/raw_cookbook/raw_cookbook.rb', line 1385

def self.raw_cookbook(
    i            = ARGV,
    options_hash = {},
    &block
  )
  raw_cookbook = RBT::Action::Cookbooks::RawCookbook.new(i, :do_not_run_yet, &block)

  if options_hash and !options_hash.empty?
    options_hash.each_pair {|key, value|
      case key
      # ===================================================================== #
      # === :autogenerate_expanded_dataset
      # ===================================================================== #
      when :autogenerate_expanded_dataset
        raw_cookbook.set_autogenerate_expanded_dataset(value)
      end
    }
  end
  raw_cookbook.run
  return raw_cookbook
end

.rds(i) ⇒ Object

#

RBT.rds

Replace all ‘//’ with ‘/’ in a given string via this method.

#


14
15
16
# File 'lib/rbt/toplevel_methods/rds.rb', line 14

def self.rds(i)
  return i.squeeze('/') if i
end

.register_everythingObject

#

RBT.register_everything

#


60
61
62
# File 'lib/rbt/registered/register_everything.rb', line 60

def self.register_everything
  RBT::Cookbooks::RegisterEverything.new
end

.register_program_files_into_yaml_database(i = ARGV) ⇒ Object

#

RBT.register_program_files_into_yaml_database

#


320
321
322
# File 'lib/rbt/utility_scripts/register_program_files_into_yaml_database.rb', line 320

def self.register_program_files_into_yaml_database(i = ARGV)
  RBT::RegisterProgramFilesIntoYamlDatabase.new(i)
end

.register_program_files_into_yaml_database?Boolean

#

RBT.register_program_files_into_yaml_database?

#

Returns:

  • (Boolean)


44
45
46
# File 'lib/rbt/utility_scripts/register_program_files_into_yaml_database.rb', line 44

def self.register_program_files_into_yaml_database?
  @register_program_files_into_yaml_database
end

.registered_binaries?Boolean

#

RBT.registered_binaries?

Simply return an Array with all the binaries.

Full usage example:

require 'rbt/registered/registered_binaries.rb'
RBT.registered_binaries?
#

Returns:

  • (Boolean)


237
238
239
# File 'lib/rbt/registered/registered_binaries.rb', line 237

def self.registered_binaries?
  ALL_BINARIES.keys.uniq.sort
end

.registered_cookbook_entries?Boolean

#

RBT.registered_cookbook_entries?

Simply return all registered cookbook entries through this getter method.

#

Returns:

  • (Boolean)


789
790
791
# File 'lib/rbt/constants/constants.rb', line 789

def self.registered_cookbook_entries?
  REGISTERED_COOKBOOK_ENTRIES
end

.registered_gir_files?Boolean

#

RBT.registered_gir_files?

#

Returns:

  • (Boolean)


174
175
176
# File 'lib/rbt/registered/registered_gir_files.rb', line 174

def self.registered_gir_files?
  RBT::Cookbooks::RegisteredGirFiles.new
end

.registered_libraries?Boolean

#

RBT.registered_libraries?

#

Returns:

  • (Boolean)


147
148
149
# File 'lib/rbt/registered/registered_libraries.rb', line 147

def self.registered_libraries?
  RBT::Cookbooks::RegisteredLibraries.new
end

.registered_m4_files?Boolean

#

RBT.registered_m4_files?

#

Returns:

  • (Boolean)


189
190
191
# File 'lib/rbt/registered/registered_m4_files.rb', line 189

def self.registered_m4_files?
  RBT::Cookbooks::RegisteredM4Files.new
end

.registered_pkgconfig_files?Boolean

#

RBT.registered_pkgconfig_files?

#

Returns:

  • (Boolean)


194
195
196
# File 'lib/rbt/registered/registered_pkgconfig_files.rb', line 194

def self.registered_pkgconfig_files?
  RBT::Cookbooks::RegisteredPkgconfigFiles.new
end

.remove_empty_directories(i = :current_working_directory) ⇒ Object

#

RBT.remove_empty_directories

#


164
165
166
# File 'lib/rbt/utility_scripts/remove_empty_directories.rb', line 164

def self.remove_empty_directories(i = :current_working_directory)
  RBT::RemoveEmptyDirectories.new(i)
end

.remove_file(file, report_action = false) ⇒ Object

#

RBT.remove_file

Use this method to remove a file, but check if the file exists before actually deleting it. Additionally, also check for proper file permissions permissions as well.

#


318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 318

def self.remove_file(
    file,
    report_action = false
  )
  file = file.dup if file.frozen?
  file.squeeze!('/') # We do not want double '/' entries.
  case report_action
  # ======================================================================= #
  # === :be_quiet
  # ======================================================================= #
  when :be_quiet
    report_action = false
  # ======================================================================= #
  # === :be_verbose
  # ======================================================================= #
  when :be_verbose
    report_action = true
  end
  can_we_delete_this_entry = false
  can_we_delete_this_entry = true if File.exist? file
  begin
    case File.ftype(file)
    when 'link'
      can_we_delete_this_entry = true
    end
  rescue Errno::ENOENT
    can_we_delete_this_entry = true # Failsafe.
  end
  # ======================================================================= #
  # We also have to handle symlinks, aka 'link', entries. These may no
  # longer exist, but we still will to delete such stray links, hence
  # why the above check has to be the way it is.
  # ======================================================================= #
  if can_we_delete_this_entry
    # ===================================================================== #
    # We need to check whether we can write to the file at hand.
    # ===================================================================== #
    base_directory = File.dirname(file)
    if File.writable? base_directory
      unless File.directory? file # Safeguard.
        if report_action
          e "Now removing the file `#{sfile(file)}`."
        end
        if File.exist? file
          File.delete(file) # Remove the file here.
        else
          if report_action
            e "No file exists at `#{sfile(file)}`."
          end
        end
      end
    else
      opnn(__FILE__)
      ewarn "Insufficient permission to remove file #{sfile(file)}"
    end
  else # Not sure if we should report this.
    if report_action
      opnn(__FILE__)
      ewarn "Trying to remove a file, but the file #{sfile(where)}"
      ewarn ' does not exist.'
    end    
  end
end

.remove_file_extension(i) ⇒ Object

#

RBT.remove_file_extension

This method will try to remove anything we declare to be an “improper file extension”. In other words this method will remove the trailing archive type of a file, such as .tar.xz or .tar.gz and so forth.

The order is important here, in particular for entries such as “foobar-1.0.tar.xz” or “foobar-1.0.tar.gz”.

File.basename() is used to not have to worry about leading components, or ‘/’ entries.

#


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rbt/toplevel_methods/remove_file_extension.rb', line 23

def self.remove_file_extension(i)
  i = i.dup if i.frozen?
  if i
    # i = File.basename(i.to_s) # This was disabled in May 2023.
    i = i.to_s # However had, we need a String past this point.
    i = i.sub(/\.bz2$/,  ''). # Handle .tar.bz2 entries.
          sub(/\.gz$/,   ''). # Remove it before .tar.gz entries.
          sub(/\.zip$/,  '').
          sub(/\.har$/,  ''). # Java .jar files.
          sub(/\.tbz$/,  '').
          sub(/\.xz$/,   '').
          sub(/\.lz$/,   ''). # In particular to handle .tar.lz entries.
          sub(/\.Z$/,    '').
          sub(/\.7z$/,   '').
          sub(/\.tar$/,  '').
          sub(/\.js$/,   ''). # Javascript .js files.
          sub(/\.tgz$/,  '').
          sub(/\.tbz2$/, '').
          sub(/\.gzip$/, '').
          sub(/\.phar$/, '').
          sub(/\.txz$/,  '').
          sub(/\.gem$/,  ''). # Handle ruby .gem files here.
          sub(/\.yml$/,  '').
          sub(/\.js$/,   '').
          sub(/-trunk/,  ''). # ← Also remove weird things like that.
          sub(/-source/, '').  # ← and also this.
          sub(/&type=zip$/,'')
  end
  return i # Last but not least, always return it.
end

.remove_libtool_files_from(this_directory = '') ⇒ Object

#

RBT.remove_libtool_files_from

Easier top-level API for removing libtool files from a certain directory (and subdirectories).

The input-argument should be a locally existing directory which should contain .la files.

#


183
184
185
186
187
# File 'lib/rbt/libtool/remove_libtool_files/remove_libtool_files.rb', line 183

def self.remove_libtool_files_from(
    this_directory = ''
  )
  RBT::Libtool::RemoveLibtoolFiles.new(this_directory) # <- Just delegate to the class.
end

.remove_outdated_archives(i = ARGV, &block) ⇒ Object

#

RBT.remove_outdated_archives

#


363
364
365
366
367
368
# File 'lib/rbt/actions/individual_actions/remove_outdated_archives/remove_outdated_archives.rb', line 363

def self.remove_outdated_archives(
    i = ARGV,
    &block
  )
  return RBT::Action::RemoveOutdatedArchives.new(i, &block)
end

.remove_program(i = ARGV) ⇒ Object

#

RBT.remove_program

#


199
200
201
# File 'lib/rbt/utility_scripts/remove_program.rb', line 199

def self.remove_program(i = ARGV)
  RBT::RemoveProgram.new(i)
end

.remove_programsObject

#

RBT.remove_programs

#


151
152
153
# File 'lib/rbt/utility_scripts/remove_programs/remove_programs.rb', line 151

def self.remove_programs
  RBT::RemovePrograms.new
end
#
#


19
20
21
22
23
# File 'lib/rbt/checks_and_validations/check_for_faulty_current_symlinks.rb', line 19

def self.remove_symlink(i)
  if File.symlink? i
    File.delete(i)
  end
end

.report_all_registered_programs_of_homebrewObject

#

RBT.report_all_registered_programs_of_homebrew

#


49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/rbt/homebrew/registered_programs_of_homebrew.rb', line 49

def self.report_all_registered_programs_of_homebrew
  these_entries = RBT.return_all_registered_programs_of_homebrew
  e 'The following entries were found:'
  index = 0
  these_entries.each {|name_of_the_program, program_version| index += 1
    padded_index = (index.to_s.rjust(4)).ljust(6)
    colourized_and_padded_index = RBT.dodgerblue(padded_index)
    e '  '+colourized_and_padded_index+
      name_of_the_program.delete('-').ljust(40)+
      program_version
  }
end

.report_extended_information_about_this_program(i) ⇒ Object

#

RBT.report_extended_information_about_this_program

(feedback tag, debug tag, main tag)

Use this feedback-method to report extended information about a program, in a colourful manner. This program must have been registered in the Cookbooks namespace - otherwise we can not really display much about that program at hand.

The input to this method can be either be a String or an Array.

#


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/rbt/toplevel_methods/report_extended_information_about_this_program.rb', line 48

def self.report_extended_information_about_this_program(
    i
  )
  commandline_arguments = []
  if i.is_a? Array
    commandline_arguments << i.select {|line| line.start_with? '--'}
    i = i.first
  end
  commandline_arguments.flatten!
  commandline_arguments.compact!
  if i
    # ===================================================================== #
    # Delegate towards the sanitize_cookbook action next:
    # ===================================================================== #
    _ = action(:sanitize_cookbook, :do_not_run_yet) { :fast }
    unless commandline_arguments.empty?
      _.menu(commandline_arguments) # Pass the commandline arguments here.
    end
    _.find_this_program(i)
    _.report
    check_and_report_whether_file_exists(
      _.full_path?, _
    )
  end
end

.report_how_many_binaries_are_registeredObject

#

RBT.report_how_many_binaries_are_registered

This method will report how many binaries are registered in total.

Example output from this method:

RBT: There are 3849 registered binaries in all cookbook files.
#


25
26
27
28
29
# File 'lib/rbt/toplevel_methods/report_how_many_binaries_are_registered.rb', line 25

def self.report_how_many_binaries_are_registered
  n_binaries = RBT.all_binaries.keys.uniq.size
  opn; e "#{rev}There are #{sfancy(n_binaries.to_s)} #{rev}registered "\
         "binaries in all cookbook files."
end

.report_how_many_cookbook_entries_existObject

#

RBT.report_how_many_cookbook_entries_exist

#


437
438
439
440
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 437

def self.report_how_many_cookbook_entries_exist
  e "#{Colours.rev}There are a total of #{sfancy(n_programs_available?)} registered "\
    "programs, as part of the rbt-project."
end

.report_mate_desktop_versionObject

#

RBT.report_mate_desktop_version

#


719
720
721
# File 'lib/rbt/actions/individual_actions/information/report_mate_desktop_version.rb', line 719

def self.report_mate_desktop_version
  RBT::Action::ReportMateDesktopVersion.new
end

.report_n_programs_availableObject

#

RBT.report_n_programs_available

#


113
114
115
# File 'lib/rbt/utility_scripts/report_the_registered_programs.rb', line 113

def self.report_n_programs_available
  RBT::Cookbooks::ReportTheRegisteredPrograms.new { :short }
end

.report_rbt_version(optional_additional_activities = nil) ⇒ Object

#

RBT.report_rbt_version

This method will simply report the current RBT-version in use.

#


61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/rbt/version/version.rb', line 61

def self.report_rbt_version(
    optional_additional_activities = nil
  )
  require 'rbt/toplevel_methods/e_and_esystem.rb'
  require 'rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb'
  string = rbt_version?
  if optional_additional_activities
    case optional_additional_activities
    when :also_show_when_the_project_was_last_updated
      string = string.dup
      string << " (Last update: #{LAST_UPDATE})"
    end
  end
  e "#{sfancy(string)}#{rev}"
end

.report_the_kde_statusObject

#

RBT.report_the_kde_status

#


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/rbt/utility_scripts/report_the_kde_status.rb', line 17

def self.report_the_kde_status
  require 'rbt/colours/html_colours.rb'
  n_rjust = 7
  kde_frameworks_version = File.basename(
    REMOTE_URL_FOR_KDE_FRAMEWORKS
  ).rjust(n_rjust)
  kde_applications_version = File.basename(
    REMOTE_URL_FOR_KDE_APPLICATIONS.sub(/src\/$/,'')
  ).rjust(n_rjust)
  kde_plasma_version = File.basename(
    REMOTE_URL_FOR_KDE_PLASMA
  ).sub(/\.php$/,'').sub(/^plasma-/,'').
  rjust(n_rjust)
  e
  e "  #{rev}#{mediumslateblue('KDE Frameworks version:')}   "+
    "#{cyan(kde_frameworks_version)}"
  e '  '+mediumslateblue('KDE Applications version: ')+
    cyan(kde_applications_version)
  e '  '+mediumslateblue('KDE Plasma version:       ')+
    cyan(kde_plasma_version)
  e
end

.report_the_registered_programs(i = ARGV) ⇒ Object

#

RBT.report_the_registered_programs

#


106
107
108
# File 'lib/rbt/utility_scripts/report_the_registered_programs.rb', line 106

def self.report_the_registered_programs(i = ARGV)
  RBT::Cookbooks::ReportTheRegisteredPrograms.new(i)
end

.report_total_size_of_all_archivesObject

#

RBT.report_total_size_of_all_archives

This method can be used to report the total size of all locally available archives.

Invocation example from the commandline:

rbt --report_total_size_of_all_archives
#


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/rbt/toplevel_methods/archive_related_code.rb', line 74

def self.report_total_size_of_all_archives
  total_size = RBT.return_total_size_of_all_archives
  n_kilobytes = total_size  / 1024.0
  n_megabytes = n_kilobytes / 1024.0
  n_gigabytes = n_megabytes / 1024.0
  # ======================================================================= #
  # Finally, report it here.
  # ======================================================================= #
  e "#{rev}The total file size of all #{sfancy(available_programs.size.to_s)}"\
    " #{rev}programs is #{total_size.to_s} bytes."
  e steelblue(
      "  (#{n_kilobytes.round(2)} KB; "
    )+
    tomato(
      "#{n_megabytes.round(2)} MB"
    )+
    "#{rev}; "+
    crimson(
      n_gigabytes.round(2).to_s+' GB'
    )+"#{rev})"
end

.report_where_the_cookbook_directory_can_be_foundObject

#

RBT.report_where_the_cookbook_directory_can_be_found

This method will report where the cookbook directory can be found.

#


506
507
508
509
510
511
512
513
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 506

def self.report_where_the_cookbook_directory_can_be_found
  opn(namespace: RBT::NAMESPACE[:namespace])
  e "#{rev}The cookbook directory can be found at this location:"
  e
  e Colours.sfancy("  #{RBT.individual_cookbooks_directory?}")+
    rev
  e
end

.report_xfce_versionObject

#

RBT.report_xfce_version

#


306
307
308
# File 'lib/rbt/actions/individual_actions/information/report_xfce_version.rb', line 306

def self.report_xfce_version
  RBT::Action::ReportXfceVersion.new
end

.require_base_scriptsObject

#

RBT.require_base_scripts

#


16
17
18
# File 'lib/rbt/requires/require_base_scripts.rb', line 16

def self.require_base_scripts
  require 'rbt/base/base.rb'
end

.require_the_classes_for_individual_programsObject

#

RBT.require_the_classes_for_individual_programs

#


14
15
16
17
18
19
20
# File 'lib/rbt/requires/require_the_classes_for_individual_programs.rb', line 14

def self.require_the_classes_for_individual_programs
  Dir[
    "#{RBT.project_base_directory?}misc/classes_for_individual_programs/*.rb"
  ].uniq.each {|file|
    require "rbt/misc/classes_for_individual_programs/#{File.basename(file)}"
  }
end

.require_the_cookbook_utility_scriptsObject

#

RBT.require_the_cookbook_utility_scripts

#


14
15
16
17
18
# File 'lib/rbt/requires/require_the_cookbook_utility_scripts.rb', line 14

def self.require_the_cookbook_utility_scripts
  Dir["#{RBT.base_directory?}cookbooks/*.rb"].uniq.each {|file|
    require "rbt/cookbooks/#{File.basename(file)}"
  }
end

.require_the_generate_files_classesObject

#

RBT.require_the_generate_files_classes

#


14
15
16
17
18
# File 'lib/rbt/requires/require_the_generate_files_classes.rb', line 14

def self.require_the_generate_files_classes
  Dir["#{RBT.base_directory?}/generate_files/*.rb"].uniq.each {|file|
    require "rbt/generate_files/#{File.basename(file)}"
  }
end

.require_the_registered_componentsObject

#

RBT.require_the_registered_components

This method will require all .rb files under the rbt/registered/ directory.

#


17
18
19
20
21
# File 'lib/rbt/requires/require_the_registered_components.rb', line 17

def self.require_the_registered_components
  Dir["#{RBT.base_directory?}registered/*.rb"].each {|file|
    require "rbt/registered/#{File.basename(file)}"
  }
end

.require_the_toplevel_methodsObject

#

RBT.require_the_toplevel_methods

#


16
17
18
19
20
# File 'lib/rbt/requires/require_the_toplevel_methods.rb', line 16

def self.require_the_toplevel_methods
  Dir["#{RBT.toplevel_methods_directory?}*.rb"].uniq.each {|file|
    require "rbt/toplevel_methods/#{File.basename(file)}"
  }
end

.require_the_validation_scriptsObject

#

RBT.require_the_validation_scripts

use this method to require the validation scripts. They are not automatically required, though, because they are not typically needed by the end user.

#


20
21
22
23
24
# File 'lib/rbt/requires/require_the_validation_scripts.rb', line 20

def self.require_the_validation_scripts
  Dir["#{RBT.validation_directory}*.rb"].uniq.each {|file|
    require "rbt/checks_and_validations/#{File.basename(file)}"
  }
end

.require_utility_scriptsObject

#

RBT.require_utility_scripts

#


16
17
18
19
20
# File 'lib/rbt/requires/require_utility_scripts.rb', line 16

def self.require_utility_scripts
  Dir["#{RBT.utility_directory?}*.rb"].uniq.each {|file|
    require "rbt/utility_scripts/#{File.basename(file)}"
  }
end

.reset_error_messageObject

#

RBT.reset_error_message

#


53
54
55
# File 'lib/rbt/toplevel_methods/error_message.rb', line 53

def self.reset_error_message
  set_error_message # This will set to [] again.
end

.return_alias_program_name_for(i) ⇒ Object

#

RBT.return_alias_program_name_for

This method will return the (aliased) program name for the given input. If no alias name was found, it will return the input.

#


69
70
71
# File 'lib/rbt/aliases/aliases.rb', line 69

def self.return_alias_program_name_for(i)
  RBT::Cookbooks::Aliases.new(i).translate_alias
end

.return_all_abbreviations_of_this_array(i = determine_available_programs) ⇒ Object

#

RBT.return_all_abbreviations_of_this_array

This method will calculate all abbreviations for a given program.

It will NOT include the self-name, e. g. to avoid redundant ‘php’ => ‘php’ entries.

For lib-entries, such as “libX11”, entries such as “X11” will also work in principle, but this conflicts with e. g. “x11perf”. So we have to keep this in mind.

To store these abbreviations from the commandline, issue the following instruction:

rbt --store
#


218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 218

def self.return_all_abbreviations_of_this_array(
    i = determine_available_programs
  )
  require 'rbt/requires/require_raw_yaml.rb'
  require 'abbrev'
  # ======================================================================= #
  # The next constant refers to a location such as:
  #
  #   /Programs/Ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rbt/yaml/abbrevations_to_the_programs.yml
  #
  # ======================================================================= #
  file_abbreviations = RBT.file_abbreviations
  if File.exist?(file_abbreviations) and !File.empty?(file_abbreviations)
    # ===================================================================== #
    # If the abbreviations do exist, we will load up this file.
    # ===================================================================== #
    result = YAML.load_file(file_abbreviations)
  else
    # ===================================================================== #
    # Else we will have to re-create the file, or rather the content
    # of said file next.
    # ===================================================================== #
    result = {} # <- We will store into this Hash.
    # ===================================================================== #
    # Next, iterate over the registered programs:
    # ===================================================================== #
    i.each {|entry|
      # =================================================================== #
      # Obtain all abbreviations for this specific entry.
      # =================================================================== #
      abbreviations = Abbrev.abbrev([entry])
      # =================================================================== #
      # Next, if entry starts with 'lib', we will enable more aliases
      # to this name.
      # =================================================================== #
      if entry.start_with? 'lib'
        suffix = entry[3 .. -1]
        more_abbreviations = {}
        loop {
          more_abbreviations[suffix] = entry
          suffix.chop! # Chop off the last character, then continue.
          break if suffix.size < 1
        }
        more_abbreviations.update(abbreviations)
        abbreviations = more_abbreviations
      end
      # =================================================================== #
      # Now that the abbreviations have been entered, we will again
      # overwrite the result-hash with the core programs.
      # =================================================================== #
      abbreviations.reject! {|key, value|
        # ================================================================= #
        # Two conditions are possible here:
        #
        #   key == value means that this is a self-alias
        #     or
        #   it has already been defined
        #
        # ================================================================= #
        (key == value) or i.include?(key)
      }
      result.update(abbreviations)
    }
  end
  if File.exist? FILE_COOKBOOK_ALIASES
    # ===================================================================== #
    # If the file "cookbook_aliases.yml" exists, use that file to merge
    # it into the above abbreviations-hash.
    # ===================================================================== #
    result.update(
      YAML.load_file(FILE_COOKBOOK_ALIASES)
    ) if result
  end
  # ======================================================================= #
  # Merge in the file "windows_cookbook.yml".
  # ======================================================================= #
  if File.exist?(FILE_WINDOWS_COOKBOOK) and
     File.exist?(FILE_TRY_TO_USE_THE_FILE_WINDOWS_COOKBOOK) and
     File.read(FILE_TRY_TO_USE_THE_FILE_WINDOWS_COOKBOOK).strip.start_with?("t")
    array = YAML.load_file(FILE_WINDOWS_COOKBOOK).keys
    array = Abbrev.abbrev(array)
    result.update(array)
  end
  result
end

.return_all_archives_from_this_directory(i) ⇒ Object

#

RBT.return_all_archives_from_this_directory

This method will return all archives from a given directory.

#


224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 224

def self.return_all_archives_from_this_directory(i)
  i = i.first if i.is_a? Array
  i = i.dup if i.frozen?
  if i and File.directory?(i)
    i << '/' unless i.end_with? '/'
  end
  potential_matches = [] 
  ARRAY_REGISTERED_ARCHIVES.each {|file_format|
    potential_matches << Dir["#{i}*#{file_format}"]
  }
  potential_matches.flatten.compact
end

.return_all_registered_programs_of_homebrewObject

#

RBT.return_all_registered_programs_of_homebrew

#


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/rbt/homebrew/registered_programs_of_homebrew.rb', line 24

def self.return_all_registered_programs_of_homebrew
  require 'rbt/check_for_updates/base.rb'
  remote_url = REMOTE_URL_TO_THE_HOMEBREW_FORMULAS
  e "#{rev}Next checking the remote URL #{sfancy(remote_url)}#{rev}."
  _ = RBT::Cookbooks::CheckForRemoteWebpages.new
  _.obtain_dataset_from_the_remote_webpage(
    remote_url
  )
  result = _.dataset?
  # ======================================================================= #
  # The following regex-check can be seen here:
  #
  #   https://rubular.com/r/5b7Tsl61E6ovGO
  #
  # It has two matches.
  # ======================================================================= #
  use_this_regex = 
    /<td><a href="\/formula\/([A-Za-z0-9]+)">.+<\/a>/
  scanned = result.scan(use_this_regex).flatten.compact
  scanned
end

.return_alternative_archive(i = ARGV) ⇒ Object

#

RBT.return_alternative_archive

This variant will return an array.

#


186
187
188
# File 'lib/rbt/actions/individual_actions/find_alternative_archive/find_alternative_archive.rb', line 186

def self.return_alternative_archive(i = ARGV)
  return RBT::Action::FindAlternativeArchive.new(i).return_alternative_archives
end

.return_appdir_prefix(of_this_program) ⇒ Object

#

RBT.return_appdir_prefix

This method assumes that the input includes at the least one ‘-’, so that ProgramInformation can work on this properly.

Usage example:

RBT.return_appdir_prefix('htop-2.2.3')
#


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rbt/toplevel_methods/configure_appdir_prefix.rb', line 28

def self.return_appdir_prefix(
    of_this_program
  )
  if of_this_program.is_a? Array
    of_this_program = of_this_program.first
  end
  # ======================================================================= #
  # In the past, before September 2022, the method used .delete('-').
  # But this messed up ProgramInformation, so it was removed.
  # ======================================================================= #
  the_guessed_name = ProgramInformation.return_name(
                       of_this_program
                     ).capitalize
  return "#{programs_dir?}"\
         "#{the_guessed_name}/"\
         "#{ProgramInformation.return_version(of_this_program)}"\
         "/"
end

.return_archive_type(i = '.tar.xz') ⇒ Object

#

RBT.return_archive_type

This method will feedback the archive type in use, for the given input at hand.

It is used in class RBT::UpdateEntry, for example.

The default will be, as can be seen from the default argument, .tar.xz. Note that this assumption is not always correct, e. g. if the user does not repackage a given archive.

Note that the simple archives, such as .gem or .zip, could be detected automatically, but entries such as .tar.gz are harder to detect, hence why we will use a hardcoded case menu here.

Usage example:

RBT.return_archive_type('htop-1.2.0.tar.xz') # => '.tar.xz'
#


117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/rbt/toplevel_methods/archive_related_code.rb', line 117

def self.return_archive_type(
    i = '.tar.xz'
  )
  if i.is_a? Array
    i = i.first
  end
  # ======================================================================= #
  # === .tar.xz
  # ======================================================================= #
  if    i.end_with? '.tar.xz'
    '.tar.xz'
  # ======================================================================= #
  # === .xz
  # ======================================================================= #
  elsif i.end_with? '.xz'
    '.tar.xz'
  # ======================================================================= #
  # === .tar.gz
  # ======================================================================= #
  elsif i.end_with? '.tar.gz'
    '.tar.gz'
  # ======================================================================= #
  # === .tar.bz2
  # ======================================================================= #
  elsif i.end_with? '.tar.bz2'
    '.tar.bz2'
  # ======================================================================= #
  # === .tar.lz
  # ======================================================================= #
  elsif i.end_with? '.tar.lz'
    '.tar.lz'
  # ======================================================================= #
  # === .gem
  # ======================================================================= #
  elsif i.end_with? '.gem'
    '.gem'
  # ======================================================================= #
  # === .zip
  # ======================================================================= #
  elsif i.end_with? '.zip'
    '.zip'
  # ======================================================================= #
  # === .jar
  # ======================================================================= #
  elsif i.end_with? '.jar'
    '.jar'
  # ======================================================================= #
  # === .phar
  # ======================================================================= #
  elsif i.end_with? '.phar'
    '.phar'
  # ======================================================================= #
  # === .js
  # ======================================================================= #
  elsif i.end_with? '.js'
    '.js'
  else # else try to make an "educated guess" - via File.extname().
    # ===================================================================== #
    # But this can also return faulty results. For example, if the input
    # is "27.01.2019" then it does not make any sense to return ".2019" as
    # an archive type, since that is not an archive type. This is the
    # reason why specifically numbers are excluded in the following
    # check.
    # ===================================================================== #
    extname = File.extname(i)
    if extname.delete('.') =~ /^\d+$/ # If only numbers.
      extname = ''.dup
    end
    extname
  end
end

.return_array_of_programs_without_a_blfs_entryObject

#

RBT.return_array_of_programs_without_a_blfs_entry

This method will return an Array that keeps track of all local cookbook files without a BLSF entry.

This functionality can then be used to output this Array on the commandline

#


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rbt/toplevel_methods/return_array_of_programs_without_a_blfs_entry.rb', line 20

def self.return_array_of_programs_without_a_blfs_entry
  array_of_programs_without_a_blfs_entry = []
  # ======================================================================= #
  # First, obtain all available programs.
  # ======================================================================= #
  all_available_programs = RBT.available_programs?
  all_available_programs.each {|this_program|
    location = "#{individual_cookbooks_directory?}#{this_program}.yml"
    dataset = File.read(location)
    unless dataset =~ /^ blfs:/
      array_of_programs_without_a_blfs_entry << this_program
    end
  }
  # ======================================================================= #
  # Next, return the Array.
  # ======================================================================= #
  return array_of_programs_without_a_blfs_entry
end

.return_array_of_this_tag(i) ⇒ Object

#

RBT.return_array_of_this_tag

This method will return an Array of programs that qualify for a given tag.

The input argument to this method should be the name of the tag that is being sought, such as ‘php’ or ‘kde5’.

Usage examples:

RBT.return_array_of_this_tag 'php' # => ["drupal", "eaccelerator"]
RBT.return_array_of_this_tag 'kde5'
#


738
739
740
# File 'lib/rbt/cookbooks/search_for_tags/search_for_tags.rb', line 738

def self.return_array_of_this_tag(i)
  RBT::Cookbooks::SearchForTags.new(i.to_s) { :be_quiet }.array_of_programs.sort
end

.return_as_string_the_available_programs_versionsObject

#

RBT.return_as_string_the_available_programs_versions

#


201
202
203
# File 'lib/rbt/utility_scripts/save_the_available_programs_versions.rb', line 201

def self.return_as_string_the_available_programs_versions
  RBT::SaveTheAvailableProgramsVersions.new { :do_not_store }.result?
end

.return_base_directory_of_this_program(i) ⇒ Object

#

RBT.return_base_directory_of_this_program

This method will return the base-directory for a given program, such as “/home/x/src/htop/” for the program htop.

A String is returned from this method.

#


815
816
817
818
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 815

def self.return_base_directory_of_this_program(i)
  i = i.first if i.is_a? Array
  return "#{RBT.source_directory?}#{File.basename(i).delete('_')}/"
end

.return_binaries_of_this_program(i) ⇒ Object

#

RBT.return_binaries_of_this_program

This method will return the binaries of a given program at hand.

An Array will be returned which may look like this, for the program called “ruby”:

["erb", "gem", "irb", "rake", "ri", "rdoc", "ruby"]
#


20
21
22
23
24
25
# File 'lib/rbt/toplevel_methods/return_binaries_of_this_program.rb', line 20

def self.return_binaries_of_this_program(i)
  require 'rbt/requires/require_actions.rb'
  require 'rbt/requires/require_the_cookbook_class.rb'
  i = i.first if i.is_a? Array
  action(:SanitizeCookbook, i) { :fast }.binaries?
end

.return_blfs_page_of_this_program(this_program = 'gcc') ⇒ Object

#

RBT.return_blfs_page_of_this_program

This method will either return the BLFS page of the given program, as a String - or nil otherwise.

If a String is returned then we will assume that this is to the remote BLFS page entry of a (locally registered) program.

Returns:

- either a string
- or nil

Invocation examples:

x = RBT.return_blfs_page_of_this_program('gcc')
x = RBT.blfs(:openssl) # => http://www.linuxfromscratch.org/lfs/view/development/chapter06/openssl.html
x = RBT.blfs(:zvbi)    # => nil
#


635
636
637
638
639
640
641
642
643
644
# File 'lib/rbt/actions/individual_actions/cookbooks/blfs/blfs.rb', line 635

def self.return_blfs_page_of_this_program(
    this_program = 'gcc'
  )
  _ = RBT.blfs_instance(this_program) {
    :be_quiet_and_no_colours_and_do_not_tamper_with_the_xorg_buffer_and_do_not_open_in_the_browser
  }
  result = _.remote_url?
  result = result.first if result.is_a? Array
  return result
end

.return_cmake_options_of_this_program(i) ⇒ Object

#

RBT.return_cmake_options_of_this_program

#


802
803
804
805
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 802

def self.return_cmake_options_of_this_program(i)
  require 'rbt/requires/require_sanitize_cookbook.rb'
  action(:SanitizeCookbook, i).cmake_options?
end

.return_compile_time_statisticsObject

#

RBT.return_compile_time_statistics

#


202
203
204
# File 'lib/rbt/actions/individual_actions/statistics/return_compile_time_statistics.rb', line 202

def self.return_compile_time_statistics
  RBT::Action::Statistics::ReturnCompileTimeStatistics.new
end

.return_configuration_options_for?(this_program = ARGV) ⇒ Boolean

#

RBT.return_configuration_options_for?

This method will delegate towards class RBT::Action::Cookbooks::SanitizeCookbook.

Symbols are valid input to this method, as well as Strings.

Usage examples:

php_options  = RBT.return_configuration_options_for? 'php'
ruby_options = RBT.return_configuration_options_for? :ruby
#

Returns:

  • (Boolean)


796
797
798
799
800
# File 'lib/rbt/actions/individual_actions/cookbooks/show_configuration_options/show_configuration_options.rb', line 796

def self.return_configuration_options_for?(
    this_program = ARGV
  )
  RBT.action(:SanitizeCookbook, this_program).configuration_options?
end

.return_configure_options_of_this_program(i) ⇒ Object

#

RBT.return_configure_options_of_this_program

This method will return the GNU configure options of a program - that is options such as “–enable-static” that may be passed to “./configure” on the commandline.

Usage example:

RBT.return_configure_options_of_this_program('php') # => "--enable-bcmath" and so forth
#


6372
6373
6374
# File 'lib/rbt/actions/individual_actions/cookbooks/sanitize_cookbook/sanitize_cookbook.rb', line 6372

def self.return_configure_options_of_this_program(i)
  action(:sanitize_cookbook, i).configure_options?
end

.return_cookbook_dataset_for(i) ⇒ Object

#

RBT.return_cookbook_dataset_for

This will return the dataset for a given program, in a fast manner.

#


6356
6357
6358
# File 'lib/rbt/actions/individual_actions/cookbooks/sanitize_cookbook/sanitize_cookbook.rb', line 6356

def self.return_cookbook_dataset_for(i)
  RBT::Action::Cookbooks::SanitizeCookbook.return_dataset(i) { :fast }
end

.return_cookbook_for(i = :lua, &block) ⇒ Object

#

RBT.return_cookbook_for

This is an easier toplevel method to create a new cookbook-instance. Use with care, though.

#


6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
# File 'lib/rbt/actions/individual_actions/cookbooks/sanitize_cookbook/sanitize_cookbook.rb', line 6306

def self.return_cookbook_for(
    i = :lua,
    &block
  )
  if block_given?
    return RBT::Action::Cookbooks::SanitizeCookbook.new(i, &block)
  else
    return RBT::Action::Cookbooks::SanitizeCookbook.new(i) { :fast }
  end
end

.return_dateObject

#

RBT.return_date

This will return a date such as:

"20.05.2020"
#


19
20
21
# File 'lib/rbt/time/time.rb', line 19

def self.return_date
  ::Time.now.strftime('%d.%m.%Y')
end

.return_description_of(i) ⇒ Object

#

RBT.return_description_of

This method will return the description of the given program at hand.

Usage example:

x = RBT.return_description_of(:ruby)
#


6329
6330
6331
6332
6333
# File 'lib/rbt/actions/individual_actions/cookbooks/sanitize_cookbook/sanitize_cookbook.rb', line 6329

def self.return_description_of(i)
  i = i.first if i.is_a? Array
  _ = RBT::Action::Cookbooks::SanitizeCookbook.new(i)
  return _.description?.to_s
end

.return_games_componentsObject

#

RBT.return_games_components

Return, as Array, all registered games that are part of the RBT project.

Several aliases are available for this - see the aliases defined below the method here.

#


24
25
26
27
28
29
30
31
# File 'lib/rbt/toplevel_methods/games.rb', line 24

def self.return_games_components
  result = RBT.return_chained_programs['games']
  if result.is_a? String
    result = result.split(',')
  end
  result.map!(&:strip)
  return result.sort
end

.return_gnome1Object

#

return_gnome1

#


712
713
714
715
716
717
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 712

def self.return_gnome1
  result = return_chained_programs['gnome1']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_gnome2Object

#

return_gnome2

#


722
723
724
725
726
727
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 722

def self.return_gnome2
  result = return_chained_programs['gnome2']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_gnome3Object

#

return_gnome3

#


732
733
734
735
736
737
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 732

def self.return_gnome3
  result = return_chained_programs['gnome3']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_gnome4Object

#

return_gnome4

#


742
743
744
745
746
747
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 742

def self.return_gnome4
  result = return_chained_programs['gnome4']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_gnome5Object

#

RBT.return_gnome5

#


752
753
754
755
756
757
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 752

def self.return_gnome5
  result = return_chained_programs['gnome5']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_gnome_componentsObject

#

return_gnome_components

This method will conveniently return the Array holding all programs that belong to the Gnome stack.

#


827
828
829
830
831
832
833
834
835
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 827

def self.return_gnome_components
  array  = return_gnome1
  array << return_gnome2
  array << return_gnome3
  array << return_gnome4
  array << return_gnome5
  array.flatten!
  return array
end

.return_gtk_widget(which_widget = :compile_program) ⇒ Object

#

RBT.return_gtk_widget

This method should be moved into another .rb file in the long run, but for now it will just reside here.

#


758
759
760
761
762
763
764
765
766
767
768
# File 'lib/rbt/gui/universal_widgets/compile_program/compile_program.rb', line 758

def self.return_gtk_widget(
    which_widget = :compile_program
  )
  result = nil
  case which_widget
  when :compile_program,
       :default
    result = ::RBT::GUI::Gtk::CompileProgram
  end
  return result
end

.return_homepage_of?(i = ARGV) ⇒ Boolean

#

RBT.return_homepage_of?

This variant will silently return the homepage of a registered program, as a String.

If no homepage is registered in the .yml file then an empty String will be returned instead.

Usage example:

x = RBT.return_homepage_of? :htop # => "https://hisham.hm/htop/"
#

Returns:

  • (Boolean)


309
310
311
312
# File 'lib/rbt/cookbooks/homepage/homepage.rb', line 309

def self.return_homepage_of?(i = ARGV)
  _ = RBT::Cookbooks::Homepage.new(i) { :be_quiet }
  return _.homepage?
end

.return_kde5_applicationsObject

#

RBT.return_kde5_applications

This method will conveniently return the Array holding all programs that belong to the KDE5 Application pool.

As of 11.01.2020 there were 224 registered KDE5 applications in the RBT project.

This can be determined via the following method:

RBT.return_kde5_applications.size
#


60
61
62
63
64
65
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 60

def self.return_kde5_applications
  result = return_chained_programs['kde5_applications']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_kde5_foundationObject

#

RBT.return_kde5_foundation

This method will return the Array of programs that constitute the KDE5 foundation.

#


465
466
467
468
469
470
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 465

def self.return_kde5_foundation
  result = return_chained_programs['kde5_foundation']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_kde5_plasmaObject

#

RBT.return_kde5_plasma

This method will return all registered KDE5 plasma components, via an Array. Whenever you need to obtain all KDE5-plasma components, you should use only this method.

In Januar 2020 there were 46 registered KDE5 plasma components.

This can be queried via: RBT.return_kde5_plasma.size

#


450
451
452
453
454
455
456
457
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 450

def self.return_kde5_plasma
  result = return_chained_programs['kde5_plasma']
  if result.is_a? String
    result = result.split(',')
  end
  result.map!(&:strip)
  return result
end

.return_kde5_porting_aidsObject

#

RBT.return_kde5_porting_aids

This will return all KDE5 porting aids.

Invoke this method like so:

ry --batch-compile=kde5_porting_aids
#


431
432
433
434
435
436
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 431

def self.return_kde5_porting_aids
  result = return_chained_programs['kde5_porting_aids']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_kde5_portingaids(i = 1) ⇒ Object

#

RBT.return_kde5_portingaids

#


762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 762

def self.return_kde5_portingaids(
    i = 1
  )
  result = nil
  big_array = return_porting_aids
  big_array.flatten!
  if i.include? '..'
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ===================================================================== #
    # Prevent too high numbers next:
    # ===================================================================== #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result
  end
  result
end

.return_location_to_this_programs_yaml_file(i) ⇒ Object

#

RBT.return_location_to_this_programs_yaml_file

Easier access-method to determine where the yaml file may be.

Invocation example:

RBT.return_location_to_this_programs_yaml_file 'ruby'
#


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rbt/toplevel_methods/return_location_to_this_programs_yaml_file.rb', line 23

def self.return_location_to_this_programs_yaml_file(i)
  i = i.to_s unless i.is_a? String
  unless i.end_with? '.yml'
    i = i.dup if i.frozen?
    i << '.yml'
  end
  result = "#{individual_cookbooks_directory?}#{i}".dup
  if is_on_roebe?
    # ===================================================================== #
    # Hardcoded on my own system.
    # ===================================================================== #
    possible_target = "#{DIRECTORY_INDIVIDUAL_COOKBOOKS_AT_ROEBE_HOME}#{i}".dup
    if File.exist? possible_target
      result = possible_target
    end
  end
  return result
end

.return_lxqt_componentsObject

#

RBT.return_lxqt_components

This method will conveniently return the Array holding all programs that belong to the LX-QT pool.

#


522
523
524
525
526
527
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 522

def self.return_lxqt_components
  result = return_chained_programs['lxqt']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_mate_desktop_componentsObject

#

RBT.return_mate_desktop_components

This method will conveniently return the Array holding all programs that belong to the KDE5 Application pool.

Usage example:

RBT.return_mate_desktop_components # => ["matedesktop", "libmatemixer", "libmateweather", etc...
#


135
136
137
138
139
140
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 135

def self.return_mate_desktop_components
  result = return_chained_programs['all_of_the_mate_desktop']
  result = result.split(',') if result.is_a?(String) and result.include?(',')
  result.map!(&:strip)
  return result
end

.return_mate_desktop_version_arrayObject

#

RBT.return_mate_desktop_version_array (array tag)

This variant will return a nested Array with the proper versions in use.

Invocation example:

puts RBT.return_mate_desktop_version_array
#


696
697
698
# File 'lib/rbt/actions/individual_actions/information/report_mate_desktop_version.rb', line 696

def self.return_mate_desktop_version_array
  RBT::Action::ReportMateDesktopVersion.new { :do_not_report_anything }.array?
end

.return_mate_desktop_version_stringObject

#

RBT.return_mate_desktop_version_string

This method will return the String that contains the information which mate-desktop components are available. That way we can then embed this String in other programs.

Usage example:

x = RBT.return_mate_desktop_version_string
#


712
713
714
# File 'lib/rbt/actions/individual_actions/information/report_mate_desktop_version.rb', line 712

def self.return_mate_desktop_version_string
  RBT::Action::ReportMateDesktopVersion.new { :do_not_report_anything }.string?
end

.return_meson_configure_options_of_this_program(i) ⇒ Object

#

RBT.return_meson_configure_options_of_this_program

#


529
530
531
532
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 529

def self.return_meson_configure_options_of_this_program(i)
  require 'rbt/requires/require_sanitize_cookbook.rb'
  action(:SanitizeCookbook, i).meson_options?
end

.return_post_xorg_server_componentsObject

#

RBT.return_post_xorg_server_components

#


615
616
617
618
619
620
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 615

def self.return_post_xorg_server_components
  result = return_chained_programs['xorg_server_and_post_xorg_server']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_program_name_and_program_version_from_this_github_url(i = 'https://github.com/commonmark/cmark/archive/0.29.0.tar.gz', use_this_as_the_program_name = nil) ⇒ Object

#

RBT.return_program_name_and_program_version_from_this_github_url

This method will accept a String such as:

'https://github.com/commonmark/cmark/archive/0.29.0.tar.gz'
'https://github.com/brndnmtthws/conky/archive/v1.11.5.tar.gz'

It will then return something like:

'cmake-0.29.0'
'conky-1.11.5'

Thus, this is the program_name_and_program_version string from a valid cookbook .yml file.

Note that the method will NOT assume that the input to it is valid - it only works on input-strings such as the one specified above.

#


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/rbt/toplevel_methods/url.rb', line 156

def self.return_program_name_and_program_version_from_this_github_url(
    i                            = 'https://github.com/commonmark/cmark/archive/0.29.0.tar.gz',
    use_this_as_the_program_name = nil
  )
  result = ''.dup
  program_version = File.basename(i.dup)
  program_version = remove_archive_from_the_end(
    program_version.delete('v') # This .delete due to 'v'.
  )
  if use_this_as_the_program_name.nil?
    use_this_as_the_program_name = i.split('/')[4]
  end
  result << "#{use_this_as_the_program_name}-#{program_version}"
  return result
end

.return_programs_from_this_url(i) ⇒ Object

#

RBT.return_programs_from_this_url

The task of this method is to return an Array of programs that can be found on a remote URL.

If we take the example below for KDE’s plasma related code, then the Array that will be returned will include the names of all the programs that can be found at that particular remote URL.

This then allows us to do various further checks, such as whether the RBT project is tracking all these programs or not, and so forth.

The first input argument to this method is assumed to be a remote URL, as a String - so only pass an URL to the method here.

Specific invocation example in ruby:

pp RBT.return_program_from_this_url('https://download.kde.org/Attic/plasma/5.16.5/'); ''

Result will be an Array such as this one here:

["powerdevil", "sddmkcm", "systemsettings", "usermanager", "xdgdesktopportalkde"]
#


197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/rbt/toplevel_methods/url.rb', line 197

def self.return_programs_from_this_url(i)
  require 'open-uri'
  begin
    require 'program_information' unless Object.const_defined? :ProgramInformation
  rescue LoadError; end
  i = i.first if i.is_a? Array
  regex_to_use = /<tr><td valign="top">&nbsp;<\/td><td><a href="(.+?)">/ # See: http://rubular.com/r/fIcvzXfPi1
  dataset = URI.open(i).read
  scanned = dataset.scan(regex_to_use).flatten
  scanned.reject! {|entry| entry.end_with? '.sig' or entry.start_with? '/' }
  scanned.map! {|entry|
    entry.sub!(/\.xz$/,'')
    entry.sub!(/\.tar$/,'')
    program_name = ProgramInformation.return_program_name(entry)
    program_name
  }
  scanned.uniq!
  return scanned.sort
end

.return_programs_that_are_exlusively_registered_in_the_homebrew_programsObject

#

RBT.return_programs_that_are_exlusively_registered_in_the_homebrew_programs

Usage example:

x = RBT.return_programs_that_are_exlusively_registered_in_the_homebrew_programs
#


70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rbt/homebrew/registered_programs_of_homebrew.rb', line 70

def self.return_programs_that_are_exlusively_registered_in_the_homebrew_programs
  require 'rbt/toplevel_methods/available_programs.rb'
  # ======================================================================= #
  # Obtain all available programs next.
  # ======================================================================= #
  available_programs = RBT.available_programs?
  # ======================================================================= #
  # Obtain all programs available in the homebrew "registry". We will
  # query this "registry" by parsing the homepage.
  # ======================================================================= #
  remote_registered_programs = RBT.return_all_registered_programs_of_homebrew.map {|entry|
    entry.delete('-_')
  } # On 25.08.2022 this Array had 4618 programs registered.
  remote_registered_programs.reject! {|entry|
    available_programs.include?(entry)
  } # On 25.08.2022, the unique entries at homebrew included
    # 3699 programs not registered in the RBT suite.
  return remote_registered_programs
end

.return_pwdObject

#

RBT.return_pwd

This method will return the current working directory.

#


190
191
192
193
194
195
196
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 190

def self.return_pwd
  begin
    ("#{Dir.pwd}/").squeeze '/'
  rescue
    './'.dup # Assume this to be used in the current directory then.
  end
end

.return_python_addonsObject

#

RBT.return_python_addons

#


70
71
72
73
74
75
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 70

def self.return_python_addons
  result = return_chained_programs['python_addons']
  result = result.split(',') if result.is_a?(String) and result.include?(',')
  result.map!(&:strip)
  return result
end

.return_remote_url_from_this_input(remote_url = 'http://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.xz', version = '2.28') ⇒ Object

#

RBT.return_remote_url_from_this_input

Give the below input, this method should return a String like:

https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.xz

In other words, you have to supply the arguments.

The method has to remain quite flexible. For instance, it must work correctly when the first argument is “github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1.tgz” and the second argument is a more complex variant such as “icu4c-68.2.tar.xz”.

#


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rbt/toplevel_methods/url.rb', line 31

def self.return_remote_url_from_this_input(
    remote_url = 'http://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.xz',
    version    = '2.28'
  )
  # ======================================================================= #
  # First, get rid of any trailing archive parts for version,
  # such as "icu4c-68.2.tar.xz". Then we will have only
  # "icu4c-68.2" left, which is much better.
  # ======================================================================= #
  version = RBT.remove_archive_from_the_end(version)
  begin
    require 'program_information'
    if version.include? '-' # In this case assume something like "icu4c-68.2"
      version = ProgramInformation.return_version(version)
    end
    program_version = ProgramInformation.return_version(remote_url)
    result = remote_url.gsub( # Do a global sub since as of September 2022.
      program_version, version
    )
    return result
  rescue LoadError; end
end

.return_string_containing_all_program_versionsObject

#

RBT.return_string_containing_all_program_versions

This method will return a string containing all programs versions of the registered programs that are part of the RBT project. Do note that the yaml file at hand has to exist, in order for the code in this method to work properly.

#


21
22
23
24
25
26
27
28
29
30
# File 'lib/rbt/toplevel_methods/return_string_containing_all_program_versions.rb', line 21

def self.return_string_containing_all_program_versions
  file_location = RBT.file_programs_version
  if File.exist? file_location
    data = File.read(file_location)
    return data
  else
    no_file_exists_at(file_location)
    nil
  end
end

.return_string_containing_all_program_versions_the_last_update_and_the_remote_URLObject

#

RBT.return_string_containing_all_program_versions_the_last_update_and_the_remote_URL

This method will return a much longer String, containing all program versions of the registered programs, as well as when the last update happened, and the remote URL.

This depends on the expanded cookbooks dataset.

The four entries should be:

(1) program name
(2) program version
(3) last update of this program (in regards to the cookbooks project)
(4) remote URL
#


49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/rbt/toplevel_methods/return_string_containing_all_program_versions.rb', line 49

def self.return_string_containing_all_program_versions_the_last_update_and_the_remote_URL
  require 'yaml'
  return_this_string = ''.dup
  string = return_string_containing_all_program_versions
  if string
    string.split(N).sort.each {|line|
      # =================================================================== #
      # The line will be like this:
      #
      #   zziplib: "0.13.66"
      #
      # =================================================================== #
      _ = line.split(':')
      program_name = _.first.delete('-')
      program_version = _.last.delete('"')
      this_file = "#{RBT.directory_expanded_cookbooks?}#{program_name}.yml"
      if File.exist? this_file
        dataset = YAML.load_file(this_file)
        last_update = dataset['last_update']
        remote_URL  = dataset['url1']
        return_this_string << 
          "#{program_name.ljust(28)} #{program_version.to_s.ljust(13)} #{last_update} #{remote_URL}\n"
      end
    }
    return return_this_string
  end
end

.return_string_showing_the_last_updated_programsObject

#

RBT.return_string_showing_the_last_updated_programs

This method will return a String showing the last updated programs.

#


98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 98

def self.return_string_showing_the_last_updated_programs
  _ = ''.dup
  into = "#{rbt_log_dir?}these_programs_were_updated_copy.yml"
  if is_on_roebe? and
    File.exist?("#{::RBT::RUBY_SRC_DIR}rbt/lib/rbt/yaml/these_programs_were_updated.yml")
    # ===================================================================== #
    # In this case prefer my file at home.
    # ===================================================================== #
    into = "#{::RBT::RUBY_SRC_DIR}rbt/lib/rbt/yaml/these_programs_were_updated_copy.yml"
  end
  if File.exist? into
    dataset = File.readlines(into)
    dataset.each {|line|
      # =================================================================== #
      # A line may look like this:
      #
      #   - libhandy                       # program_version: 0.84.0 17.07.2020-12:08:21
      #
      # =================================================================== #
      splitted = line.split('#').map(&:strip)
      name_of_the_program = splitted.first.delete('-').strip
      program_version     = splitted.last.strip.sub(/program_version:/,'').
                            strip.split(' ').first.to_s
      this_date = line.split(' ').last
      _ << "#{name_of_the_program} was updated "\
           "to program version #{program_version} "\
           "(on: #{this_date})\n"
    }
    return _
  else
    no_file_exists_at(into)
  end
end

.return_the_associated_program_of_this_gir_file(i) ⇒ Object

#

RBT.return_the_associated_program_of_this_gir_file

Invocation example:

RBT.return_the_associated_program_of_this_gir_file('xau.pc') # => "libxau"
#


194
195
196
# File 'lib/rbt/registered/registered_gir_files.rb', line 194

def self.return_the_associated_program_of_this_gir_file(i)
  YAML.load_file(file_registered_gir_files)[i]
end

.return_the_associated_program_of_this_m4_file(i) ⇒ Object

#

RBT.return_the_associated_program_of_this_m4_file

Invocation example:

RBT.return_the_associated_program_of_this_m4_file('pkg.m4') # => "libxau"
#


213
214
215
# File 'lib/rbt/registered/registered_m4_files.rb', line 213

def self.return_the_associated_program_of_this_m4_file(i)
  YAML.load_file(file_registered_m4_files)[i]
end

.return_the_associated_program_of_this_pkgconfig_file(i) ⇒ Object

#

RBT.return_the_associated_program_of_this_pkgconfig_file

Invocation example:

RBT.return_the_associated_program_of_this_pkgconfig_file('xau.pc') # => "libxau"
#


218
219
220
# File 'lib/rbt/registered/registered_pkgconfig_files.rb', line 218

def self.return_the_associated_program_of_this_pkgconfig_file(i)
  YAML.load_file(file_registered_pkgconfig_files)[i]
end

.return_the_program_belonging_to_this_header_file(i) ⇒ Object

#

RBT.return_the_program_belonging_to_this_header_file

Usage examples:

RBT.return_the_program_belonging_to_this_header_file('ao.h') # => "libao"
RBT.return_the_program_belonging_to_this_header_file('aoee.h') # => nil
#


166
167
168
# File 'lib/rbt/actions/individual_actions/headers/headers.rb', line 166

def self.return_the_program_belonging_to_this_header_file(i)
  RBT::Action::Headers.new(i).match?
end

.return_this_game_component(i) ⇒ Object

#

RBT.return_this_game_component

The input to this method should typically be a number, such as 1 (or its String-variant “1”).

Invocation example from the commandline:

ry --game1
ry --game4
#


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 24

def self.return_this_game_component(i)
  result = nil
  big_array = return_games_components
  big_array.flatten!
  if i.to_s.include? '..'
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ===================================================================== #
    # Prevent too high numbers next:
    # ===================================================================== #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result
  end
  return result
end

.return_this_gnome_component(i = 1) ⇒ Object

#

RBT.return_this_gnome_component

The input to this method should typically be a number, such as 1 (or its String-variant “1”).

Invocation example from the commandline:

ry --gnome1
#


797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 797

def self.return_this_gnome_component(
    i = 1
  )
  result = nil
  big_array = return_gnome_components
  big_array.flatten!
  if i.include? '..'
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ======================================================================= #
    # Prevent too high numbers next:
    # ======================================================================= #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result
  end
  result
end

.return_this_kde_component(i = 1) ⇒ Object

#

RBT.return_this_kde_component

The input to this method should typically be a number, such as 1 (or its String-variant “1”).

Invocation examples from the commandline:

ry --kde3
ry --kde1..kde250
#


678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 678

def self.return_this_kde_component(
    i = 1
  )
  result = nil
  big_array  = return_kde5_foundation   # === KDE5 Foundation
  big_array << return_kde5_porting_aids # === KDE5 Porting Aids
  big_array << return_kde5_applications # === KDE5 Applications
  big_array << return_kde5_plasma       # === KDE5 Plasma
  big_array.flatten!
  if i.include? '..'
    # ===================================================================== #
    # First we chop away 'kde' if this string exists.
    # ===================================================================== #
    i.sub!(/kde/,'') if i.include? 'kde'
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ===================================================================== #
    # We need numbers past this point. We also have to prevent too
    # high numbers, which the following code will do for us.
    # ===================================================================== #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result
  end
  result
end

.return_this_lxqt_component(i) ⇒ Object

#

RBT.return_this_lxqt_component

The input to this method should typically be a number, such as 1 (or its String-variant “1”).

Invocation example from the commandline:

ry --lxqt3
#


495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 495

def self.return_this_lxqt_component(i)
  result = nil
  big_array = return_lxqt_components
  big_array.flatten!
  if i.to_s.include? '..'
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ===================================================================== #
    # Prevent too high numbers next:
    # ===================================================================== #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result
  end
  result
end

.return_this_mate_component(i = 1) ⇒ Object

#

RBT.return_this_mate_component

The input to this method should typically be a number, such as 1 (or its String-variant “1”).

Invocation example from the commandline:

ry --mate3

On my home system I can also use aliases such as these:

mate1
mate2
mate3

And so forth.

#


160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 160

def self.return_this_mate_component(
    i = 1
  )
  result = nil
  big_array = return_mate_desktop_components
  big_array.flatten!
  if i.to_s.include? '..'
    # ===================================================================== #
    # Handle pseudo-ranges here:
    # ===================================================================== #
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ===================================================================== #
    # Prevent too high numbers next:
    # ===================================================================== #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result, by deducting one.
  end
  return result
end

.return_this_plasma_component(i = 1) ⇒ Object

#

RBT.return_this_plasma_component

The input to this method should typically be a number, such as 1 (or its String-variant “1”).

Invocation example from the commandline:

ry --plasma3
#


643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 643

def self.return_this_plasma_component(
    i = 1
  )
  result = nil
  big_array = return_kde5_plasma # === KDE5 Plasma
  big_array.flatten!
  if i.include? '..'
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ===================================================================== #
    # Prevent too high numbers next:
    # ===================================================================== #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result
  end
  result
end

.return_this_xfce_component(i) ⇒ Object

#

RBT.return_this_xfce_component

The input to this method should typically be a number, such as 1 (or its String-variant “1”).

Invocation example from the commandline:

ry --xfce1
#


102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 102

def self.return_this_xfce_component(i)
result = nil
  big_array = return_xfce_components
  big_array.flatten!
  if i.to_s.include? '..'
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ===================================================================== #
    # Prevent too high numbers next:
    # ===================================================================== #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result
  end
  result
end

.return_this_xorg_component(i) ⇒ Object

#

RBT.return_this_xorg_component

The input to this method should typically be a number, such as 1 (or its String-variant “1”).

Invocation example from the commandline:

ry --xorg1
#


540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 540

def self.return_this_xorg_component(i)
  result = nil
  big_array = return_xorg_components
  big_array.flatten!
  if i.to_s.include? '..'
    splitted = i.split('..')
    first_number = splitted.first.to_i - 1
    last_number  = splitted.last.to_i - 1
    last_number  = (big_array.size - 1) if last_number > (big_array.size)
    result = big_array[first_number, last_number]
  else
    # ===================================================================== #
    # Prevent too high numbers next:
    # ===================================================================== #
    i = i.to_i # ← We need Integers past this point.
    i = (big_array.size - 1) if i > (big_array.size - 1)
    result = big_array[i - 1] # Find the proper result
  end
  result
end

.return_timeObject

#

RBT.return_time

This method will return the current time, in hours:minutes::seconds such as “10:11:45”.

#


29
30
31
# File 'lib/rbt/time/time.rb', line 29

def self.return_time
  ::Time.now.strftime('%H:%M:%S')
end

.return_total_size_of_all_archives(use_this_key = :program_path) ⇒ Object

#

RBT.return_total_size_of_all_archives

#


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/rbt/toplevel_methods/archive_related_code.rb', line 37

def self.return_total_size_of_all_archives(
    use_this_key = :program_path
  )
  total_size = 0
  available_programs = available_programs?
  available_programs.each {|this_program|
    possible_target = "#{RBT.directory_expanded_cookbooks?}"\
                      "#{this_program}.yml"
    if File.exist? possible_target
      dataset = YAML.load_file(possible_target)
      program_path = dataset[use_this_key]
    else
      # =================================================================== #
      # The expanded-cookbooks file does not exist, so use
      # Cookbooks::Cookbook instead.
      # =================================================================== #
      require 'rbt/requires/require_the_cookbook_class.rb'
      program_path = ::RBT::Cookbooks::SanitizeCookbook.new(this_program).program_path?
    end
    if program_path and File.exist?(program_path)
      total_size += File.size(program_path)
    end
  }
  return total_size
end

.return_url1_of_this_program(i = 'ruby') ⇒ Object

#

RBT.return_url1_of_this_program

This method will return the url1: entry of the given program at hand.

#


356
357
358
# File 'lib/rbt/cookbooks/url/url.rb', line 356

def self.return_url1_of_this_program(i = 'ruby')
  RBT::Cookbooks::Url.new(i) { :be_quiet }.url1?
end

.return_version_of_this_program(i = 'htop') ⇒ Object

#

RBT.return_version_of_this_program

Usage example:

RBT.return_version_of_this_program 'htop'
#


20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rbt/toplevel_methods/return_version_of_this_program.rb', line 20

def self.return_version_of_this_program(i = 'htop')
  if i.is_a? Array
    i = i.first
  end
  i = i.to_s # We have to work on Strings.
  if RBT.does_include? i
    dataset = action(:SanitizeCookbook, i) { :fast }
    return dataset.program_version?
  else
    nil
  end
end

.return_xfce_components(i = 'xfce') ⇒ Object

#

RBT.return_xfce_components

This method will conveniently return the Array holding all programs that belong to the KDE5 Application pool.

#


83
84
85
86
87
88
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 83

def self.return_xfce_components(i = 'xfce')
  result = return_chained_programs[i]
  result = result.split(',') if result.is_a?(String) and result.include?(',')
  result.map!(&:strip)
  return result
end

.return_xfce_version_arrayObject

#

RBT.return_xfce_version_array (array tag)

This variant will return a nested Array with the proper versions in use.

Invocation example:

puts RBT.return_xfce_version_array
#


283
284
285
# File 'lib/rbt/actions/individual_actions/information/report_xfce_version.rb', line 283

def self.return_xfce_version_array
  RBT::Action::ReportXfceVersion.new { :do_not_report_anything }.array?
end

.return_xfce_version_stringObject

#

RBT.return_xfce_version_string

This method will return the String that contains the information which mate-desktop components are available. That way we can then embed this String in other programs.

Usage example:

x = RBT.return_xfce_version_string
#


299
300
301
# File 'lib/rbt/actions/individual_actions/information/report_xfce_version.rb', line 299

def self.return_xfce_version_string
  RBT::Action::ReportXfceVersion.new { :do_not_report_anything }.string?
end

.return_xorg_appsObject

#

RBT.return_xorg_apps

#


585
586
587
588
589
590
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 585

def self.return_xorg_apps
  result = return_chained_programs['xorg_apps']
  result = result.split(',') if result.include? ','
  result.map!(&:strip)
  return result
end

.return_xorg_componentsObject

#

RBT.return_xorg_components

This method will conveniently return the Array holding all programs that belong to the KDE5 Application pool.

#


203
204
205
206
207
208
209
210
211
212
213
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 203

def self.return_xorg_components
  array  = []
  array << return_xorg_data
  array << return_xorg_libraries
  array << return_xorg_utils
  array << return_xorg_apps
  array << return_xorg_fonts
  array << return_xorg_server_and_post_xorg_server
  array.flatten!
  return array
end

.return_xorg_dataObject

#

RBT.return_xorg_data

#


575
576
577
578
579
580
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 575

def self.return_xorg_data
  result = return_chained_programs['xorg_data']
  result = result.split(',') if result.include? ','
  result.map!(&:strip)
  return result
end

.return_xorg_fontsObject

#

RBT.return_xorg_fonts

#


595
596
597
598
599
600
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 595

def self.return_xorg_fonts
  result = return_chained_programs['xorg_fonts']
  result = result.split(',') if result.include? ','
  result.map!(&:strip)
  return result
end

.return_xorg_librariesObject

#

RBT.return_xorg_libraries

#


565
566
567
568
569
570
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 565

def self.return_xorg_libraries
  result = return_chained_programs['xorg_libraries']
  result = result.split(',') if result.include? ','
  result.map!(&:strip)
  return result
end

.return_xorg_serverObject

#

RBT.return_xorg_server

#


190
191
192
193
194
195
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 190

def self.return_xorg_server
  result = return_chained_programs['xorg_server']
  result = result.split(',') if result.include? ','
  result.map!(&:strip)
  return result
end

.return_xorg_server_and_post_xorg_serverObject

#

RBT.return_xorg_server_and_post_xorg_server

#


605
606
607
608
609
610
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 605

def self.return_xorg_server_and_post_xorg_server
  result = return_chained_programs['xorg_server_and_post_xorg_server']
  result = result.split(',') if result.include? ','
  result.map!(&:strip)
  return result
end

.return_xorg_server_librariesObject

#

RBT.return_xorg_server_libraries

#


475
476
477
478
479
480
481
482
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 475

def self.return_xorg_server_libraries
  result = return_chained_programs[
    try_to_find_shortcut_for_a_chain_compiled_program('xorg_server_libraries')
  ]
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.return_xorg_utilsObject

#

RBT.return_xorg_utils

#


625
626
627
628
629
630
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 625

def self.return_xorg_utils
  result = return_chained_programs['xorg_utils']
  result = result.split(',') if result.is_a? String
  result.map!(&:strip)
  return result
end

.returned_chained_programs_of_the_mate_desktopObject

#

RBT.returned_chained_programs_of_the_mate_desktop

This will return the mate-desktop entry, in a sanitized manner, in Array form.

#


719
720
721
722
723
724
725
726
727
728
729
# File 'lib/rbt/constants/constants.rb', line 719

def self.returned_chained_programs_of_the_mate_desktop
  result = return_chained_programs['all_of_the_mate_desktop']
  if result.is_a? String
    result = result.delete("\n").delete(' ')
    # ===================================================================== #
    # Turn it into an Array next.
    # ===================================================================== #
    result = result.split(',').flatten
  end
  return result
end

.rev(use_colours = use_colours? ) ⇒ Object

#

RBT.rev

#


176
177
178
179
180
181
182
183
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 176

def self.rev(
    use_colours = use_colours?
  )
  if use_colours
    return COLOURS.rev
  end
  return ''
end

.royalblue(i = '') ⇒ Object

#

RBT.royalblue

#


130
131
132
133
# File 'lib/rbt/colours/html_colours.rb', line 130

def self.royalblue(i = '')
  return COLOURS::HtmlColoursMethods.royalblue(i) if use_colours?
  return i
end

.run_appObject

#

RBT.run_app

#


12
13
14
# File 'lib/rbt/sinatra/toplevel_methods.rb', line 12

def self.run_app
  RBT::Sinatra.run!
end

.run_make_then_make_installObject

#

RBT.run_make_then_make_install

This method essentially runs “make”, followed by “make install”.

It was created not only in order to chain these two commands, but to also check for a directory called “BUILD_DIRECTORY” in the current working directory. If such a directory exists then we will cd into that directory before running “make” and “make install”.

#


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rbt/toplevel_methods/run_make_then_make_install.rb', line 25

def self.run_make_then_make_install
  _ = 'BUILD_DIRECTORY/'
  e; e; e
  e "#{Colours.rev}Starting with 'make', then 'make install'."
  e; e
  if File.directory? _
    e
    e "#{rev}Changing directory into #{sdir(_)} #{rev}now."
    e
    cd _
  end
  use_this_command = 'make'
  # ======================================================================= #
  # Normally we have to run 'make', but meson-systems require
  # ninja - thus we check for that next.
  # ======================================================================= #
  if File.exist? 'Makefile'
    # ===================================================================== #
    # In this case we will use the above 'make' command.
    # ===================================================================== #
  elsif File.exist? 'build.ninja'
    use_this_command = 'ninja'
  end
  esystem "#{use_this_command}"
  esystem "#{use_this_command} install"
  e; e; e
end

.run_makepkg_command(i = :from_the_current_working_directory, optional_program_version = nil, use_this_architecture = RBT.determine_host_architecture) ⇒ Object

#

RBT.run_makepkg_command

This method will invoke the slackware “makepkg” command, in order to create a slackware package.

By default, this method will work from the current working directory, so it is recommended to have already extracted the target archive in question.

#


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/rbt/toplevel_methods/run_makepkg_command.rb', line 22

def self.run_makepkg_command(
    i                        = :from_the_current_working_directory,
    optional_program_version = nil,
    use_this_architecture    = RBT.determine_host_architecture # <= "x86_64"
  )
  # ======================================================================= #
  # Determine which makepkg command variant to use next.
  # ======================================================================= #
  use_this_makepkg_command = 'makepkg --chown n --linkadd y'
  case i
  # ======================================================================= #
  # === :from_the_current_working_directory
  # ======================================================================= #
  when :from_the_current_working_directory,
       :default # This is the default.
    _ = File.basename(return_pwd)
    name_of_the_package, the_program_version = _.split('-')
  else # else depend on TWO input arguments: (a) name and (b) version.
    name_of_the_package = i
    the_program_version = optional_program_version
  end
  # ======================================================================= #
  # === Host Architecture
  #
  # The host architecture is currently "x86_64". This may change at
  # a later time, though; at the least it may be more flexible.
  # ======================================================================= #
  full_name_of_the_package = "#{name_of_the_package}-"\
                             "#{the_program_version}-"\
                             "#{use_this_architecture}"\
                             "-1.tgz"
  _ = use_this_makepkg_command+' ../'+full_name_of_the_package
  esystem(_)
  path_to_the_package = File.expand_path("../#{full_name_of_the_package}")
  return path_to_the_package
end

.run_meson_configure_step(use_this_prefix = '/usr/', use_this_build_directory = 'BUILD_DIRECTORY', &block) ⇒ Object

#

RBT.run_meson_configure_step

This will simply run “meson”.

#


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/rbt/toplevel_methods/meson.rb', line 26

def self.run_meson_configure_step(
    use_this_prefix          = '/usr/',
    use_this_build_directory = 'BUILD_DIRECTORY',
    &block
  )
  configure_options = ''.dup
  is_padded         = false
  use_colours       = false
  meson_command     = 'meson'.dup
  # ======================================================================== #
  # === Handle Hashes next
  # ======================================================================== #
  if use_this_prefix.is_a? Hash
    _ = use_this_prefix
    # ===================================================================== #
    # === :configure_options
    # ===================================================================== #
    if _.has_key?(:configure_options) and _[:configure_options] and
      !_[:configure_options].empty?
      configure_options << " #{_.delete(:configure_options)}"
    end
    # ===================================================================== #
    # === :use_this_as_build_directory
    # ===================================================================== #
    if _.has_key? :use_this_as_build_directory
      use_this_build_directory = _.delete(:use_this_as_build_directory)
    end
    # ===================================================================== #
    # The next entry point must come last.
    # ===================================================================== #
    if _.has_key? :prefix_to_use
      use_this_prefix = _.delete(:prefix_to_use).to_s
    end
  end
  # ======================================================================== #
  # Always use the absolute path here:
  # ======================================================================== #
  if use_this_build_directory
    unless use_this_build_directory.empty?
      use_this_build_directory = File.absolute_path(use_this_build_directory)
      unless use_this_build_directory.end_with?('/')
        use_this_build_directory = use_this_build_directory.dup
        use_this_build_directory << '/'
      end
    end
  end
  # ======================================================================== #
  # === Handle blocks next
  # ======================================================================== #
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :colourized_and_padded
    # ===================================================================== #
    when :colourized_and_padded
      is_padded = true
      use_colours = true
    end
  end
  meson_command.prepend('  ') if is_padded
  meson_command << " --prefix=#{use_this_prefix.to_s}"
  meson_command << " --libdir=#{use_this_prefix.to_s}lib/" # This will target the lib/ subdirectory.
  meson_command << configure_options
  meson_command << " #{use_this_build_directory}"
  if use_colours
    require 'rbt/colours/html_colours.rb'
    if meson_command and meson_command.include?('--prefix=') and use_colours
      meson_command = meson_command.dup
      # =================================================================== #
      # === Colourize the prefix, in cornflowerblue().
      # =================================================================== #
      colourized_command = meson_command.sub(/(--prefix=)(\/.+?)\s/, # See: https://rubular.com/r/Df8OzLqXGd
        olivedrab('\1')+
        cornflowerblue('\2 ')+
        ::Colours.remove_escape_sequences(teal(''))
      )
      colourized_command.sub!(/meson/, mediumaquamarine('meson'))
    end
  end
  e if is_padded
  if use_colours
    e colourized_command
    e if is_padded
    system meson_command
  else
    esystem meson_command
    e if is_padded
  end
  return meson_command # And always return it here as well.
end

.sanitize_cookbook(i = ARGV, options_hash = {}, &block) ⇒ Object

#

RBT.sanitize_cookbook

#


6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
# File 'lib/rbt/actions/individual_actions/cookbooks/sanitize_cookbook/sanitize_cookbook.rb', line 6379

def self.sanitize_cookbook(
    i            = ARGV,
    options_hash = {},
    &block
  )
  sanitize_cookbook = RBT::Action::Cookbooks::SanitizeCookbook.new(
    i,
    :do_not_run_yet,
    &block
  )
  sanitize_cookbook.menu(options_hash) unless options_hash.empty?
  sanitize_cookbook.run
  return sanitize_cookbook
end

.sanitize_this_licence(i) ⇒ Object

#

RBT.sanitize_this_licence

This method will take the given input and output a valid licence if possible. So, for instance, the input “gpl3” should be turned into “GPLv3”. The idea here is to have one unified method that will be able to consistently enforce valid licence names.

#


177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 177

def self.sanitize_this_licence(i)
  i = i.dup # Work on a copy, just in case.
  case i.downcase
  # ======================================================================= #
  # === GNU LGPL
  # ======================================================================= #
  when 'gnu lgpl' # This one should ideally be changed by the user.
    i = 'LGPL variant (should be specified clearly)'
  # ======================================================================= #
  # === LGPL
  #
  # Should have a version.
  # ======================================================================= #
  when 'lgpl' # This one should ideally be changed by the user.
    i = 'LGPL variant (should be specified clearly)' 
  # ======================================================================= #
  # === gpl3
  # ======================================================================= #
  when 'gpl3',
       'gplv3'
    i = 'GPLv3'
  # ======================================================================= #
  # === gpl2
  # ======================================================================= #
  when 'gpl2',
       'gplv2'
    i = 'GPLv2'
  # ======================================================================= #
  # === GNU GPLv2
  # ======================================================================= #
  when 'gnu gplv2'
    i = 'GPLv2 (should be GPLv2 only, not GNU GPLv2)'
  when ''
    # pass through
  # else
  #  i = 'Unknown licence'
  end
  return i
end

.sanitize_url1_entry(i, hash = {}) ⇒ Object

#

RBT.sanitize_url1_entry

This method will sanitize a url1 entry from a cookbook .yml file.

Note that this code is currently (May 2020) a bit duplicated, because another file also handles this. In the long run we should unify both code parts, but for the time being I had to move on and just finish the variant here.

#


848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 848

def self.sanitize_url1_entry(
    i, hash = {}
  )
  # ======================================================================= #
  # We must allow for symbols or strings as key.
  # ======================================================================= #
  use_this_as_the_key_for_url1 = :url1
  if hash and hash.has_key?('url1') # Check whether we have a String here, nonetheless.
    use_this_as_the_key_for_url1 = 'url1'
  end
  url = hash[use_this_as_the_key_for_url1]
  i = i.first if i.is_a? Array
  case i # case tag
  # ======================================================================= #
  # === USE_URL_DOWNCASE
  #
  # Use the URL as program name but downcase it.
  # ======================================================================= #
  when 'USE_URL_DOWNCASE',
       'USE_DOWNCASED'
    i = remove_archive_from_the_end(File.basename(url.downcase))
  # ======================================================================= #
  # === FIRST_UNDERSCORE_IS_HYPHEN
  # ======================================================================= #
  when 'FIRST_UNDERSCORE_IS_HYPHEN',
       'URL_REPLACE_UNDERSCORE'
    splitted = url.split('/')
    splitted[-1] = splitted[-1].tr('_','-') # Replace the '_' with a '-'.
    i = File.basename(splitted.join('/'))
  # ======================================================================= #
  # === PROGRAM_NAME_AND_PROGRAM_VERSION_WITHOUT_ALPHABET
  # ======================================================================= #
  when 'PROGRAM_NAME_AND_PROGRAM_VERSION_WITHOUT_ALPHABET'
    i = remove_archive_from_the_end(
      File.basename(url).dup
    ) # Example: brotli-v1.0.7.tar.gz
    splitted = i.split('-')
    splitted[1].gsub!(/[A-Za-z]/,'')
    i = splitted.join('-')
  # ======================================================================= #
  # === USE_URL_REPLACE_UNDERSCORE
  #
  # This variant is for entries such as "LMDB_0.9.23.tar.gz".
  # ======================================================================= #
  when 'USE_URL_REPLACE_UNDERSCORE',
       'REPLACE_UNDERSCORES',
       'URL_CONVERT_UNDERSCORE'
    i = remove_archive_from_the_end(
          File.basename(url).dup
        ).
        tr('_','-')
  # ======================================================================= #
  # === FIRST_UNDERSCORE_AS_HYPHEN_AND_OTHER_UNDERSCORES_AS_DOTS
  # ======================================================================= #
  when 'FIRST_UNDERSCORE_AS_HYPHEN_AND_OTHER_UNDERSCORES_AS_DOTS'
    i = remove_archive_from_the_end(
          File.basename(url).dup
        ). # Example: boost_1_72_0.tar.bz2
        sub(/_/,'-').
        tr('_','.')
  # ======================================================================= #
  # === USE_URL_LAST_HYPHEN_IS_DOT
  # ======================================================================= #
  when 'USE_URL_LAST_HYPHEN_IS_DOT'
    i = remove_archive_from_the_end(File.basename(url).dup) # Example: ImageMagick-7.0.9-25
    i = i.reverse.sub('-','.').reverse
  # ======================================================================= #
  # === FIRST_DOT_AS_HYPHEN
  # ======================================================================= #
  when 'FIRST_DOT_AS_HYPHEN'
    i = remove_archive_from_the_end(File.basename(url).dup).sub(/\./,'-')
  # ======================================================================= #
  # === USE_URL_MIDDLE_HYPHENS
  # ======================================================================= #
  when 'USE_URL_MIDDLE_HYPHENS'
    i = remove_archive_from_the_end(File.basename(url).dup)
    i.sub!(/_/,'-')
  else
    if i.include? '-PROGRAM_VERSION'
      i.sub!(/PROGRAM_VERSION/,
      remove_archive_from_the_end( File.basename(url).dup).
          delete('v')
      )
    end
  end
  return i
end

.save_the_available_programs_versionsObject

#

RBT.save_the_available_programs_versions

#


194
195
196
# File 'lib/rbt/utility_scripts/save_the_available_programs_versions.rb', line 194

def self.save_the_available_programs_versions
  RBT::SaveTheAvailableProgramsVersions.new
end

.scan_for_blfs_programs(i = ARGV, &block) ⇒ Object

#

RBT.scan_for_blfs_programs

#


227
228
229
230
231
232
# File 'lib/rbt/actions/individual_actions/cookbooks/scan_for_blfs_programs/scan_for_blfs_programs.rb', line 227

def self.scan_for_blfs_programs(
    i = ARGV,
    &block
  )
  return RBT::Action::Cookbooks::ScanForBlfsPrograms.new(i, &block)
end

.scan_for_missing_last_update_entriesObject

#

RBT.scan_for_missing_last_update_entries

#


283
284
285
# File 'lib/rbt/checks_and_validations/scan_for_missing_last_update_entries.rb', line 283

def self.scan_for_missing_last_update_entries
  RBT::Cookbooks::ScanForMissingLastUpdateEntries.new
end

.scan_source_archiveObject

#

RBT.scan_source_archive

#


234
235
236
# File 'lib/rbt/cookbooks/scan_source_archive/scan_source_archive.rb', line 234

def self.scan_source_archive
  RBT::Cookbooks::ScanSourceArchive.new
end

.sdir(i = '') ⇒ Object

#

RBT.sdir

#


104
105
106
107
108
109
110
111
112
113
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 104

def self.sdir(i = '')
  if use_colours?
    if HASH_DESIGNATED_COLOURS.empty?
      return COLOURS.sdir(i)
    else
      return COLOURS::HtmlColoursMethods.send(user_designated_colour(:sdir), i)
    end
  end
  return i
end

.search_for_tags(i) ⇒ Object

#

RBT.search_for_tags

Use a module-method to search for tags. This is simpler to use from the outside, that is, in external projects.

Usage example:

result = RBT.search_for_tags :xorg
#


719
720
721
# File 'lib/rbt/cookbooks/search_for_tags/search_for_tags.rb', line 719

def self.search_for_tags(i)
  RBT::Cookbooks::SearchForTags.new(i)
end

.sed_wrapper(i = ARGV, options_hash = {}, &block) ⇒ Object

#

RBT.sed_wrapper

#


233
234
235
236
237
238
239
# File 'lib/rbt/actions/individual_actions/sed_wrapper/sed_wrapper.rb', line 233

def self.sed_wrapper(
    i            = ARGV,
    options_hash = {},
    &block
  )
  RBT::Action::SedWrapper.new(i, :do_not_run_yet, &block)
end

.set_array_these_ruby_gems_were_updated(i) ⇒ Object

#

RBT.set_array_these_ruby_gems_were_updated

Setter method to modify the top-level instance variable called

#


30
31
32
# File 'lib/rbt/toplevel_methods/rubygems.rb', line 30

def self.set_array_these_ruby_gems_were_updated(i)
  @array_these_ruby_gems_were_updated = i
end

.set_commandline_options(i) ⇒ Object

#

RBT.set_commandline_options

#


31
32
33
# File 'lib/rbt/commandline/commandline.rb', line 31

def self.set_commandline_options(i)
  @commandline_options = [i].flatten.compact
end

.set_compile_these_programs(i, &block) ⇒ Object

#

RBT.set_compile_these_programs

Do note that whenever this method is called, the old value for

#


42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/rbt/toplevel_methods/compile_these_programs.rb', line 42

def self.set_compile_these_programs(
    i,
    &block
  )
  if i.is_a? Hash
    # ===================================================================== #
    # === :compile_these_programs
    # ===================================================================== #
    if i.has_key? :compile_these_programs
      i = i.delete(:compile_these_programs)
    end
  end
  # ======================================================================= #
  # We need an Array here:
  # ======================================================================= #
  i = [i].flatten.compact
  i.map! {|entry| # Will always be an Array.
    entry = entry.dup if entry.frozen?
    if block_given?
      yielded = yield
      case yielded
      # =================================================================== #
      # === :remove_underscore
      # =================================================================== #
      when :remove_underscore
        entry.delete!('_')
      end
    end
    if entry.is_a? String
      entry = action(:filter_for_valid_program_names,
        [entry, @dataset_containing_the_abbreviations]
      )
    end
    # ===================================================================== #
    # The next line will remove '-' and '_' characters from the given
    # input. This, however had, may NOT be done when there is a
    # locally existing file with that name. On 23.11.2019 this was
    # disabled, because some binaries, such as "wx-config", may
    # include a '-' character.
    # ===================================================================== #
    entry # And return it here too.
  }.compact
  @compile_these_programs = i
end

.set_compile_this_as_first_program(i) ⇒ Object

#

RBT.set_compile_this_as_first_program

#


92
93
94
# File 'lib/rbt/toplevel_methods/compile_these_programs.rb', line 92

def self.set_compile_this_as_first_program(i)
  @compile_these_programs[0] = i
end

.set_configuration(i = RBT::Configuration::SimpleConfigurationLoader.new) ⇒ Object

#

RBT.set_configuration

This method will automatically invoke class RBT::Configuration::SimpleConfigurationLoader.

It has to be manually called to some meaningful value in other code parts.

#


49
50
51
52
53
54
55
56
# File 'lib/rbt/configuration/configuration_instance_variable.rb', line 49

def self.set_configuration(
    i = RBT::Configuration::SimpleConfigurationLoader.new
  )
  if i.is_a? String
    i = RBT::Configuration::SimpleConfigurationLoader.new(i)
  end
  @configuration = i
end

.set_configuration_directory(i) ⇒ Object

#

RBT.set_configuration_directory

Setter-method to set the configuration directory used by the RBT project.

#


30
31
32
# File 'lib/rbt/constants/configuration_directory.rb', line 30

def self.set_configuration_directory(i)
  @configuration_directory = i
end

.set_cookbook_directory(i) ⇒ Object

#

RBT.set_cookbook_directory

This setter-method can be used to determine where the individual cookbooks can be found normally.

#


52
53
54
55
56
57
58
59
60
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 52

def self.set_cookbook_directory(i)
  if i # ← Assignment is only done if the user supplies a non-nil argument.
    unless i.end_with? '/'
      i = i.dup if i.frozen?
      i << '/'
    end
    @cookbook_directory = i
  end
end

.set_depot_directory(i = '/Depot/') ⇒ Object

#

RBT.set_depot_directory

#


1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1160

def self.set_depot_directory(
    i = '/Depot/'
  )
  i = i.dup if i.frozen?
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/Depot/' if i.include? '$' # <- See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # <- Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @depot_directory = i
end

.set_error_message(i = nil) ⇒ Object

#

RBT.set_error_message

Set to a new/different error message.

#


44
45
46
47
48
# File 'lib/rbt/toplevel_methods/error_message.rb', line 44

def self.set_error_message(
    i = nil
  )
  @error_message = [i].flatten.compact
end

.set_log_directory(i = "#{RBT.temp_directory}rbt/") ⇒ Object

#

RBT.set_log_directory

This defaults to “/Depot/Temp/rbt/” on my system.

#


890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 890

def self.set_log_directory(
    i = "#{RBT.temp_directory}rbt/"
  )
  i = i.dup if i.frozen?
  i = convert_global_env(i) if i.include? '$'
  i << '/' unless i.end_with? '/'
  # ======================================================================= #
  # Next, we must ensure that the required directories exist.
  # ======================================================================= #
  i = i.dup if i.frozen? # <- Need to do so again, e. g. in a .cgi environment context.
  # ======================================================================= #
  # In the past we did ensure that the required directories exist,
  # whenever RBT.set_log_directory() is called. But this does not
  # make that much sense, and can lead to other problems, so it
  # was disabled here at 24.01.2019. Do note that the functionality
  # of ensuring that the required directories exist will still be
  # handled by RBT, but in other code parts instead.
  # ======================================================================= #
  # require 'rbt/toplevel_methods/ensure_that_the_required_directories_exist.rb'
  # ^^^ this used to be on top
  # ======================================================================= #
  # ensure_that_the_required_directories_exist(
  #   i
  # )
  @log_directory = i
end

.set_packages_directory(i = '/Depot/Packages/') ⇒ Object

#

RBT.set_packages_directory

#


992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 992

def self.set_packages_directory(
    i = '/Depot/Packages/'
  )
  require 'rbt/toplevel_methods/convert_global_env.rb'
  i = i.dup if i.frozen?
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/Depot/Packages/' if i.include? '$' # <- See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # <- Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @packages_directory = i
end

.set_pkgconfig_directory(i = '/usr/lib/pkgconfig/') ⇒ Object

#

RBT.set_pkgconfig_directory

#


1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1235

def self.set_pkgconfig_directory(
    i = '/usr/lib/pkgconfig/'
  )
  i = i.dup if i.frozen?
  require 'rbt/toplevel_methods/convert_global_env.rb'
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/usr/lib/pkgconfig/' if i.include? '$' # ← See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # ← Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @pkgconfig_directory = i
end

.set_prefix(i = '/usr/') ⇒ Object

#

RBT.set_prefix

Keep track of the last prefix used via this toplevel method.

#


433
434
435
# File 'lib/rbt/actions/individual_actions/prefix/prefix.rb', line 433

def self.set_prefix(i = '/usr/')
  RBT::Action::Prefix.new(i)
end

.set_programs_directory(i = :use_value_from_the_configuration_file) ⇒ Object

#

RBT.set_programs_directory

#


78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 78

def self.set_programs_directory(
    i = :use_value_from_the_configuration_file # This is hardcoded default, but can be changed by the user through later calls.
  )
  case i
  # ======================================================================= #
  # === :use_value_from_the_configuration_file
  # ======================================================================= #
  when :use_value_from_the_configuration_file
    use_this_file = RBT.file_programs_directory
    if File.exist? use_this_file
      i = YAML.load_file(use_this_file)
    else # else assume e. g. windows.
      i = '/home/Programs/'
    end
  end
  i = i.dup if i.frozen?
  # ======================================================================= #
  # Replace all $ with proper env-variables if they are included.
  # ======================================================================= #
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case we will use a hardcoded entry instead. It is
  # up to the user to resolve this problem, as it should not really
  # happen.
  # ======================================================================= #
  i = '/home/Programs/' if i.include? '$' # ← See above for the explanation.
  i = i.dup if i.frozen? # ← Need to do so again, e. g. in a .cgi environment context.
  i << '/' unless i.end_with? '/'
  i.squeeze!('/')
  @programs_directory = i
end

.set_register_program_files_into_yaml_database(i) ⇒ Object

#

RBT.set_register_program_files_into_yaml_database

#


51
52
53
# File 'lib/rbt/utility_scripts/register_program_files_into_yaml_database.rb', line 51

def self.set_register_program_files_into_yaml_database(i)
  @register_program_files_into_yaml_database = i
end

.set_show_names(i = true) ⇒ Object

#

RBT.set_show_names

#


31
32
33
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 31

def self.set_show_names(i = true)
  @show_names = i
end

.set_source_base_directory(i = :default_but_consider_environment_variables) ⇒ Object

#

RBT.set_source_base_directory

Note that the environment variable called RBT_SOURCE_DIRECTORY can be used to use another default value.

#


722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 722

def self.set_source_base_directory(
    i = :default_but_consider_environment_variables # <- Preferred default. 
  )
  case i
  # ======================================================================= #
  # === :default_but_consider_environment_variables
  # ======================================================================= #
  when :default_but_consider_environment_variables
    # ===================================================================== #
    # Handle the environment-variable RBT_SOURCE_DIRECTORY first, as
    # it has a higher priority in this case.
    # ===================================================================== #
    if ENV.has_key? 'RBT_SOURCE_DIRECTORY'
      i = ENV['RBT_SOURCE_DIRECTORY'].to_s.dup
    else
      # =================================================================== #
      # else the user does not have this ENV-variable, so we use the
      # "regular" default.
      # =================================================================== #
      i = @source_base_directory
    end
  # ======================================================================= #
  # This is for the "regular" default. This one will always assign.
  # ======================================================================= #
  when :default, nil, ''
    i = @source_base_directory
  end
  i = i.dup if i.frozen?
  i = RBT.convert_global_env(i) if i.include? '$'
  i = @source_base_directory if i.include? '$' # <- Overrule missing environment variables.
  i << '/' unless i.end_with? '/'
  @source_base_directory = i
end

.set_sysbin_directory(i = '/System/Index/bin/') ⇒ Object

#

RBT.set_sysbin_directory

#


645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 645

def self.set_sysbin_directory(
    i = '/System/Index/bin/'
  )
  require 'rbt/toplevel_methods/convert_global_env.rb'
  i = i.dup if i.frozen?
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/System/Index/bin/' if i.include? '$' # <- See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # <- Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @sysbin_directory = i
end

.set_sysetc_directory(i = '/System/Index/etc/') ⇒ Object

#

RBT.set_sysetc_directory

#


826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 826

def self.set_sysetc_directory(
    i = '/System/Index/etc/'
  )
  require 'rbt/toplevel_methods/convert_global_env.rb'
  i = i.dup if i.frozen?
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/System/Index/etc/' if i.include? '$' # <- See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # <- Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @sysetc_directory = i
end

.set_sysinclude_directory(i = '/System/Index/include/') ⇒ Object

#

RBT.set_sysinclude_directory

#


1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1197

def self.set_sysinclude_directory(
    i = '/System/Index/include/'
  )
  require 'rbt/toplevel_methods/convert_global_env.rb'
  i = i.dup if i.frozen?
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/System/Index/include/' if i.include? '$' # <- See above for the explanation.
  i = i.dup if i.frozen? # <- Need to do so again, e. g. in a .cgi environment context.
  i << '/' unless i.end_with? '/'
  i.squeeze!('/')
  @sysinclude_directory = i
end

.set_syslib_directory(i = :infer_which_path_to_use_for_syslib) ⇒ Object

#

RBT.set_syslib_directory

#


1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1031

def self.set_syslib_directory(
    i = :infer_which_path_to_use_for_syslib
  )
  require 'rbt/toplevel_methods/convert_global_env.rb'
  case i
  # ======================================================================= #
  # === :infer_which_path_to_use_for_syslib
  #
  # This here will automatically determine the target for the
  # syslib-directory.
  # ======================================================================= #
  when :infer_which_path_to_use_for_syslib
    if is_this_a_real_gobolinux_system?
      i = '/System/Index/lib/' # This is the path on a GoboLinux system.
    else
      i = '/usr/lib/'
    end
  end
  i = i.dup if i.frozen?
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/System/Index/lib/' if i.include? '$' # ← See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # ← Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @syslib_directory = i
end

.set_system_directory(i = '/System/') ⇒ Object

#

RBT.set_system_directory

#


616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 616

def self.set_system_directory(
    i = '/System/'
  )
  i = i.dup if i.frozen?
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/System/' if i.include? '$' # ← See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # ← Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @system_directory = i
end

.set_system_settings_directory(i = '/System/Settings/') ⇒ Object

#

RBT.set_system_settings_directory

#


1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1122

def self.set_system_settings_directory(
    i = '/System/Settings/'
  )
  i = i.dup if i.frozen?
  require 'rbt/toplevel_methods/convert_global_env.rb'
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/System/Settings/' if i.include? '$' # <- See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # <- Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @system_settings_directory = i
end

.set_system_share_directory(i = '/System/Share/') ⇒ Object

#

RBT.set_system_share_directory

#


1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1083

def self.set_system_share_directory(
    i = '/System/Share/'
  )
  i = i.dup if i.frozen?
  require 'rbt/toplevel_methods/convert_global_env.rb'
  i = convert_global_env(i) if i.include? '$'
  # ======================================================================= #
  # If there is still at the least one '$' entry then this variable does
  # not exist. In this case, use a hardcoded entry instead.
  # ======================================================================= #
  i = '/System/Share/' if i.include? '$' # <- See above for the explanation.
  i << '/' unless i.end_with? '/'
  i = i.dup if i.frozen? # <- Need to do so again, e. g. in a .cgi environment context.
  i.squeeze!('/')
  @system_share_directory = i
end

.set_temp_directory(i = '/tmp/') ⇒ Object

#

RBT.set_temp_directory

#


546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 546

def self.set_temp_directory(
    i = '/tmp/'
  )
  i = convert_global_env(i) if i.include? '$'
  if i.include? '$'
    i = '/tmp/' # Use a default value in this case.
  end
  unless i.end_with? '/' # We must ensure that the last charcter is always a '/'.
    i = i.dup if i.frozen?
    i << '/' 
  end
  @temp_directory = i
end

.set_use_this_editor(i = :vim) ⇒ Object

#

RBT.set_use_this_editor

Setter-method for the default editor to be used.

#


31
32
33
# File 'lib/rbt/toplevel_methods/editor.rb', line 31

def self.set_use_this_editor(i = :vim)
  @use_this_editor = i.to_s
end

.set_xorg_buffer(i, notify_if_xsel_is_not_installed = true) ⇒ Object

#

RBT.set_xorg_buffer

This method depends on the external gem called xorg_buffer.

#


825
826
827
828
829
830
831
832
833
834
835
836
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 825

def self.set_xorg_buffer(i, notify_if_xsel_is_not_installed = true)
  begin
    require 'xorg_buffer' unless Object.const_defined? :XorgBuffer
  rescue LoadError; end
  if Object.const_defined? :XorgBuffer
    if is_xsel_available?
      XorgBuffer.set_xorg_buffer(i) { :be_quiet }
    elsif notify_if_xsel_is_not_installed
      e 'xsel is not installed - the xorg-buffer can not be used.'
    end
  end
end

.set_yaml_engine(i) ⇒ Object

#

RBT.set_yaml_engine

This method will assign (and thus keep track of) the yaml engine that the RBT project will use. Since some time this is standard psych; in the past it used to be syck.

#


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/rbt/requires/require_yaml.rb', line 24

def self.set_yaml_engine(i)
  case i # case tag
  # ======================================================================= #
  # === :psych
  # ======================================================================= #
  when :psych,
       :default # ← psych is the default since some time.
    # ===================================================================== #
    # pass through because psych is the default yaml engine that will
    # work without modification.
    # ===================================================================== #
  when :syck
    begin
      require 'syck'
    rescue LoadError; end
    begin
      YAML::ENGINE.yamler = 'syck'
    rescue NameError; end
  end
  @yaml_engine = i
end

.sfancy(i = '', use_colours = use_colours? ) ⇒ Object

#

RBT.sfancy

#


146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 146

def self.sfancy(
    i = '', use_colours = use_colours?
  )
  if use_colours
    if HASH_DESIGNATED_COLOURS.empty?
      return COLOURS.sfancy(i)
    else
      return COLOURS::HtmlColoursMethods.send(user_designated_colour(:sfancy), i)
    end
  end
  return i
end

.sfile(i = '') ⇒ Object

#

RBT.sfile

#


118
119
120
121
122
123
124
125
126
127
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 118

def self.sfile(i = '')
  if use_colours?
    if HASH_DESIGNATED_COLOURS.empty?
      return COLOURS.sfile(i)
    else
      return COLOURS::HtmlColoursMethods.send(user_designated_colour(:sfile), i)
    end
  end
  return i
end

.shasum(i) ⇒ Object

#

RBT.shasum

#


62
63
64
65
66
67
68
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 62

def self.shasum(i)
  result = `sha256sum #{i}`.strip
  if result.include?(' ')
    result = result.split(' ').first.to_s
  end
  return result
end

.show_all_about(i = ARGV) ⇒ Object

#

RBT.show_all_about

#


390
391
392
393
394
# File 'lib/rbt/actions/individual_actions/information/show_all_about.rb', line 390

def self.show_all_about(
    i = ARGV
  )
  RBT::Action::ShowAllAbout.new(i)
end

.show_all_statisticsObject

#

RBT.show_all_statistics

#


75
76
77
# File 'lib/rbt/actions/individual_actions/statistics/show_all_statistics.rb', line 75

def self.show_all_statistics
  RBT::Action::Statistics::ShowAllStatistics.new
end

.show_available_tags(use_this_path = :default, show_namespace = true) ⇒ Object

#

RBT.show_available_tags

#


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rbt/toplevel_methods/show_available_tags.rb', line 19

def self.show_available_tags(
    use_this_path  = :default,
    show_namespace = true
  )
  require 'rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb'
  require 'rbt/colours/html_colours.rb'
  case use_this_path
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    use_this_path = RBT.file_allowed_tags # Refer to the file allowed_tags.yml.
  end
  case show_namespace
  # ======================================================================= #
  # === :do_not_report_the_namespace
  # ======================================================================= #
  when :do_not_report_the_namespace,
       :be_quiet
    show_namespace = false
  end
  opn if show_namespace
  e 'The following tags are registered (and thus available - '\
    'sorted alphabetically):'
  e
  if File.exist? use_this_path
    array = YAML.load_file(use_this_path)
    array.each_with_index {|entry, index| index += 1
      e "  #{steelblue(index.to_s.rjust(3))}#{steelblue(')')} "\
        "#{olivedrab(entry)}"
    }
  end
  e
end

.show_available_utility_scriptsObject

#

RBT.show_available_utility_scripts

Simply show all available utility scripts.

Invocation example from the commandline:

cookbooks --show-available-scripts
#


23
24
25
26
27
28
29
30
31
32
# File 'lib/rbt/toplevel_methods/show_available_utility_scripts.rb', line 23

def self.show_available_utility_scripts
  files = Dir["#{utility_scripts?}*.rb"].sort.map {|file|
    File.basename(file)
  }
  files = files - ['utility_scripts.rb']
  e; files.each_with_index {|file, index|
    index += 1
    e "#{sfancy(index.to_s.rjust(4))}#{rev}) #{simp(file)}"
  }; e
end

.show_compile_chain(i = ARGV, options_hash = {}, &block) ⇒ Object

#

RBT.show_compile_chain

Usage example:

RBT.show_compile_chain(:kde5_plasma)
#


176
177
178
179
180
181
182
183
184
185
186
# File 'lib/rbt/actions/individual_actions/show_compile_chain/show_compile_chain.rb', line 176

def self.show_compile_chain(
    i            = ARGV,
    options_hash = {},
    &block
  )
  result = []
  [i].flatten.compact.each {|this_program|
    result << RBT::Action::ShowCompileChain.new(this_program, &block)
  }
  return result.flatten # Return the Array here.
end

.show_compile_time_statisticsObject

#

RBT.show_compile_time_statistics

#


108
109
110
# File 'lib/rbt/actions/individual_actions/statistics/show_compile_time_statistics.rb', line 108

def self.show_compile_time_statistics
  RBT::Action::Statistics::ShowCompileTimeStatistics.new
end

.show_configuration_options(i = ARGV, &block) ⇒ Object

#

RBT.show_configuration_options

This variant must report the result onto the commandline.

#


808
809
810
811
812
813
# File 'lib/rbt/actions/individual_actions/cookbooks/show_configuration_options/show_configuration_options.rb', line 808

def self.show_configuration_options(
    i = ARGV,
    &block
  )
  RBT::Action::Cookbooks::ShowConfigurationOptions.new(i, &block)
end

.show_dependencies_of(i = ARGV) ⇒ Object

#

RBT.show_dependencies_of

#


166
167
168
# File 'lib/rbt/utility_scripts/show_dependencies_of.rb', line 166

def self.show_dependencies_of(i = ARGV)
  RBT::Cookbooks::ShowDependenciesOf.new(i)
end

.show_dependencies_of_this_library(i = ARGV) ⇒ Object

#

RBT.show_dependencies_of_this_library

#


103
104
105
# File 'lib/rbt/utility_scripts/show_dependencies_of_this_library.rb', line 103

def self.show_dependencies_of_this_library(i = ARGV)
  RBT::ShowDependenciesOfThisLibrary.new(i)
end

.show_how_many_files_are_trackedObject

#

RBT.show_how_many_files_are_tracked

#


226
227
228
# File 'lib/rbt/actions/individual_actions/statistics/show_how_many_files_are_tracked.rb', line 226

def self.show_how_many_files_are_tracked
  RBT::Action::Statistics::ShowHowManyFilesAreTracked.new { :do_not_use_opn }
end

.show_last_configure_option(_ = RBT.store_the_last_configuration_options_in_this_file) ⇒ Object

#

RBT.show_last_configure_option

#


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rbt/toplevel_methods/show_last_configure_option.rb', line 15

def self.show_last_configure_option(
    _ = RBT.store_the_last_configuration_options_in_this_file
  )
  if File.exist? _
    # ===================================================================== #
    # The next two lines are mostly for debug-related output.
    #   require 'rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb'
    #   e 'Obtaining the information from the file `'+sfile(_)+'`.'
    # ===================================================================== #
    e File.read(_)
  else
    e "No configure options have been stored yet "\
      "(File checked: #{_})."
  end
end

.show_last_updated(i = ARGV) ⇒ Object

#

RBT.show_last_updated

#


408
409
410
# File 'lib/rbt/cookbooks/show_last_updated.rb', line 408

def self.show_last_updated(i = ARGV)
  RBT::Cookbooks::ShowLastUpdated.new(ARGV)
end

.show_manual_steps(of = ARGV, &block) ⇒ Object

#

RBT.show_manual_steps

Usage example:

RBT.show_manual_steps(:kde5_plasma)
#


102
103
104
105
106
# File 'lib/rbt/actions/individual_actions/show_manual_steps/show_manual_steps.rb', line 102

def self.show_manual_steps(of = ARGV, &block)
  [of].flatten.compact.each {|this_program|
    RBT::ShowManualSteps.new(this_program, &block)
  }
end

.show_names?Boolean

#

RBT.show_names?

#

Returns:

  • (Boolean)


38
39
40
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 38

def self.show_names?
  @show_names
end

.show_overview_over_available_utility_scriptsObject

#

RBT.show_overview_over_available_utility_scripts

This method will show all available utility scripts and provide an overview over them.

To trigger this method, do:

cookbooks OVERVIEW
cookbooks --show-available-utility-scripts
#


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rbt/utility_scripts/show_overview_over_available_utility_scripts.rb', line 24

def self.show_overview_over_available_utility_scripts
  begin
    require 'class_docu_shower'
  rescue LoadError; end
  target = "#{utility_scripts?}*.rb"
  available_files = Dir[target]
  if Object.const_defined? :ClassDocuShower
    available_files.each {|file|
      cliner
      ClassDocuShower[file] # Delegate towards ClassDocuShower here.
    }
  else
    opn(namespace: RBT::NAMESPACE[:namespace])
    e 'The class ClassDocuShower is not available.'
    e
    opn(namespace: RBT::NAMESPACE[:namespace])
    e 'It can be installed via:'
    e
    opn(namespace: RBT::NAMESPACE[:namespace])
    e '  gem install class_docu_shower'
    e
  end
end

.show_registered_binariesObject

#

RBT.show_registered_binaries

#


254
255
256
257
258
# File 'lib/rbt/registered/registered_binaries.rb', line 254

def self.show_registered_binaries
  _ = ::RBT.registered_binaries?
  RegisteredBinaries.opnn; e 'These '+_.size.to_s+' binaries are registered:'
  e _.reject {|entry| entry.to_s.empty? }.join(', ').strip.chop
end

.show_the_classname?Boolean

#

RBT.show_the_classname?

Query method over as to whether we should show the classname.

#

Returns:

  • (Boolean)


156
157
158
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 156

def self.show_the_classname?
  @do_show_the_classname
end

.show_the_gnome_ftp_listing(show_n_results = 50) ⇒ Object

#

RBT.show_the_gnome_ftp_listing

This method will simply show the remote FTP listing of gnome, on the commandline.

The reason for the existance of this method has been to allow the user to quickly scan for new gnome-specific updates.

The URL to gnome may look like this:

https://download.gnome.org/sources/?C=M&O=D
#


116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/rbt/toplevel_methods/ftp.rb', line 116

def self.show_the_gnome_ftp_listing(
    show_n_results = 50 # Determine how many results to show to the user.
  )
  # ======================================================================= #
  # Notify the user which URL is used next:
  # ======================================================================= #
  e "#{rev}Trying to collect data from `#{GNOME_FTP_URL}` next."
  dataset = URI.open(GNOME_FTP_URL).read.split("\n")
  hash_programs = {}
  dataset.each {|line|
    # ===================================================================== #
    # === <td class="indexcolicon"><a href="easytag/"><img src="/icons2/folder.png"
    #
    # See the following URL:
    #
    #   https://rubular.com/r/d9CvpYvkqhRZwU
    #
    # ===================================================================== #
    if line.include? '<td class="link"><a href="'
      use_this_regex =
        /<td class="link"><a href="([a-zA-Z0-9-]+)\//
      name_of_the_program = line.scan(
        use_this_regex
      ).flatten.first
    end
    hash_programs[name_of_the_program]
    # ===================================================================== #
    # === <td class="date">
    #
    # Obtain the last time-modification next.
    #
    # See the following URL:
    #
    #   https://rubular.com/r/qhpkYJS8SUoi6g
    #
    # ===================================================================== #
    if line.include? '<td class="date">'
      last_update = line.scan(
        /<td class="date">(\d{4}-[a-zA-Z]{3,5}-\d{2} \d{2}:\d{2})<\/td>/
      ).flatten.first
      if name_of_the_program
        hash_programs[name_of_the_program] = Time.parse(last_update)
      end
    end
  }
  index = 0
  e
  today_is = ::Time.now # Grab hold of today's date.
  if hash_programs.empty?
    e 'No program was found.'
  else
    hash_programs.each_pair {|key, value| index += 1
      next if index > show_n_results
      padded_index = index.to_s.rjust(4)+') '
      if (value.year  == today_is.year)  and
         (value.month == today_is.month) and
         (value.day   == today_is.day)
        colourized_date = lightgreen(value.to_s)
      else
        colourized_date = forestgreen(value.to_s) 
      end
      e royalblue(padded_index)+
        steelblue(key.ljust(30))+
        ''+
        colourized_date
    }
    e
  end
end

.show_tutorial(try_to_use_colours = true) ⇒ Object

#

RBT.show_tutorial

This will show a tutorial to the user, instructing them how to use the Cookbooks project.

Usage example:

rbt --tutorial
cookbooks --tutorial
#


684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 684

def self.show_tutorial(
    try_to_use_colours = true
  )
  require 'io/console'
  display_this_message = "\n[Press any key to continue; q to exit early]"
  # ========================================================================= #
  # The file for the short tutorial can be seen in 
  # "tutorial/short_tutorial.md".
  # ========================================================================= #
  _ = RBT.file_short_tutorial?
  if File.exist? _
    dataset = File.readlines(_) # Display the file next.
    chunks = dataset.each_slice(20).to_a
    counter = 0
    e rev # And a newline to start with. 
    loop {
      content_that_will_be_displayed = chunks[counter]
      if try_to_use_colours
        content_that_will_be_displayed.map! {|line|
          # ================================================================= #
          # Next colourize anything that is indented with 4 leading spaces.
          # ================================================================= #
          line.gsub(/^(    .+)$/, lightgreen('\1'))
        }
      end
      e content_that_will_be_displayed
      # ===================================================================== #
      # Next, display the "press any key to continue" message.
      # ===================================================================== #
      if try_to_use_colours
        display_this_message = mediumseagreen(display_this_message)
      end
      e display_this_message
      case STDIN.getch
      when 'q'
        exit
      else
        counter += 1
        exit if counter >= chunks.size
      end
    }
  else
    e "#{rev}No file exists at #{sfile(_)}"
  end
end

.show_versions_of_these_programs(i = ARGV) ⇒ Object

#

RBT.show_versions_of_these_programs

#


107
108
109
# File 'lib/rbt/actions/individual_actions/information/show_versions_of_these_programs.rb', line 107

def self.show_versions_of_these_programs(i = ARGV)
  RBT::Action::ShowVersionsOfThesePrograms.new(i)
end

.simp(i = '', use_colours = RBT.use_colours?) ⇒ Object

#

RBT.simp

#


66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 66

def self.simp(
    i           = '',
    use_colours = RBT.use_colours?
  )
  if use_colours?
    if HASH_DESIGNATED_COLOURS.empty?
      return COLOURS.simp(i)
    else
      return COLOURS::HtmlColoursMethods.send(user_designated_colour(:simp), i)
    end
  end
  return i
end

.simple_appdir_configure(i = ARGV) ⇒ Object

#

RBT.simple_appdir_configure

This method can be used predominantly from a local directory, to invoke a “configure”, “make” and “make install” run.

Since as of 29.12.2019, the method also responds to –cmake as option.

Example for this latter use case, from the commandline:

appconf --cmake

If you use a build directory then you may wish to notify this method about it, via:

appconf --down

Since as of February 2023, a new class was added, and the option “–use-meson” was added, to force the use of meson. The latter was necessary as a few programs come with support for both “configure” as well as “meson”, so we need a commandline way to pick either one.

#


360
361
362
# File 'lib/rbt/actions/individual_actions/simple_appdir_configure/simple_appdir_configure.rb', line 360

def self.simple_appdir_configure(i = ARGV)
  RBT::Action::SimpleAppdirConfigure.new(i)
end

.simplified_ldd_output(i = ARGV) ⇒ Object

#

RBT.simplified_ldd_output

#


133
134
135
# File 'lib/rbt/utility_scripts/simplified_ldd_output.rb', line 133

def self.simplified_ldd_output(i = ARGV)
  RBT::SimplifiedLddOutput.new(i)
end

.slateblue(i = '') ⇒ Object

#

RBT.slateblue

#


138
139
140
141
# File 'lib/rbt/colours/html_colours.rb', line 138

def self.slateblue(i = '')
  return COLOURS::HtmlColoursMethods.slateblue(i) if use_colours?
  return i
end

.software_manager(i = ARGV, &block) ⇒ Object

#

RBT.software_manager

This method must be guaranteed to always be a direct wrapper over class RBT::Action::SoftwareManager.

#


100
101
102
103
104
105
# File 'lib/rbt/actions/individual_actions/software_manager/software_manager.rb', line 100

def self.software_manager(
    i = ARGV,
    &block
  )
  RBT::Action::SoftwareManager.new(i, &block)
end

.source_base_directory?Boolean

#

RBT.source_base_directory?

This is a simple query-method for the source directory in use (called “source base directory”).

The default value to it is “/home/x/SRC/” on my system - which may be different on other computers, which is why this has to be settable and modifiable by the user via the setter method called RBT.set_source_base_directory().

#

Returns:

  • (Boolean)


710
711
712
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 710

def self.source_base_directory?
  @source_base_directory
end

.static_overview_of_the_available_binaries_on_this_computer_systemObject

#

RBT.static_overview_of_the_available_binaries_on_this_computer_system

#


161
162
163
# File 'lib/rbt/utility_scripts/static_overview_of_the_available_binaries_on_this_computer_system.rb', line 161

def self.static_overview_of_the_available_binaries_on_this_computer_system
  RBT::StaticOverviewOfTheAvailableBinariesOnThisComputerSystem.new
end

.statistics?(this_file = '/home/x/programming/ruby/src/rbt/doc/statistics/cookbook_statistics.md') ⇒ Boolean

#

RBT.statistics?

This method will return an Array, showcasing how many programs were registered at certain dates (time stamps).

This will be based on reading in the content of the file called ‘cookbook_statistics.md’. The extracted rbt gem will have this .md file, should you need it.

#

Returns:

  • (Boolean)


227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 227

def self.statistics?(
    this_file = '/home/x/programming/ruby/src/rbt/doc/statistics/cookbook_statistics.md'
  )
  result = []
  if File.exist? this_file
    _ = File.readlines(this_file).select {|line| line.include? '' }
    _.map! {|entry|
      # ===================================================================== #
      # Sort first by date, then by n programs.
      #
      # See: https://rubular.com/r/5O9frs0hmuqI4Q
      # ===================================================================== #
      entry =~ /→\s*(\d{1,5})(.+)(\d{2}\.\d{2}\.\d{4})/
      entry = [$3.to_s.dup, $1.to_s.dup.to_i]
      entry
    }
    result = _
  end
  return result
end

.stderr(i = '', use_puts_or_print = :puts) ⇒ Object

#

RBT.stderr

By default, “puts” in ruby writes to STDOUT. We can use STDERR.puts to send to the error-stream specifically.

The best practice is to log debugging information, errors, warnings, status and so forth to STDERR; actual program output should go towards STDOUT.

#


648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 648

def self.stderr(
    i                 = '',
    use_puts_or_print = :puts
  )
  if i.is_a? Array
    i = i.join
  end
  case use_puts_or_print
  # ======================================================================= #
  # === :puts
  # ======================================================================= #
  when :puts
    $stderr.puts i
  # ======================================================================= #
  # === :print
  # ======================================================================= #
  when :print,
       :use_print
    $stderr.print i
  else
    e 'Unknown input at line 35 in the method RBT.stderr().'
  end
end

.steelblue(i = '', use_colours = use_colours? ) ⇒ Object

#

RBT.steelblue

#


47
48
49
50
51
52
53
# File 'lib/rbt/colours/html_colours.rb', line 47

def self.steelblue(
    i           = '',
    use_colours = use_colours?
  )
  return COLOURS::HtmlColoursMethods.steelblue(i) if use_colours
  return i
end

.store_abbreviations(into = RBT.file_abbreviations) ⇒ Object

#

RBT.store_abbreviations

This method will store the abbreviations to the programs in a file.

To invoke this method on the commandline do:

rbt --generate-abbreviations
#


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 46

def self.store_abbreviations(
    into = RBT.file_abbreviations
  )
  what = return_all_abbreviations_of_this_array
  what = YAML.dump(what)
  e "#{::Colours.rev}Storing into the file `#{::Colours.sfile(into)}#{::Colours.rev}`."
  write_what_into(what, into)
  if is_on_roebe?
    # ===================================================================== #
    # Also store this in my home directory, the respective yaml
    # directory.
    # ===================================================================== #
    into = RUBY_SRC_DIR_RBT_YAML+
           File.basename(into.delete_suffix('.yml'))+'/'+
           File.basename(into)
    e "#{::Colours.rev}Also storing into the file "\
      "`#{::Colours.sfile(into)}#{::Colours.rev}`."
    write_what_into(what, into)
  end
end

.store_available_programs_into_a_yaml_file(array = ::RBT.array_available_programs) ⇒ Object

#

RBT.store_available_programs_into_a_yaml_file

This method will, upon being invoked, store the available programs in a yaml file. This is only useful on my home system, though - regular users can just use the generated .yml file as-is.

#


26
27
28
29
30
31
32
33
34
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 26

def self.store_available_programs_into_a_yaml_file(
    array = ::RBT.array_available_programs
  )
  require 'yaml'
  dataset = YAML.dump(array)
  file = "#{RUBY_SRC_DIR_RBT_YAML}available_programs/available_programs.yml"
  e "#{rev}Storing into `#{file}#{rev}`."
  write_what_into(dataset, file)
end

.store_the_last_configuration_options_in_this_fileObject

#

RBT.store_the_last_configuration_options_in_this_file

You can also use this alias-method for invoking the method:

RBT.store_the_last_configuration_options_into_which_file? # => "/Depot/Temp/rbt/last_configure_options_used.md"
#


927
928
929
930
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 927

def self.store_the_last_configuration_options_in_this_file
  "#{RBT.store_into_this_directory?}"\
  "last_configure_options_used_through_class_show_configuration_options.md"
end

.store_the_string_into_a_md_fileObject

#

RBT.store_the_string_into_a_md_file

Note that this method will store into the log-directory.

#


82
83
84
85
86
87
88
89
90
# File 'lib/rbt/toplevel_methods/return_string_containing_all_program_versions.rb', line 82

def self.store_the_string_into_a_md_file
  RBT.initialize_configuration unless RBT.configuration_has_been_initialized_already?
  # e RBT.return_string_containing_all_program_versions
  string = RBT.return_string_containing_all_program_versions_the_last_update_and_the_remote_URL
  e string
  into = "#{RBT.log_dir?}programs_version_url.md"
  write_what_into(string, into)
  e "#{rev}Also stored into the file at `#{into}`."
end

.store_this_expanded_dataset_into_that_yaml_file(expanded_dataset, yaml_file) ⇒ Object

#

RBT.store_this_expanded_dataset_into_that_yaml_file

#


761
762
763
764
765
766
767
768
769
770
771
772
773
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 761

def self.store_this_expanded_dataset_into_that_yaml_file(
    expanded_dataset,
    yaml_file
  )
  write_what_into(expanded_dataset, yaml_file)
  # ===================================================================== #
  # Since as of May 2020, on roebe systems, we will also store this.
  # ===================================================================== #
  if is_on_roebe?
    yaml_file = "#{RUBY_SRC_DIR_RBT_YAML}expanded_cookbooks/#{File.basename(yaml_file)}"
    write_what_into(expanded_dataset, yaml_file)
  end
end

.suggest_cookbook_for(this_program = ARGV, &block) ⇒ Object

#

RBT.suggest_cookbook_for

This is a simpler toplevel-method for the functionality defined in this .rb file.

#


827
828
829
830
831
832
# File 'lib/rbt/actions/individual_actions/cookbooks/suggest_cookbook_for/suggest_cookbook_for.rb', line 827

def self.suggest_cookbook_for(
    this_program = ARGV,
    &block
  )
  return RBT::Action::Cookbooks::SuggestCookbookFor.new(this_program, &block)
end

.swarn(i = '') ⇒ Object

#

RBT.swarn

#


83
84
85
86
87
88
89
90
91
92
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 83

def self.swarn(i = '')
  if use_colours?
    if HASH_DESIGNATED_COLOURS.empty?
      return COLOURS.swarn(i)
    else
      return COLOURS::HtmlColoursMethods.send(user_designated_colour(:swarn), i)
    end
  end
  return i
end

.swift_return_version_of_this_program(this_program = :htop) ⇒ Object

#

RBT.swift_return_version_of_this_program

This method here is different from RBT.return_version_of_this_program()

Rather than instantiate a new RBT::Cookbooks::SanitizeCookbook object, we just query the version from a yaml file directly. This is obviously much faster, as we don’t have to do any sanitize-operation and other method calls related to this.

The obvious drawback is that we may have to manually update that yaml file and keep it up-to-date - but the advantage by far outweighs this disadvantage. This method here will be much faster than RBT.return_version_of_this_program() - and ideally, you should use it, rather than the other method.

If the program in question can not be found, this method will return nil.

Invocation examples:

RBT.swift_return_version_of_this_program(:ruby) # => "2.3.1"
RBT.swift_return_version_of_this_program(:htop) # => "2.0.2"
RBT.swift_return_version_of_this_program(:awk)  # => "2.0.2"
#


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/rbt/toplevel_methods/swift_return_version_of_this_program.rb', line 39

def self.swift_return_version_of_this_program(
    this_program = :htop
  )
  require 'rbt/toplevel_methods/available_programs.rb'
  require 'rbt/toplevel_methods/does_include.rb'
  this_program = this_program.to_s
  # ======================================================================= #
  # Next, try to pass it against a list of aliases, if it has not
  # been yet "findable".
  # ======================================================================= #
  if !RBT.does_include?(this_program, :ignore_aliases)
    require 'rbt/aliases/aliases.rb'
    possible_alternative_name = RBT.find_cookbook_alias_for(this_program)
    if possible_alternative_name
      if possible_alternative_name != this_program
        this_program = possible_alternative_name
      end
    end
  end
  # ======================================================================= #
  # Load up the file that contains the programs-version information:
  #
  # This may reside at a location such as this one here:
  #
  #   /Programs/Ruby/2.6.4/lib/ruby/site_ruby/2.6.0/rbt/yaml/programs_version.yml
  #
  # The old code until June 2020 was:
  #
  #   _ = RBT.file_programs_version
  #
  # On 11.06.2020 this was changed, to use the "bigfile" instead.
  #
  # ======================================================================= #
  _ = RBT.file_programs_version
  _ = RBT.file_available_programs_versions
  if File.exist? _ # This is e. g. "rbt/yaml/programs_version/available_programs_versions.md"
    dataset = File.readlines(_) # Read in the file next.
    selection = dataset.select {|entry|
      entry.start_with? "#{this_program} "
    }
    if selection and !selection.empty?
      selection = selection.first
      splitted = selection.split(' ')
      program_version = splitted[1].sub(/.src$/,'')
      return program_version
    end 
  else
    e "#{rev}No file called `#{sfile(_)}#{rev}` exists."
    raise FileDoesNotExist, "#{_} does not exist."
  end
  return nil # Default return value here.
end
#

RBT.symlink (symlink tag)

Wrapper to symlink something, by delegating towards class Symlink.

This could also be adapted to work on Windows.

Please use this and only this method consistently when wanting to create a symlink from within the RBT project.

Here we have to be careful with the arguments, because File.symlink will fail if the file already exists. Right now we default to the behaviour that we will ALWAYS remove any file that exists at ‘new_location`.

#


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/rbt/toplevel_methods/symlink.rb', line 27

def self.symlink(
    existing,
    new_location = nil,
    be_verbose   = true,
    use_colours  = RBT.use_colours? # Here we need colours/colours.rb
  )
  case be_verbose
  # == :be_quiet
  when :be_quiet, :be_silent
    be_verbose = false
  # === :default
  when :default
    be_verbose = true
  end
  if existing.is_a? Hash
    # ===================================================================== #
    # === :to
    # ===================================================================== #
    if existing.has_key? :to
      new_location = existing.delete(:to)
    end
    # ===================================================================== #
    # === :from
    # ===================================================================== #
    if existing.has_key? :from
      existing = existing.delete(:from)
    end
  end
  # ======================================================================= #
  # === Delegate towards class Symlink next, after a check
  # ======================================================================= #
  unless Object.const_defined? :Symlink
    require 'rbt/toplevel_methods/roebe.rb'
    if is_on_roebe?
      e '(from rbt/toplevel_methods/symlink.rb): class Symlink '\
        'is not available - consider installing it.'
    end
  end
  _ = Symlink.new(
    existing,
    new_location,
    be_verbose,
    :do_not_run_yet
  )
  unless _.namespace?.start_with? 'RBT→'
    _.prepend_this_to_namespace 'RBT→'
  end
  _.shall_we_use_colours?(use_colours)
  # ======================================================================= #
  # For understanding the next line look at USE_ABSOLUTE_SYMLINKING above.
  # ======================================================================= #
  _.use_absolute_symlinking if USE_ABSOLUTE_SYMLINKING
  _.disable_opn if RBT.do_not_show_names?
  _.run
end
#

The following method is very specialized - it will symlink all entries under lib/* into the /usr/lib/ hierarchy.

This will be invoked as part of the postinstallation-steps, but only if we make use of an AppDir layout, and only if we are on a roebe-system (aka my home directory normally).

#


785
786
787
788
789
790
791
792
793
794
795
796
797
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 785

def self.symlink_appdir_libraries_into_usr_lib_directory(
    from_this_appdir_library_target
  )
  e "#{rev}Now obtaining all entries from the directory `"\
    "#{sdir(from_this_appdir_library_target)}#{rev}`:"
  entries = Dir["#{from_this_appdir_library_target}*"]
  entries.each {|this_library|
    symlink(
      this_library,
      "/usr/lib/#{File.basename(this_library)}"
    )
  }
end
#
#


290
291
292
# File 'lib/rbt/utility_scripts/symlink_headers.rb', line 290

def self.symlink_headers(i = ARGV)
  RBT::SymlinkHeaders.new(i)
end
#

Easier module-method variant to use.

#


970
971
972
# File 'lib/rbt/utility_scripts/symlink_from_to_current/symlink_from_to_current.rb', line 970

def self.symlink_this_program(i = ARGV)
  RBT::SymlinkFromToCurrent.new(i)
end

.sysbin_directory?Boolean

#

RBT.sysbin_directory?

#

Returns:

  • (Boolean)


670
671
672
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 670

def self.sysbin_directory?
  @sysbin_directory
end

.sysetc_directory?Boolean

#

RBT.sysetc_directory?

#

Returns:

  • (Boolean)


851
852
853
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 851

def self.sysetc_directory?
  @sysetc_directory
end

.sysinclude_directory?Boolean

#

RBT.sysinclude_directory?

#

Returns:

  • (Boolean)


1222
1223
1224
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1222

def self.sysinclude_directory?
  @sysinclude_directory
end

.syslib_directory?Boolean

#

RBT.syslib_directory?

#

Returns:

  • (Boolean)


1070
1071
1072
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1070

def self.syslib_directory?
  @syslib_directory
end

.system_directory?Boolean

#

RBT.system_directory?

#

Returns:

  • (Boolean)


141
142
143
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 141

def self.system_directory?
  @system_directory
end

.system_settings_directory?Boolean

#

RBT.system_settings_directory?

#

Returns:

  • (Boolean)


1147
1148
1149
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1147

def self.system_settings_directory?
  @system_settings_directory
end

.system_share_directory?Boolean

#

RBT.system_share_directory?

#

Returns:

  • (Boolean)


1108
1109
1110
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1108

def self.system_share_directory?
  @system_share_directory
end

.system_tags?Boolean

#

RBT.system_tags?

This method will yield towards the Tags/ subdirectory. It defaults to /System/Tags/ on my home system.

#

Returns:

  • (Boolean)


141
142
143
# File 'lib/rbt/configuration/configuration.rb', line 141

def self.system_tags?
  "#{RBT.system_dir?}Tags/" # Keep a trailing / please.
end

.teal(i = '', use_colours = use_colours? ) ⇒ Object

#

RBT.teal

#


25
26
27
28
29
30
31
# File 'lib/rbt/colours/html_colours.rb', line 25

def self.teal(
    i           = '',
    use_colours = use_colours?
  )
  return COLOURS::HtmlColoursMethods.teal(i) if use_colours
  return i
end

.temp_directory?Boolean

#

RBT.temp_directory?

Preferentially use this method if you wish to find out the path to the temporary directory in use by the RBT project.

#

Returns:

  • (Boolean)


521
522
523
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 521

def self.temp_directory?
  @temp_directory
end

.test_this_alias(i) ⇒ Object

#

RBT.test_this_alias

This method here is mostly used by a .rb file under the rbt/bin/ hierarchy.

#


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/rbt/toplevel_methods/available_programs.rb', line 73

def self.test_this_alias(i)
  require 'rbt/aliases/aliases.rb'
  e "#{rev}This program will test whether the given input is:"
  e
  e '  - a registered cookbook program       (1)'
  e '  - a registered cookbook alias         (2)'
  e '  - a registered cookbook abbreviation  (3)'
  e
  e 'in precisely this order.'
  e
  i = [i].flatten.compact
  i.each {|entry|
    if RBT.is_a_registered_cookbook_program?(entry)
      e 'Yes, '+RBT.sfancy(entry)+rev+' is a registered cookbook program.'
    else
      e 'No, '+RBT.sfancy(entry)+rev+' is NOT a registered cookbook program.'
    end
    if RBT.is_an_alias?(entry)
      e 'Yes, '+RBT.sfancy(entry)+rev+' is an alias.'
    else
      e 'No, '+RBT.sfancy(entry)+rev+' is NOT an alias.'
    end
    if RBT.is_an_abbreviation?(entry)
      e 'Yes, '+RBT.sfancy(entry)+rev+' is an abbreviation.'
    else
      e 'No, '+RBT.sfancy(entry)+rev+' is NOT an abbreviation.'
    end
  }
end

.this_library_to_that_program(i) ⇒ Object

#

RBT.this_library_to_that_program

Usage example:

RBT.this_library_to_that_program('libc.so') # => "musl"
#


63
64
65
# File 'lib/rbt/toplevel_methods/all_libraries.rb', line 63

def self.this_library_to_that_program(i)
  ALL_LIBRARIES[i]
end

.to_bool(i) ⇒ Object

#

RBT.to_bool

#


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rbt/toplevel_methods/to_bool.rb', line 12

def self.to_bool(i)
  case i.to_s
  when 'f',
       'false',
       'no',
       'n'
    i = false
  when 't',
       'true',
       'yes',
       'y'
    i = true
  end
  i
end

.to_current(i = ARGV, options_hash = {}, &block) ⇒ Object

#

RBT.to_current

#


321
322
323
324
325
326
327
# File 'lib/rbt/actions/individual_actions/to_current/to_current.rb', line 321

def self.to_current(
    i            = ARGV,
    options_hash = {},
    &block
  )
  RBT::Action::ToCurrent.new(i, &block)
end

.tomato(i) ⇒ Object

#

RBT.tomato

#


98
99
100
101
# File 'lib/rbt/colours/html_colours.rb', line 98

def self.tomato(i)
  return COLOURS::HtmlColoursMethods.tomato(i) if use_colours?
  return i
end

.toplevel_methods?Boolean

#

RBT.toplevel_methods?

Simply return the constant here. This will tell us where the module_method .rb files are kept.

This will typically return a path such as:

/Programs/Ruby/2.6.0/lib/ruby/site_ruby/2.6.0/rbt/toplevel_methods/
#

Returns:

  • (Boolean)


579
580
581
# File 'lib/rbt/constants/constants.rb', line 579

def self.toplevel_methods?
  "#{RBT.project_base_directory?}toplevel_methods/"
end

.trad(i = ARGV, &block) ⇒ Object

#

RBT.trad

#


120
121
122
# File 'lib/rbt/utility_scripts/compile_in_traditional_manner.rb', line 120

def self.trad(i = ARGV, &block)
  RBT::CompileInTraditionalManner.new(i, &block)
end

.try_to_find_shortcut_for_a_chain_compiled_program(i) ⇒ Object

#

RBT.try_to_find_shortcut_for_a_chain_compiled_program

Use this method if you wish to find a shortcut.

#


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/rbt/toplevel_methods/try_to_find_shortcut_for_a_chain_compiled_program.rb', line 15

def self.try_to_find_shortcut_for_a_chain_compiled_program(
    i
  )
  if i.is_a? Array
    i = i.first # Only care about the first member of a given Array.
  end
  i = i.to_s.delete('_') # Since as of Aug 2011, we will get rid of all '_' characters.
  i = case i # case tag
  # ======================================================================= #
  # === kde
  # ======================================================================= #
  when 'kde',
       'kde3',
       'kde4',
       'kd',
       'default'
    'kde'
  # ======================================================================= #
  # === kde1
  #
  # This entry point is used as a shortcut for the programs listed in
  # KDE5 foundation.
  # ======================================================================= #
  when 'kde1',
       /kde5(_|-| )?foundation/
    'kde5_foundation'
  # ======================================================================= #
  # === xorg_libraries
  # ======================================================================= #
  when 'libs',
       'libraries',
       'xorg3',
       'xorglibraries',
       'x3',
       '3',
       /^-?-?compile(-|_)?xorg(-|_)?base$/i,
       /^-?-?xorg(-|_)?server(-|_)?libraries$/i
    'xorg_libraries'
  # ======================================================================= #
  # === games
  # ======================================================================= #
  when 'games',
       'gam'
    'games'
  # ======================================================================= #
  # === protos
  # ======================================================================= #
  when 'protos',
       'proto',
       'xorgprotos',
       'xorg1',
       'x1',
       '1'
    'xorg_protos'
  # ======================================================================= #
  # === utils
  # ======================================================================= #
  when 'utils',
       'xorgutils',
       'xorg2',
       'x2',
       '2'
    'xorg_utils'
  # ======================================================================= #
  # === data
  # ======================================================================= #
  when 'data',
       'xorg4',
       'xorgdata',
       'x4',
       '4'
    'xorg_data'
  # ======================================================================= #
  # === xorg_apps
  # ======================================================================= #
  when /xorg(_|-)?apps/,
       'apps',
       'xorg5',
       'x5',
       '5'
    'xorg_apps'
  # ======================================================================= #
  # === fonts
  # ======================================================================= #
  when 'fonts',
       'xorg6',
       'xorgfonts',
       'x6',
       '6'
    'xorg_fonts'
  # ======================================================================= #
  # === server
  # ======================================================================= #
  when 'server',
       'xorg7',
       'xorgserver',
       'x7',
       '7'
    'xorg_server'
  # ======================================================================= #
  # === addons
  # ======================================================================= #
  when 'addons',
       'ruby_addons',
       'rubyaddons',
       'raddons',
       'raddon',
       'rub',
       'r',
       'rand',
       'all',
       '8'
    'ruby_addons'
  # ======================================================================= #
  # === python
  # ======================================================================= #
  when 'python',
       'mypython',
       'pp',
       'pyt',
       'pyth',
       '9'
    'my_python'
  # ======================================================================= #
  # === gnome
  # ======================================================================= #
  when 'gnome',
       'xorg10',
       '10'
    'gnome5'
  # ======================================================================= #
  # === e
  # ======================================================================= #
  when 'e','11','xorg11','e17'
    'e17'
  # ======================================================================= #
  # === audio_suite
  # ======================================================================= #
  when 'audio_suite','audsuite'
    'aud_suite'
  when 'video_base','vidbase','vid_base',
       /video(_|-)?subsection/
    'vid_base'
  else
    i # Else return the input unaltered.
  end
  return i
end

.try_to_return_a_special_compile_component(i) ⇒ Object

#

RBT.try_to_return_a_special_compile_component

This method will take an input, such as “–kde1”, and return an associated program, if possible.

The reason why this method exists is so that we can use input such as “compile kde1” and just compile the first kde component that is registered. It is thus a convenient shortcut - we don’t have to remember any names if we don’t want to.

#


226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/rbt/toplevel_methods/try_to_return_a_special_compile_component.rb', line 226

def self.try_to_return_a_special_compile_component(i)
  case i # case tag, menu tag
  # ======================================================================= #
  # === Compile a specific GNOME component
  #
  # This entry point allows us to use numbers in order to return
  # a particular gnome component, and then proceed to compile it.
  # So for example, "gnome1" will compile the first gnome component,
  # "gnome2" will refer to the second gnome component and so forth.
  #
  # Invocation examples:
  #
  #   ry gnome1
  #   ry --gnome2
  #   ry gnome1..20
  #
  # ======================================================================= #
  when /^-?-?gnome(\d{1,3}\.{0,2}\d{0,3})$/ # ← See: http://rubular.com/r/n2r8DwcTnU
    i = return_this_gnome_component($1.to_s.dup)
  # ======================================================================= #
  # === Compile a specific mate-desktop component
  #
  # This entry point allows us to use numbers in order to compile
  # a particular mate-desktop component. So for example, "mate1"
  # will be a shortcut for "matedesktop" whereas "mate2" will
  # be a shortcut for "libmatemixer", and so forth.
  #
  # Invocation examples:
  #
  #   ry mate1
  #   ry mate2
  #   ry mate3
  #   ry --mate1
  #   ry --mate2
  #   ry --mate3
  #   ry mate11
  #   ry mate1..100
  #
  # ======================================================================= #
  when /^-?-?mate(\d{1,3}\.{0,2}\d{0,3})$/ # ← See: https://rubular.com/r/n2r8DwcTnU
    match = $1.to_s.dup
    i = return_this_mate_component(match)
  # ======================================================================= #
  # === Compile a specific KDE5 plasma component
  #
  # This entry point allows us to use numbers in order to compile
  # a particular KDE5 Plasma component.
  #
  # Invocation examples:
  #
  #   ry plasma1
  #   ry --plasma3
  #
  # ======================================================================= #
  when /^-?-?plasma(\d{1,3}\.{0,2}\d{0,3})$/ # ← See: https://rubular.com/r/YQtQZjKtBsmKuj
    match = $1.to_s.dup
    i = return_this_plasma_component(match)
  # ======================================================================= #
  # === Compile a specific KDE5 application
  #
  # Invocation examples:
  #
  #   ry --kde_apps1
  #   ry --kde_apps4
  #   ry kde_apps4
  #
  # ======================================================================= #
  when /^-?-?kde(-|_| )?apps(\d+)$/i
    index = $2.to_s.to_i - 1
    i = return_kde5_applications[index]
  # ======================================================================= #
  # === Compile a specific LXQT-desktop component
  #
  # This entry point allows us to use numbers in order to compile
  # a particular lx-qt-desktop component. So for example, "lxqt1"
  # will be a shortcut for "libqtxdg" whereas "lxqt2" will
  # be a shortcut for "lxqtbuildtools", and so forth.
  #
  # Invocation examples:
  #
  #   ry lxqt1
  #   ry lxqt2
  #   ry lxqt3
  #   ry --lxqt1
  #   ry --lxqt2
  #   ry --lxqt3
  #   ry lxqt11
  #   ry lxqt..100
  #
  # ======================================================================= #
  when /^-?-?lxqt(\d{1,3}\.{0,2}\d{0,3})$/ # ← See: http://rubular.com/r/n2r8DwcTnU
    match = $1.to_s.dup
    i = return_this_lxqt_component(match)
  # ======================================================================= #
  # === Compile a KDE5 porting aids component
  #
  # Invocation examples:
  #
  #   ry portingaids1
  #   ry portingaids2
  #   ry portingaids3
  #   ry portingaids4
  #   ry portingaids5
  #   ry portingaids6
  #
  # ======================================================================= #
  when /^-?-?portingaids(\d{1,3}\.{0,2}\d{0,3})$/ # ← See: http://rubular.com/r/n2r8DwcTnU
    match = $1.to_s.dup
    i = return_this_portingaids_component(match)
  # ======================================================================= #
  # === Compile a specific XORG component
  #
  # This entry point allows us to use numbers in order to compile
  # a particular xorg component. So for example, "xorg1" will compile
  # the first xorg component, "xorg2" will refer to the second
  # xorg component and so forth.
  #
  # Invocation examples:
  #
  #   ry xorg1
  #   ry --xorg2
  #   ry --xorg15
  #   ry xorg1..20
  #
  # ======================================================================= #
  when /^-?-?xorg(\d{1,3}\.{0,2}\d{0,3})$/ # ← See: http://rubular.com/r/n2r8DwcTnU
    match = $1.to_s.dup
    i = return_this_xorg_component(match)
  # ======================================================================= #
  # === Compile a specific XFCE component
  #
  # This entry point allows us to use numbers in order to compile
  # a particular xfce component. So for example, "xfce1" will compile
  # the first xfce component, "xfce2" will refer to the second
  # xfce component and so forth.
  #
  # Invocation examples:
  #
  #   ry xfce1
  #   ry --xfce2
  #   ry xfce1..20
  #
  # ======================================================================= #
  when /^-?-?xfce(\d{1,3}\.{0,2}\d{0,3})$/ # ← See: http://rubular.com/r/n2r8DwcTnU
    match = $1.to_s.dup
    i = return_this_xfce_component(match)
  # ======================================================================= #
  # === Compile a specific game
  #
  # This entry point allows us to use numbers in order to compile
  # a particular mate-desktop component. So for example, "game1"
  # will compile the first game, "game2" will refer to the second
  # game and so forth.
  #
  # Invocation examples:
  #
  #   ry game1
  #   ry --game2
  #   ry game1..20
  #
  # ======================================================================= #
  when /^-?-?game(\d{1,3}\.{0,2}\d{0,3})$/ # ← See: http://rubular.com/r/n2r8DwcTnU
    match = $1.to_s.dup
    i = return_this_game_component(match)
  # ======================================================================= #
  # === Compile a specific kde component
  #
  # This entry point allows us to use numbers in order to compile a
  # particular KDE component. So for example, "kde1" will be a
  # shortcut for "extracmakemodules".
  #
  # Invocation examples:
  #
  #   ry kde1
  #   ry kde2
  #   ry kde3
  #   ry --kde1
  #   ry --kde2
  #   ry --kde3
  #   ry --kde4
  #   ry --kde5
  #   ry --kde10
  #   ry kde11
  #   ry kde15
  #   ry kde1..100
  #   ry --kde1..kde250
  #
  # ======================================================================= #
  when /^-?-?kde(\d{1,3}\.{0,2}[a-z]{0,3}\d{0,3})/ # ← See: http://rubular.com/r/PzADEmm1Jc
    match = $1.to_s.dup
    i = return_this_kde_component(match)
  end
  i # Return it here.
end

.turquoise(i) ⇒ Object

#

RBT.turquoise

#


106
107
108
109
# File 'lib/rbt/colours/html_colours.rb', line 106

def self.turquoise(i)
  return COLOURS::HtmlColoursMethods.turquoise(i) if use_colours?
  return i
end

.unicode_cliner(use_this_token = '=', use_this_colour = nil, &block) ⇒ Object

#

RBT.unicode_cliner

This is like RBT.cliner(), but it will make use of unicode horizontal building block.

#


17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rbt/toplevel_methods/cliner.rb', line 17

def self.unicode_cliner(
    use_this_token  = '=',
    use_this_colour = nil,
    &block
  )
  yielded = :unicode
  if block_given?
    yielded = yield
  end
  RBT.cliner(use_this_token, use_this_colour) { yielded }
end

.uninstall(i = ARGV) ⇒ Object

#

RBT.uninstall

#


104
105
106
# File 'lib/rbt/utility_scripts/uninstall.rb', line 104

def self.uninstall(i = ARGV)
  RBT::Uninstall.new(i)
end

.unpin_this_program(i) ⇒ Object

#

RBT.unpin_this_program

#


46
47
# File 'lib/rbt/toplevel_methods/pin_and_unpin.rb', line 46

def self.unpin_this_program(i)
end

.update_all_ruby_gemsObject

#

RBT.update_all_ruby_gems

This method can be used to update all local ruby gems (.gem files).

#


214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/rbt/check_for_updates/check_for_new_release_on_rubygems.rb', line 214

def self.update_all_ruby_gems
  # ========================================================================= #
  # Instantiate the main class defined in this .rb file here:
  # ========================================================================= #
  _ = RBT::Cookbooks::CheckForNewReleaseOnRubygems.new(:dont_run_yet)
  base_dir = RBT.individual_cookbooks_directory?
  # ========================================================================= #
  # First, we must obtain all entries thave have the strings "url1"
  # and ".gem". We will ask ruby to perform a grep-operation. We will
  # store these in an array.
  # ========================================================================= #
  array_ruby_gems = []
  available_programs = available_programs?
  available_programs.each {|this_program|
    target_yaml_file = "#{base_dir}#{this_program}.yml"
    if File.exist? target_yaml_file
      dataset = File.read(target_yaml_file)
      if dataset.include?('url1')
        line_holding_url1 = dataset.scan(/^ url1: (.+)$/).flatten.first
        if line_holding_url1.nil?
          e 'No result has been found on the dataset at hand, from the file'
          e sfile(target_yaml_file)
        end
        if line_holding_url1
          if line_holding_url1.end_with? '.gem' # Found ruby gems.
            array_ruby_gems << [this_program, line_holding_url1] 
          end
        end
      end
    end
  }
  # ========================================================================= #
  # Ok - now that we have obtained the files that are .gem files,
  # we can proceed them and check for an updated. This taps into
  # a specialized class that will do so for us.
  # ========================================================================= #
  array_ruby_gems.each {|this_ruby_gem, remote_url|
    _.check_this_remote_url(remote_url)
  }
end

.update_entry(i = ARGV) ⇒ Object

#

RBT.update_entry

This is a simpler toplevel API to tap into class RBT::UpdateEntry.

#


853
854
855
# File 'lib/rbt/utility_scripts/update_entry/update_entry.rb', line 853

def self.update_entry(i = ARGV)
  RBT::UpdateEntry.new(i)
end

.update_kde_applicationsObject

#

RBT.update_kde_applications

#


177
178
179
# File 'lib/rbt/check_for_updates/update_kde_applications.rb', line 177

def self.update_kde_applications
  RBT::Cookbooks::UpdateKdeApplications.new
end

.update_kde_frameworkObject

#

RBT.update_kde_framework

#


182
183
184
# File 'lib/rbt/check_for_updates/update_kde_framework.rb', line 182

def self.update_kde_framework
  RBT::Cookbooks::UpdateKdeFramework.new
end

.update_kde_plasma(i = ARGV) ⇒ Object

#

RBT.update_kde_plasma

#


192
193
194
# File 'lib/rbt/check_for_updates/update_kde_plasma.rb', line 192

def self.update_kde_plasma(i = ARGV)
  RBT::Cookbooks::UpdateKdePlasma.new(i)
end

.update_kde_porting_aids(i = ARGV) ⇒ Object

#

RBT.update_kde_porting_aids

#


175
176
177
# File 'lib/rbt/check_for_updates/update_kde_porting_aids.rb', line 175

def self.update_kde_porting_aids(i = ARGV)
  RBT::Cookbooks::UpdateKdePortingAids.new(i)
end

.update_lxqt(i = ARGV) ⇒ Object

#

RBT.update_lxt

#


169
170
171
# File 'lib/rbt/check_for_updates/update_lxqt.rb', line 169

def self.update_lxqt(i = ARGV)
  RBT::Cookbooks::UpdateLxqt.new(i)
end

.update_these_rubygems(array_to_use = RBT.array_all_rubygems) ⇒ Object

#

RBT.update_these_rubygems

Usage example:

array = %w( thor prawn ); RBT.update_these_rubygems(array)
#


13255
13256
13257
13258
13259
13260
13261
13262
13263
# File 'lib/rbt/actions/individual_actions/software_manager/misc.rb', line 13255

def self.update_these_rubygems(
    array_to_use = RBT.array_all_rubygems
  )
  unless array_to_use.empty?
    array_to_use.each {|this_gem|
      RBT.install_this_rubygem(this_gem)
    }
  end
end

.upload_list_of_all_programs_version(this_file = RBT.store_into_this_directory+'programs_version.txt', type = :txt) ⇒ Object

#

RBT.upload_list_of_all_programs_version

This will use my FTP wrapper to upload this file.

The local .txt file is usually kept or autogenerated here:

/Depot/Temp/CookbookDirectory/programs_version.txt
#


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/rbt/toplevel_methods/ftp.rb', line 60

def self.upload_list_of_all_programs_version(
    this_file = RBT.store_into_this_directory+'programs_version.txt',
    type      = :txt # type can be :txt or :html
  )
  if File.exist? this_file
    case type
    when :html
      begin
        require 'rbt/toplevel_methods/create_programs_version_html_file.rb'
      rescue LoadError; end
      RBT.create_programs_version_html_file(this_file)
      this_file.sub!(/\.txt$/,'')
    end
    opn; e 'Uploading the file '+sfile(this_file)+' next.'
    begin
      require 'ftp_paradise'
    rescue LoadError
    rescue SyntaxError
    end
    if Object.const_defined? :FtpParadise
      begin
        _ = FtpParadise::Connection.new(:dont_run_yet)
        _.set_be_verbose
        _.set_mode :ascii
        _.set_data(:shevy)
        _.(:shevy)
        _.upload(this_file, :be_silent)
      # ===================================================================== #
      # We have to rescue the following error because FtpParadise may be
      # unavailable - but we may still want to upload the RBT project.
      # ===================================================================== #
      rescue NameError => error
        pp error
        pp error.class
        e 'Continuing nonetheless despite the above ^^^ error.'
      end
    end
  else
    opn; e "No file exists at `#{sfile(this_file)}`."
  end
end

.use_colours?Boolean

#

RBT.use_colours?

Query method in order to determine whether the RBT project will make use of colours or whether it will not.

#

Returns:

  • (Boolean)


27
28
29
# File 'lib/rbt/colours/use_colours.rb', line 27

def self.use_colours?
  @use_colours
end

.use_opn?Boolean

#

RBT.use_opn?

#

Returns:

  • (Boolean)


27
28
29
# File 'lib/rbt/toplevel_methods/opn.rb', line 27

def self.use_opn?
  @use_opn
end

.use_yaml_database_for_tags?Boolean

#

RBT.use_yaml_database_for_tags?

#

Returns:

  • (Boolean)


108
109
110
# File 'lib/rbt/configuration/configuration.rb', line 108

def self.use_yaml_database_for_tags?
  RBT.configuration?.use_yaml_database_for_tags
end

.user_designated_colour(i = 'information') ⇒ Object

#

RBT.user_designated_colour

Note that “error” and “information” is currently (January 2023) not handled here.

#


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 32

def self.user_designated_colour(i = 'information')
  case i
  # ======================================================================= #
  # === :sfancy
  # ======================================================================= #
  when :sfancy
    i = 'fancy'
  # ======================================================================= #
  # === :sdir
  # ======================================================================= #
  when :sdir
    i = 'directory'
  # ======================================================================= #
  # === :sfile
  # ======================================================================= #
  when :sfile
    i = 'file'
  # ======================================================================= #
  # === :swarn
  # ======================================================================= #
  when :swarn
    i = 'warn'
  # ======================================================================= #
  # === :simp
  # ======================================================================= #
  when :simp
    i = 'important'
  end
  return HASH_DESIGNATED_COLOURS[i]
end

.utility_scripts?Boolean

#

RBT.utility_scripts?

This method will return the path to our utility_scripts/ directory. This is the directory where all utility scripts are stored.

#

Returns:

  • (Boolean)


968
969
970
# File 'lib/rbt/constants/constants.rb', line 968

def self.utility_scripts?
  "#{RBT.project_base_directory?}utility_scripts/"
end

.validate_blfs_entries(i = ARGV) ⇒ Object

#

RBT.validate_blfs_entries

#


159
160
161
# File 'lib/rbt/checks_and_validations/validate_blfs_entries.rb', line 159

def self.validate_blfs_entries(i = ARGV)
  RBT::Cookbooks::ValidateBlfsEntries.new(i)
end

.validate_cookbook_aliasesObject

#

RBT.validate_cookbook_aliases

#


179
180
181
# File 'lib/rbt/checks_and_validations/validate_cookbook_aliases.rb', line 179

def self.validate_cookbook_aliases
  RBT::Cookbooks::ValidateCookbookAliases.new
end

.validate_entriesObject

#

RBT.validate_entries

Batch-valide the cookbook recipes here.

#


143
144
145
# File 'lib/rbt/checks_and_validations/batch_validate_the_cookbook_recipes.rb', line 143

def self.validate_entries
  RBT::Cookbooks::BatchValidateTheCookbookRecipes.new
end

.validation_scripts?Boolean

#

RBT.validation_scripts?

Simply return the constant here. This will tell us where the validation scripts are stored.

#

Returns:

  • (Boolean)


532
533
534
# File 'lib/rbt/constants/constants.rb', line 532

def self.validation_scripts?
  "#{RBT.project_base_directory?}validation/"
end

.verbose_truth(i = 'true', optional_arguments = nil) ⇒ Object

#

RBT.verbose_truth

This “converts” the given appropriate input to a “Yes.” or “No.” String.

If you need a boolean variant, you can use the method RBT.to_bool().

By default a trailing ‘.’ will be used by this method.

#


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/rbt/toplevel_methods/verbose_truth.rb', line 19

def self.verbose_truth(
    i                  = 'true',
    optional_arguments = nil
  )
  i = i.first if i.is_a? Array
  case i.to_s
  # ======================================================================= #
  # === Handle true cases
  # ======================================================================= #
  when 'true',
       't',
       'j',
       'ja',
       'yes',
       'y'
    i = 'Yes.'
  # ======================================================================= #
  # === Handle false cases
  # ======================================================================= #
  when 'false',
       'f',
       'no',
       'n'
    i = 'No.'
  end
  i = i.dup if i.frozen?
  if optional_arguments
    # ===================================================================== #
    # Handle cases such as this one here:
    #
    #   verbose_truth(is_on_windows?, :do_not_capitalize)
    #
    # ===================================================================== #
    if optional_arguments.is_a? Symbol
      case optional_arguments
      # =================================================================== #
      # === :do_not_capitalize
      # =================================================================== #
      when :do_not_capitalize
        i.downcase!
      end
    end
  end
  i
end

.version?Boolean

#

RBT.version?

#

Returns:

  • (Boolean)


37
38
39
# File 'lib/rbt/version/version.rb', line 37

def self.version?
  RBT::VERSION
end

.violet(i = '') ⇒ Object

#

RBT.violet

#


114
115
116
117
# File 'lib/rbt/colours/html_colours.rb', line 114

def self.violet(i = '')
  return COLOURS::HtmlColoursMethods.violet(i) if use_colours?
  return i
end

.what_could_become_an_app_dir(i = ARGV) ⇒ Object

#

RBT.what_could_become_an_app_dir

#


107
108
109
# File 'lib/rbt/utility_scripts/what_could_become_an_app_dir.rb', line 107

def self.what_could_become_an_app_dir(i = ARGV)
  RBT::WhatCouldBecomeAnAppDir.new(i)
end

.will_install_which_binaries?Boolean

#

RBT.will_install_which_binaries?

This method will simply return an Array of binaries that belong to the rbt project. These all reside under the bin/ directory.

#

Returns:

  • (Boolean)


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rbt/toplevel_methods/install_which_binaries.rb', line 20

def self.will_install_which_binaries?
  results = []
  if is_on_roebe?
    results = Dir["#{RUBY_SRC_DIR_AT_HOME}rbt/bin/*"]
  else # Else we handle the case for regular users.
       # This depends on information stored in the file called
       # rbt_installs_these_executables.yml, which has to be
       # upgraded every now and then.
    results = YAML.load_file(
      "#{RBT.project_yaml_directory?}"\
      "rbt_installs_these_executables/rbt_installs_these_executables.yml"
    )
  end
  # ======================================================================= #
  # Use only the basename of any results:
  # ======================================================================= #
  results.map! {|entry|
    File.basename(entry)
  }
  results.sort # ← Keep the entries alphabetically sorted.
end

.wrap_at(this_string, my_limit = N_CHARACTERS_PER_LINE, add_newline = true, add_padding = nil) ⇒ Object

#

RBT.wrap_at (Begrenzung tag, limit tag, boundary tag)

Wraps at a specified position. The second argument denotes this limit.

Specific examples:

puts "abc abc abdc abc abc abc abc abc abc abc abcdef abc abc abc abc abc abc abc abc abc ".wrap_at(20)
puts RBT.wrap_at(("x"*200), 30)
puts RBT.word_wrap(("x"*200), 50)
("x"*200).wrap_at(30,true,5)
#


418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/rbt/toplevel_methods/toplevel_methods.rb', line 418

def self.wrap_at(
    this_string, # ← This must be the input-String.
    my_limit    = N_CHARACTERS_PER_LINE,
    add_newline = true,
    add_padding = nil
  )
  case my_limit
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    my_limit = N_CHARACTERS_PER_LINE
  end
  begin
    add_padding = add_padding.to_i unless add_padding.nil?
    if add_newline
      _ = "\\1\\3\n" # newline at end
      unless add_padding.nil?
        _ = _.linsert(' ' * add_padding)
      end
      return this_string.gsub(
        /(.{1,#{my_limit}})( +|$)\n?|(.{#{my_limit}})/,_
      )
    else
      _ = "\\1\\3"
      unless add_padding.nil?
        _ = _.linsert(' ' * add_padding)
      end
      return this_string.gsub(
        /(.{1,#{my_limit}})( +|$)\n?|(.{#{my_limit}})/,
        _
      ) # No newline at the end.
    end
  rescue Exception => error
    puts error
  end
end

.write_what_into(what, into, use_these_permissions = :default) ⇒ Object

#

RBT.write_what_into

#


1418
1419
1420
1421
1422
1423
1424
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1418

def self.write_what_into(
    what,
    into,
    use_these_permissions = :default
  )
  RBT::SaveFile.write_what_into(what, into, use_these_permissions)
end

.write_what_into_via_unicode(what, into, use_these_permissions = :default) ⇒ Object

#

RBT.write_what_into_via_unicode

#


1436
1437
1438
1439
1440
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1436

def self.write_what_into_via_unicode(
    what, into, use_these_permissions = :default
  )
  RBT::SaveFile.write_what_into_via_unicode(what, into, use_these_permissions)
end

.yaml_directory_for_the_registered_yaml_files?Boolean

#

RBT.yaml_directory_for_the_registered_yaml_files?

#

Returns:

  • (Boolean)


983
984
985
# File 'lib/rbt/constants/constants.rb', line 983

def self.yaml_directory_for_the_registered_yaml_files?
  "#{RBT.yaml_directory?}registered/"
end

.yaml_engine?Boolean

#

RBT.yaml_engine?

#

Returns:

  • (Boolean)


49
50
51
# File 'lib/rbt/requires/require_yaml.rb', line 49

def self.yaml_engine?
  @yaml_engine
end

Instance Method Details

#all_binaries?Boolean

#

all_binaries?

#

Returns:

  • (Boolean)


54
55
56
# File 'lib/rbt/toplevel_methods/all_binaries.rb', line 54

def all_binaries?
  RBT.all_binaries?
end

#all_libraries?Boolean

#

all_libraries?

#

Returns:

  • (Boolean)


70
71
72
# File 'lib/rbt/toplevel_methods/all_libraries.rb', line 70

def all_libraries?
  RBT.all_libraries?
end

#all_tags?Boolean

#

all_tags?

#

Returns:

  • (Boolean)


46
47
48
# File 'lib/rbt/registered/registered_tags.rb', line 46

def all_tags?
  RBT.all_tags?
end

#bold_blue(i) ⇒ Object

#

bold_blue

#


30
31
32
33
34
35
36
# File 'lib/rbt/colours/colours.rb', line 30

def bold_blue(i)
  if use_colours?
    "\e[1;34m"+i+"\e[0;37m"
  else
    i
  end
end

#bold_green(i) ⇒ Object

#

bold_green

#


19
20
21
22
23
24
25
# File 'lib/rbt/colours/colours.rb', line 19

def bold_green(i)
  if use_colours?
    "\e[1;32m"+i+"\e[0;37m"
  else
    i
  end
end

#get_file_listing(a = return_pwd, b = true, c = false) ⇒ Object Also known as: get_all_files_from, get_files_from, get_files

#

get_file_listing

Get the file listing of a specific directory. Input will always become a string. Use this method consistently when you want to get files from a directory, for use in the RBT Project.

Since September 2014 we will ONLY return real files.

#


1300
1301
1302
1303
1304
1305
1306
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1300

def get_file_listing(
    a = return_pwd,
    b = true,
    c = false
  )
  RBT.get_all_files_from(a, b, c)
end

#home_dir?Boolean Also known as: home_directory?

#

home_dir?

#

Returns:

  • (Boolean)


26
27
28
# File 'lib/rbt/toplevel_methods/home_directory.rb', line 26

def home_dir?
  self.home_dir?
end

#individual_cookbooks_directory?Boolean Also known as: cookbooks_directory?

#

individual_cookbooks_directory?

#

Returns:

  • (Boolean)


1269
1270
1271
# File 'lib/rbt/toplevel_methods/files_and_directories_related_methods.rb', line 1269

def individual_cookbooks_directory?
  ::RBT.cookbook_directory?
end

#is_roebe?Boolean Also known as: is_on_roebe?, on_roebe?

#

is_on_roebe?

#

Returns:

  • (Boolean)


23
24
25
# File 'lib/rbt/toplevel_methods/roebe.rb', line 23

def is_roebe?
  RBT.is_roebe?
end

#load_yaml(i) ⇒ Object

#

load_yaml

#


75
76
77
# File 'lib/rbt/requires/require_yaml.rb', line 75

def load_yaml(i)
  ::RBT.load_yaml(i)
end

#project_dir?Boolean

#

project_dir?

#

Returns:

  • (Boolean)


58
59
60
# File 'lib/rbt/project/project.rb', line 58

def project_dir?
  RBT.project_base_dir?
end

#rbt_version?Boolean

#

rbt_version?

#

Returns:

  • (Boolean)


45
46
47
# File 'lib/rbt/version/version.rb', line 45

def rbt_version?
  RBT.version?
end

#rbt_yaml_directory?Boolean Also known as: cookbooks_yaml_directory?

#

rbt_yaml_directory?

#

Returns:

  • (Boolean)


76
77
78
# File 'lib/rbt/project/project.rb', line 76

def rbt_yaml_directory?
  self.project_yaml_directory?
end

#registered_cookbook_entries?Boolean

#

registered_cookbook_entries?

Just a pointer to the module-method with the same name.

#

Returns:

  • (Boolean)


937
938
939
# File 'lib/rbt/constants/constants.rb', line 937

def registered_cookbook_entries?
  RBT.registered_cookbook_entries?
end

#return_chained_programsObject

#

return_chained_programs

#


709
710
711
# File 'lib/rbt/constants/constants.rb', line 709

def return_chained_programs
  RBT.chained_programs?
end

#sdir(i = '') ⇒ Object

#

sdir

#


205
206
207
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 205

def sdir(i = '')
  RBT.sdir(i)
end

#sfancy(i = '') ⇒ Object

#

sfancy

#


169
170
171
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 169

def sfancy(i = '')
  RBT.sfancy(i)
end

#sfile(i = '') ⇒ Object

#

sfile

#


132
133
134
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 132

def sfile(i = '')
  RBT.sfile(i)
end

#simp(i = '') ⇒ Object

#

simp

#


198
199
200
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 198

def simp(i = '')
  RBT.simp(i)
end

#swarn(i = '') ⇒ Object

#

swarn

#


97
98
99
# File 'lib/rbt/colours/rev_simp_sdir_sfancy_sfile_and_swarn.rb', line 97

def swarn(i = '')
  RBT.swarn(i)
end

#toplevel_methods?Boolean

#

toplevel_methods?

#

Returns:

  • (Boolean)


586
587
588
# File 'lib/rbt/constants/constants.rb', line 586

def toplevel_methods?
  RBT.toplevel_methods?
end

#utility_scripts?Boolean

#

utility_scripts

#

Returns:

  • (Boolean)


976
977
978
# File 'lib/rbt/constants/constants.rb', line 976

def utility_scripts?
  RBT.utility_scripts?
end

#validation_scripts?Boolean

#

validation_scripts

#

Returns:

  • (Boolean)


541
542
543
# File 'lib/rbt/constants/constants.rb', line 541

def validation_scripts?
  RBT.validation_scripts?
end