class RBT::QueryBinaryToPackage
Constants
- HASH_ALL_REGISTERED_BINARIES
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
new( commandline_arguments = ARGV, run_already = true )
click to toggle source
Public Instance Methods
commandline_arguments?()
click to toggle source
#¶ ↑
commandline_arguments?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/query_binary_to_package.rb, line 231 def commandline_arguments? @commandline_arguments end
Also aliased as: input?
first_argument?()
click to toggle source
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 79 def reset super() @namespace = NAMESPACE @commandline_arguments = [] # <- Iniitialize it first. @show_all_binary_files = false @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 = Dir.pwd )
click to toggle source
#¶ ↑
set_target_directory
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/query_binary_to_package.rb, line 113 def set_target_directory( i = Dir.pwd ) i = i.first if i.is_a? Array i = Dir.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 219 def show_help opnn; e '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 134 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 184 def try_to_process_the_available_binaries ljust_value = 55 if @filter_for end array = @array_binaries if array.empty? opnn; e '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