class RBT::CompileStrategies
Public Class Methods
[](i = ARGV)
click to toggle source
Public Instance Methods
colour_on_the_left_hand_side(i)
click to toggle source
determine_how_many_programs_are_registered()
click to toggle source
input?()
click to toggle source
load_dataset_from_the_expanded_data()
click to toggle source
#¶ ↑
load_dataset_from_the_expanded_data
¶ ↑
#¶ ↑
# File lib/rbt/statistics/compile_strategies.rb, line 229 def load_dataset_from_the_expanded_data reset_the_main_hash _ = RBT.directory_expanded_cookbooks? # ======================================================================= # # Load all files from the expanded cookbooks dataset next: # ======================================================================= # all_files = Dir["#{_}*.yml"] if all_files.size < n_programs_are_available? # ===================================================================== # # And do a little-error check next, as revealed on June 2022. # ===================================================================== # e tomato('Note: not all programs seem to contain an expanded dataset.') e tomato('Consider running "')+steelblue('rbt --expand')+ tomato('" to generate the expanded dataset.') end all_files.each {|this_file| dataset_from_the_yaml_file = load_yaml(this_file) name_of_the_program = File.basename(this_file).sub(/\.yml$/,'') hash = {} hash[name_of_the_program] = dataset_from_the_yaml_file @hash.update(hash) } determine_how_many_programs_are_registered end
n_programs_are_registered?()
click to toggle source
#¶ ↑
n_programs_are_registered?¶ ↑
#¶ ↑
# File lib/rbt/statistics/compile_strategies.rb, line 104 def n_programs_are_registered? @n_programs_are_registered end
Also aliased as: n_total_programs?
n_programs_depend_on( a = 'cmake', b = cmake_deps )
click to toggle source
#¶ ↑
n_programs_depend_¶ ↑
# ¶ ↑
# File lib/rbt/statistics/compile_strategies.rb, line 111 def n_programs_depend_on( a = 'cmake', b = cmake_deps ) @n_programs_are_assumed_to_be_run_via_makefiles -= b.keys.size n_percent = ( b.keys.size * 100.0 / @n_programs_are_registered ).round(1).to_s.rjust(4)+'%' # Next append the number: n_percent << ' ('+b.keys.size.to_s.rjust(4)+' / '+n_total_programs?.to_s+')' colourized_n_percent = mediumseagreen(n_percent) e "#{colour_on_the_left_hand_side(b.keys.size.to_s.rjust(3))} programs "\ "depend on #{royalblue((a+'.').ljust(7))} #{colourized_n_percent}" end
report()
click to toggle source
#¶ ↑
report (report tag)¶ ↑
#¶ ↑
# File lib/rbt/statistics/compile_strategies.rb, line 136 def report _ = @hash # ======================================================================= # # Seed the variable @n_programs_are_assumed_to_be_run_via_makefiles # with an initial value, which will lateron be decremented accordingly. # ======================================================================= # @n_programs_are_assumed_to_be_run_via_makefiles = @n_programs_are_registered check_for_this_value = :required_deps_on cmake_deps = _.select {|key, inner_value| array_required_deps_on = inner_value[check_for_this_value] array_required_deps_on and array_required_deps_on.include?('cmake') } python_deps = _.select {|key, inner_value| array_required_deps_on = inner_value[check_for_this_value] array_required_deps_on and array_required_deps_on.include?('python') } meson_deps = _.select {|key, inner_value| array_required_deps_on = inner_value[check_for_this_value] array_required_deps_on and array_required_deps_on.include?('meson') } ruby_deps = _.select {|key, inner_value| array_required_deps_on = inner_value[check_for_this_value] array_required_deps_on and array_required_deps_on.include?('ruby') } perl_deps = _.select {|key, inner_value| array_required_deps_on = inner_value[check_for_this_value] array_required_deps_on and array_required_deps_on.include?('perl') } scons_deps = _.select {|key, inner_value| array_required_deps_on = inner_value[check_for_this_value] array_required_deps_on and array_required_deps_on.include?('scons') } waf_deps = _.select {|key, inner_value| array_required_deps_on = inner_value[check_for_this_value] array_required_deps_on and array_required_deps_on.include?('waf') } e report_how_many_programs_are_registered_in_total e # ======================================================================= # # === cmake # ======================================================================= # n_programs_depend_on('cmake', cmake_deps) # ======================================================================= # # === ruby # ======================================================================= # n_programs_depend_on('ruby', ruby_deps) # ======================================================================= # # === python # ======================================================================= # n_programs_depend_on('python', python_deps) # ======================================================================= # # === meson # ======================================================================= # n_programs_depend_on('meson', meson_deps) # ======================================================================= # # === perl # ======================================================================= # n_programs_depend_on('perl', perl_deps) # ======================================================================= # # === scons # ======================================================================= # n_programs_depend_on('scons', scons_deps) # ======================================================================= # # === waf # ======================================================================= # n_programs_depend_on('waf', waf_deps) e slateblue('---') e colour_on_the_left_hand_side( @n_programs_are_registered - @n_programs_are_assumed_to_be_run_via_makefiles )+' programs make use of any of the above '+skyblue('^^^')+ ' compile-time strategies.' e e "#{sfancy(@n_programs_are_assumed_to_be_run_via_makefiles.to_s)} programs"\ " are assumed to be compiled through #{orange('make')} (and possibly" e ' '+lightsalmon('GNU autoconfigure')+ '). Note that meson depends on python,' e ' so strictly speaking, the meson-dependencies overlap' e ' with the python-dependencies.' e end
report_how_many_programs_are_registered_in_total()
click to toggle source
#¶ ↑
report_how_many_programs_are_registered_in_total
¶ ↑
#¶ ↑
# File lib/rbt/statistics/compile_strategies.rb, line 221 def report_how_many_programs_are_registered_in_total e "There are a total of #{springgreen(@n_programs_are_registered)} "\ "registered programs in the #{royalblue('RBT project')}." end
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/statistics/compile_strategies.rb, line 43 def reset super() infer_the_namespace # ======================================================================= # # === @hash # ======================================================================= # @hash = {} # ======================================================================= # # === @n_programs_are_assumed_to_be_run_via_makefiles # ======================================================================= # @n_programs_are_assumed_to_be_run_via_makefiles = 0 # ======================================================================= # # Remember if you need to know the amount of programs, within this # class the variable @n_programs_are_registered keeps track of this. # ======================================================================= # end
reset_the_main_hash()
click to toggle source
run()
click to toggle source
set_input(i = '')
click to toggle source