class RBT::Cookbooks::RegisteredBinaries
Constants
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
Public Class Methods
location?()
click to toggle source
new( run_already = true )
click to toggle source
opnn()
click to toggle source
search_for_this_program(i)
click to toggle source
Public Instance Methods
opnn()
click to toggle source
report_to_the_user_what_we_will_do()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/registered_binaries.rb, line 155 def run report_to_the_user_what_we_will_do available_programs?.each { |program_name| begin _ = RBT::Cookbooks::Cookbook.new(program_name) { :bypass_menu } binaries = _.binaries? # This is an Array. unless binaries.empty? e program_name if SHOW_PROGRAM_NAME binaries.each {|entry| @hash_to_be_stored[entry] = program_name } end rescue Exception => error opnn; e 'An error happened for the program '+ sfile(program_name)+ '. (Error: '+error.class.to_s+')' pp error end } save_yaml_file end
save_yaml_file()
click to toggle source
#¶ ↑
save_yaml_file
¶ ↑
The method `save_yaml_file` will create the yaml file which lists our binaries (in hash format). Right now, we need to manually update this yaml file on our own.
#¶ ↑
# File lib/rbt/utility_scripts/registered_binaries.rb, line 77 def save_yaml_file into = FILE_REGISTERED_BINARIES what = YAML.dump(hash?) e sfancy('Storing yaml dataset in ') e ' '+sfile(into) write_what_into(what, into) if is_on_roebe? into = "#{RUBY_SRC_DIR_AT_HOME}rbt/lib/rbt/yaml/#{File.basename(into)}" e "Also storing into `#{sfile(into)}`." write_what_into(what, into) end end
Also aliased as: create_yaml_file
search_for_this_program( i = @this_program )
click to toggle source
#¶ ↑
search_for_this_program
¶ ↑
Use this method to search for a specific program.
#¶ ↑
# File lib/rbt/utility_scripts/registered_binaries.rb, line 118 def search_for_this_program( i = @this_program ) i = i.to_s if i.include? '/' i = File.basename(i) opnn; e "The input includes a #{simp('/')} token. We will "\ "truncate this to the" opnn; e 'last part only, as we only keep the names registered, '\ 'not the paths.' opnn; e "Thus, our input will be #{sfancy(i)}." end opnn; e "Searching for `#{sfancy(i)}` now:" # ======================================================================= # # Query whether it is already included or not. # ======================================================================= # if RBT.does_include? i opnn; e "Yes, this appears to be already registered with the "\ "same name #{simp(i)}." program_version = RBT.swift_return_version_of_this_program(i) opnn; e "Its program version is: #{lightblue(program_version)}" else hash = load_yaml(FILE_REGISTERED_BINARIES) if hash.keys.include? i opnn; e "The binary called `#{sfancy(i)}` was found." opnn; e "It is part of the package -> `#{simp(hash[i])}`." else opnn; e sfancy(i)+' is '+swarn('NOT')+' included. We could not '\ 'find any program' opnn; e 'including this program.' end end end