class RBT::PurgeHeadersOfThisProgram

Public Class Methods

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

RBT::PurgeHeadersOfThisProgram[]

#
# File lib/rbt/utility_scripts/purge_headers_of_this_program.rb, line 75
def self.[](i = ARGV)
  new(i)
end
new( i = ARGV, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/purge_headers_of_this_program.rb, line 31
def initialize(
    i           = ARGV,
    run_already = true
  )
  reset
  set_commandline_arguments(i)
  run if run_already
end

Public Instance Methods

reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::LeanPrototype#reset
# File lib/rbt/utility_scripts/purge_headers_of_this_program.rb, line 43
def reset
  super()
  infer_the_namespace
  # ======================================================================= #
  # === @target_base_directory
  # ======================================================================= #
  @target_base_directory = '/usr/include/'
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/purge_headers_of_this_program.rb, line 55
def run
  @cookbook = action(:SanitizeCookbook, first_argument?) { :fast }
  all_headers = @cookbook.headers? # <- Obtain all registered headers.
  opne 'This program has the following headers registered:'
  e
  all_headers.each {|entry| e "  - #{entry}" }
  e
  unless all_headers.empty?
    all_headers.each {|file|
      target = "#{@target_base_directory}#{File.basename(file)}"
      if File.exist?(target) and File.file?(target)
        opnn; remove_file(target, :be_verbose)
      end
    }
  end
end