class RBT::CleanupSystemTags

Constants

BASE_DIR
#

BASE_DIR

#

Public Class Methods

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

RBT::CleanupSystemTags[]

#
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 137
def self.[](i = ARGV)
  new(i)
end
new( commandline_arguments = nil, run_already = true ) { || ... } click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 31
def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :be_silent
    # ===================================================================== #
    when :be_silent,
         :be_quiet
      set_be_quiet
    end
  end
  run if run_already
end

Public Instance Methods

obtain_all_entries_from_the_system_tags_directory() click to toggle source
#

obtain_all_entries_from_the_system_tags_directory

#
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 81
def obtain_all_entries_from_the_system_tags_directory
  _ = BASE_DIR
  if File.directory? _
    @all_entries = Dir["#{_}**/**"]
  else
    if be_verbose?
      opnn; no_directory_exists_at(_)
    end
  end
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::LeanPrototype#reset
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 56
def reset
  super()
  infer_the_namespace
  # ======================================================================= #
  # === @all_entries
  # ======================================================================= #
  @all_entries = [] # ← Must be empty on startup.
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 128
def run
  obtain_all_entries_from_the_system_tags_directory
  select_non_existing_symlinks_from_the_entries
  consider_puring_and_reporting_non_existing_symlinks_from_the_system
end