class RBT::Cookbooks::ShowDependenciesOf
Public Class Methods
Public Instance Methods
gather_all_unique_dependencies_for(i)
click to toggle source
#¶ ↑
gather_all_unique_dependencies_for
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/show_dependencies_of.rb, line 128 def gather_all_unique_dependencies_for(i) i = sanitize_this_array(i) @array_all_dependencies << i # ======================================================================= # # Next add more to that Array. # ======================================================================= # i.each {|entry| _ = RBT::Cookbooks::SanitizeCookbook.new(entry) { :fast } deps = _.required_deps_on? if deps # Must catch stray nils. @array_all_dependencies << sanitize_this_array(deps) @array_all_dependencies.flatten! @array_all_dependencies.uniq! end } end
program?()
click to toggle source
report( i = @array_all_dependencies )
click to toggle source
#¶ ↑
report¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/show_dependencies_of.rb, line 111 def report( i = @array_all_dependencies ) e "All gathered dependencies of `#{sfancy(program?.to_s)}` are:" e i.each_with_index {|entry, index| index += 1 padded_index = royalblue( ("(#{index})").rjust(5) ) e " #{padded_index} #{steelblue(entry)}" } e end
report_these_dependencies(deps)
click to toggle source
#¶ ↑
report_these_dependencies
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/show_dependencies_of.rb, line 74 def report_these_dependencies(deps) if deps.empty? opne "No dependencies have been found "\ "for `#{sfancy(program?.to_s)}`." else opne 'The (direct) dependencies of `'+sfancy(program?.to_s)+'` are:' e deps.each_with_index {|entry, index| index += 1 index = index.to_s.rjust(deps.size.to_s.size) index = slateblue(index.to_s) e " (#{index.to_s}) #{steelblue(entry)}" }; e end end
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/utility_scripts/show_dependencies_of.rb, line 45 def reset super() infer_the_namespace # ======================================================================= # # === @array_all_dependencies # ======================================================================= # @array_all_dependencies = [] end
run()
click to toggle source
#¶ ↑
run¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/show_dependencies_of.rb, line 148 def run _ = RBT::Cookbooks::SanitizeCookbook.new(program?) { :fast } deps = _.required_deps_on? # This will be an array. report_these_dependencies(deps) gather_all_unique_dependencies_for(deps) sort_the_big_array report end
sanitize_this_array(i)
click to toggle source
set_of_this_program(of_this_program)
click to toggle source