class RBT::PackageRbtScripts
Constants
- ARCHIVES_BASE_DIRECTORY
#¶ ↑
ARCHIVES_BASE_DIRECTORY
¶ ↑#¶ ↑
- NAME_OF_THE_PROJECT
#¶ ↑
NAME_OF_THE_PROJECT
¶ ↑#¶ ↑
Public Class Methods
Public Instance Methods
archive_dir?()
click to toggle source
ensure_that_the_archive_directory_exists()
click to toggle source
report_where_the_archive_dir_will_be()
click to toggle source
#¶ ↑
report_where_the_archive_dir_will_be
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/package_rbt_scripts.rb, line 67 def report_where_the_archive_dir_will_be archive_dir = ARCHIVES_BASE_DIRECTORY+'rbt-'+return_date set_archive_dir(archive_dir) opne 'The archive directory will be stored '\ 'at `'+sdir(@archive_dir)+'`.' end
reset()
click to toggle source
run()
click to toggle source
run_everything()
click to toggle source
#¶ ↑
run_everything
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/package_rbt_scripts.rb, line 93 def run_everything require 'roebe/toplevel_methods/copy_setup_rb_file.rb' ensure_that_the_archive_directory_exists # The archive dir must exist. report_where_the_archive_dir_will_be _ = RUBY_SRC_DIR rbt_base_dir = _+'rbt/' # Keep a trailing / here. # ======================================================================= # # Now it is time to (1) delete an old archive directory, and then to # (2) create the archive directory. # ======================================================================= # remove_directory(archive_dir?) if Dir.exist? archive_dir? opnn; create_directory(archive_dir?, :be_verbose) # ======================================================================= # # The next step is to enter the RBT base directory. # ======================================================================= # change_directory(rbt_base_dir, :be_verbose) opne "We are now in the directory `#{sdir(return_pwd)}`." opne 'Will copy '+sdir(rbt_base_dir)+' into the directory ' opne sdir(' '+archive_dir?) # ======================================================================= # # Copy recursively next. # ======================================================================= # copy_recursively(rbt_base_dir, archive_dir?) # ======================================================================= # # Ok, we have created the target directory, and a pointer to the # old directory. Next, we copy setup.rb but only into the newly # created file. # ======================================================================= # Roebe.copy_setup_rb_file # ======================================================================= # # Next, change to the dir below archive_dir?. # ======================================================================= # cd File.dirname(archive_dir?) # ======================================================================= # # Remove setup.rb first. No longer necessary I think. # ======================================================================= # # remove(archive_dir?+'setup.rb') # ======================================================================= # # === Package it up via ToTarXt # # We will delegate towards class ToTarXz for the packaging. # ======================================================================= # # new_dir_name is now the new name of the directory. _ = File.basename(archive_dir?) result = ToTarXz.new(_){ :be_verbose }.location?.dup set_archive_dir log_dir?.dup # Reassign here. opne 'Now moving '+sfancy(result)+' to '+sdir(archive_dir?) move_file(result, archive_dir?) opne 'Finished packaging up the '+orange('RBT Scripts')+ ' from ' e sdir(" #{rbt_base_dir}")+' into ' target = archive_dir?+File.basename(result).dup target << '.tar.xz' unless target.end_with?('.tar.xz') edir " #{target}" end