class RBT::CleanupSystemTags

Constants

BASE_DIR
#

BASE_DIR

#
NAMESPACE
#

NAMESPACE

#

Public Class Methods

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

[]

#
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 146
def self.[](i = '')
  self.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 34
def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  if block_given?
    yielded = yield
    case yielded
    when :be_silent,
         :be_quiet
      @be_verbose = false
    end
  end
  run if run_already
end

Public Instance Methods

commandline_arguments?() click to toggle source
#

commandline_arguments?

#
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 73
def commandline_arguments?
  @commandline_arguments
end
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 93
def obtain_all_entries_from_the_system_tags_directory
  _ = BASE_DIR
  if File.directory? _
    @all_entries = Dir[_+'**/**']
  else
    if @be_verbose
      opnn; e 'No directory exists at '+sdir(_)+'.'
    end
  end
end
reset() click to toggle source
#

reset (reset tag)

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

run (run tag)

#
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 137
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
set_commandline_arguments(i = '') click to toggle source
#

set_input

#
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 65
def set_commandline_arguments(i = '')
  i = [i].flatten.compact
  @commandline_arguments = i
end