class RBT::PackageRbtScripts
Constants
- ARCHIVES_BASE_DIRECTORY
#¶ ↑
ARCHIVES_BASE_DIRECTORY
¶ ↑#¶ ↑
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
- NAME_OF_THE_PROJECT
#¶ ↑
NAME_OF_THE_PROJECT
¶ ↑#¶ ↑
Public Class Methods
Public Instance Methods
archive_dir?()
click to toggle source
ensure_that_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 69 def report_where_the_archive_dir_will_be archive_dir = ARCHIVES_BASE_DIRECTORY+'rbt-'+return_date set_archive_dir(archive_dir) opnn; e '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 ensure_that_archive_directory_exists # The archive dir must exist. report_where_the_archive_dir_will_be _ = RUBY_SRC_DIR # /Users/x/DATA/PC/PROGRAMMING_LANGUAGES/RUBY/src/ 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. # ======================================================================= # opnn; change_directory(rbt_base_dir, :be_verbose) opnn; e 'We are now in the directory `'+sdir(Dir.pwd)+'`.' opnn; e ' Will copy '+sdir(rbt_base_dir)+' into the directory ' opnn; e 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. opnn; e 'Now moving '+sfancy(result)+' to '+sdir(archive_dir?) move_file(result, archive_dir?) opnn; e 'Finished packaging up the '+orange('RBT Scripts')+ ' from ' e sdir(" #{rbt_base_dir}")+' into ' target = archive_dir?+File.basename(result).dup+'.tar.xz' e sdir(' '+target) end