class RBT::QueryHeaderToPackage
Constants
- HASH_ALL_REGISTERED_HEADERS
Public Class Methods
[](i = '')
click to toggle source
new( commandline_arguments = ARGV, run_already = true )
click to toggle source
Public Instance Methods
obtain_all_headers()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::LeanPrototype#reset
# File lib/rbt/utility_scripts/query_header_to_package.rb, line 70 def reset super() infer_the_namespace # ======================================================================= # # === @show_all_header_files # ======================================================================= # @show_all_header_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. set_commandline_arguments # Invoke it here because it is a bit different to regular @commandline_arguments. 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_header_to_package.rb, line 99 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/include/' 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_header_to_package.rb, line 204 def show_help opne 'The following options are available:' e e ' --unassigned # Show entries without an attribute as well.' e ' --filter_for=xextproto # Show only .h files belonging to '\ 'this program (e. g. xextproto in this example)' e end
target_directory?()
click to toggle source
#¶ ↑
target_directory?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/query_header_to_package.rb, line 120 def target_directory? @target_directory end
Also aliased as: target?
try_to_process_the_available_headers()
click to toggle source
#¶ ↑
try_to_process_the_available_headers
¶ ↑
We work through the discovered .h files.
#¶ ↑
# File lib/rbt/utility_scripts/query_header_to_package.rb, line 170 def try_to_process_the_available_headers ljust_value = 55 if @filter_for end if @array_headers.empty? opne 'No headers were found.' else @array_headers.each {|this_header| _ = this_header.sub(/\/usr\/include\//,'') # =================================================================== # # Query the big Hash next that includes all our .h files. # =================================================================== # if HASH_ALL_REGISTERED_HEADERS.has_key? _ this_program = HASH_ALL_REGISTERED_HEADERS[_] if @filter_for and (@filter_for != this_program) # Filter for a specific program in this case. else e 'The header '+sfancy(this_header.ljust(ljust_value))+' belongs to '\ 'the program called `'+orange(this_program)+'`.' end else if @show_all_header_files e 'The header '+sfancy(this_header.ljust(ljust_value))+' is currently '\ 'unassigned. (An orphan header).' end end } end end