class RBT::Libtool::RemoveLibtoolFiles

Constants

NAMESPACE
#

NAMESPACE

#

Public Class Methods

from(this_directory) click to toggle source
#

RBT::RemoveLibtoolFiles.from

#
# File lib/rbt/libtool/remove_libtool_files.rb, line 117
def self.from(this_directory)
  RBT::Libtool::RemoveLibtoolFiles.new(this_directory)
end
new( from_this_directory = return_pwd, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/libtool/remove_libtool_files.rb, line 34
def initialize(
    from_this_directory = return_pwd,
    run_already         = true
  )
  set_use_this_directory(
    from_this_directory
  )
  reset
  run if run_already
end

Public Instance Methods

determine_which_libtool_files_are_to_be_purged() click to toggle source
#

determine_which_libtool_files_are_to_be_purged

#
# File lib/rbt/libtool/remove_libtool_files.rb, line 77
def determine_which_libtool_files_are_to_be_purged
  @all_libtool_files = Dir["#{@use_this_directory}*.la"]
end
prefix_to_the_libtool_files?()
Alias for: use_this_directory?
reset() click to toggle source
#

reset

#
Calls superclass method RBT::Base#reset
# File lib/rbt/libtool/remove_libtool_files.rb, line 48
def reset
  super()
  @namespace = NAMESPACE
  @all_libtool_files = [] # <- Initialize them to an empty Array.
end
run() click to toggle source
#

run

#
# File lib/rbt/libtool/remove_libtool_files.rb, line 109
def run
  determine_which_libtool_files_are_to_be_purged
  try_to_purge_the_libtool_files
end
set_use_this_directory(i) click to toggle source
#

set_use_this_directory

This setter defines which directory we will be using.

#
# File lib/rbt/libtool/remove_libtool_files.rb, line 59
def set_use_this_directory(i)
  i = i.first if i.is_a? Array
  i = i.to_s.dup
  i = return_pwd if i.empty? # <- Use a sane default here.
  i << '/' unless i.end_with? '/'
  @use_this_directory = i
end
try_to_purge_the_libtool_files() click to toggle source
#

try_to_purge_the_libtool_files

#
# File lib/rbt/libtool/remove_libtool_files.rb, line 84
def try_to_purge_the_libtool_files
  # ======================================================================= #
  # If we have found at the least one .la file, delete it/them.
  # ======================================================================= #
  all_libtool_files = @all_libtool_files
  unless all_libtool_files.empty?
    result = powderblue(all_libtool_files.size.to_s)+' .la file'
    result << 's' if all_libtool_files.size > 1
    if all_libtool_files.size > 1
      result << ' were'
    else
      result << ' was'
    end
    result << " found at `#{sdir(prefix_to_the_libtool_files?)}`."
    opnn; e result
    opnn; e "The configure flag #{royalblue('delete_libtool_files')}"\
            " has been set to true, so"
    opnn; e 'these '+slateblue('.la files')+' will be removed next.'
    remove_these_files(all_libtool_files)
  end
end
use_this_directory?() click to toggle source
#

use_this_directory?

#
# File lib/rbt/libtool/remove_libtool_files.rb, line 70
def use_this_directory?
  @use_this_directory
end
Also aliased as: prefix_to_the_libtool_files?