class RBT::CleanupSystemTags
Constants
- BASE_DIR
#¶ ↑
BASE_DIR
¶ ↑#¶ ↑
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
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
consider_puring_and_reporting_non_existing_symlinks_from_the_system()
click to toggle source
#¶ ↑
consider_puring_and_reporting_non_existing_symlinks_from_the_system
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 107 def consider_puring_and_reporting_non_existing_symlinks_from_the_system if @all_entries.empty? if @be_verbose opnn; e "No #{royalblue('stray symlinks')} could be found. This "\ "is good! #{gold('\\o/')}" end else if @be_verbose opnn; e 'The following stray (non-existing) symlinks will '\ 'be removed next:' end @all_entries.each {|this_non_existing_symlink| # =================================================================== # # The next line of code has to be explained. We will here # ALWAYS report when a stray symlink has been found. This # allows us to embed this class into RBT::Compile, and # notify the user when a stray symlink file is deleted. # =================================================================== # if File.symlink?(this_non_existing_symlink) # <- This check is not necessary but I like it. opnn; e 'Now removing the symlink `'+ sfancy(this_non_existing_symlink)+'`.' remove_this_symlink(this_non_existing_symlink) end } end end
reset()
click to toggle source
run()
click to toggle source
select_non_existing_symlinks_from_the_entries()
click to toggle source
#¶ ↑
select_non_existing_symlinks_from_the_entries
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/cleanup_system_tags.rb, line 80 def select_non_existing_symlinks_from_the_entries # ======================================================================= # # We must check for symlinks that exist, which we will do in the # following code: # ======================================================================= # @all_entries.select! {|entry| File.symlink?(entry) and !File.exist?(entry) } end