class RBT::QueryBinaryToPackage
Constants
- HASH_ALL_REGISTERED_BINARIES
Public Class Methods
[](i = ARGV)
click to toggle source
new( commandline_arguments = ARGV, run_already = true )
click to toggle source
Public Instance Methods
obtain_all_binaries()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/utility_scripts/query_binary_to_package.rb, line 75 def reset super() infer_the_namespace # ======================================================================= # # === @show_all_binary_files # ======================================================================= # @show_all_binary_files = false # ======================================================================= # # === @filter_for # ======================================================================= # @filter_for = nil # Whether to filter for an individual program only. set_target_directory # Must initialize it at the least once. end
run()
click to toggle source
set_commandline_arguments(i = ARGV)
click to toggle source
set_target_directory( i = return_pwd )
click to toggle source
#¶ ↑
set_target_directory
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/query_binary_to_package.rb, line 103 def set_target_directory( i = return_pwd ) i = i.first if i.is_a? Array i = return_pwd if i.nil? i = i.to_s.dup unless i.end_with? '/' i << '/' end if first_argument?.is_a? Symbol case first_argument? when :default i = '/usr/bin/' end end if first_argument? @target_directory = i end
Also aliased as: set_use_this_directory
show_help()
click to toggle source
#¶ ↑
show_help
(help tag)¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/query_binary_to_package.rb, line 209 def show_help opne 'The following options are available:' e e ' --unassigned # Show entries without an attribute as well.' e ' --filter_for=xorgserver # Show only binary files belonging to '\ 'this program (e. g. the xorgserver in this example)' e end
target_directory?()
click to toggle source
#¶ ↑
target_directory?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/query_binary_to_package.rb, line 124 def target_directory? @target_directory end
Also aliased as: target?
try_to_process_the_available_binaries()
click to toggle source
#¶ ↑
try_to_process_the_available_binaries
¶ ↑
We work through the discovered binaries.
#¶ ↑
# File lib/rbt/utility_scripts/query_binary_to_package.rb, line 174 def try_to_process_the_available_binaries ljust_value = 55 if @filter_for end array = @array_binaries if array.empty? opne 'No binaries were found.' else array.each {|this_binary| _ = this_binary.sub(/\/usr\/bin\//,'') # =================================================================== # # Query the big Hash next that includes all our binary files. # =================================================================== # if HASH_ALL_REGISTERED_BINARIES.has_key? _ this_program = HASH_ALL_REGISTERED_BINARIES[_] if @filter_for and (@filter_for != this_program) # Filter for a specific program in this case. else e 'The binary '+sfancy(this_binary.ljust(ljust_value))+' belongs to '\ 'the program called `'+orange(this_program)+'`.' end else if @show_all_binary_files e 'The binary '+sfancy(this_header.ljust(ljust_value))+' is currently '\ 'unassigned. (An orphan binary).' end end } end end