class RBT::Cookbooks::ReportTheseProgramsCouldBeUpdated
Constants
- REGEX_FOR_DISTROWATCH_PROGRAMS
#¶ ↑
REGEX_FOR_DISTROWATCH_PROGRAMS
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
new( commandline_arguments = nil, run_already = true )
click to toggle source
Public Instance Methods
check_entries_on_distrowatch()
click to toggle source
#¶ ↑
check_entries_on_distrowatch
¶ ↑
#¶ ↑
# File lib/rbt/check_for_updates/report_these_programs_could_be_updated.rb, line 65 def check_entries_on_distrowatch use_this_regex = REGEX_FOR_DISTROWATCH_PROGRAMS e rev+'First checking for new entries at '+yellow(+'distrowatch')+rev+'.' e dataset = URI.openopen(distrowatch_url?).read scanned = dataset.scan(use_this_regex) e 'The following programs were discovered (and reported as new) at distrowatch:' e # ======================================================================= # # Iterate over our Array next: # ======================================================================= # scanned.each {|this_program, this_version| is_it_registered_locally_or_not = false if RBT.does_include?(this_program.downcase.delete('-_')) is_it_registered_locally_or_not = true end append_version_information_string = ''.dup verbose_truth_is_it_registered_locally_or_not = verbose_truth( is_it_registered_locally_or_not ) if verbose_truth_is_it_registered_locally_or_not.include? 'No' verbose_truth_is_it_registered_locally_or_not = verbose_truth_is_it_registered_locally_or_not.dup verbose_truth_is_it_registered_locally_or_not.sub!( /No/, crimson('No') ) verbose_truth_is_it_registered_locally_or_not = verbose_truth_is_it_registered_locally_or_not.delete('.')+cadetblue('. ') else # =================================================================== # # In this case the program is registered locally. Determine the # version too, in this case. # =================================================================== # verbose_truth_is_it_registered_locally_or_not = cadetblue( verbose_truth_is_it_registered_locally_or_not ) append_version_information_string << darkgreen(' The local version is: ') the_local_version_is_this = RBT.swift_return_version_of_this_program( this_program.downcase.delete('-_').to_sym ).to_s append_version_information_string << limegreen(the_local_version_is_this) if the_local_version_is_this == this_version # All is fine. else unless Gem::Version.new(the_local_version_is_this) > Gem::Version.new(this_version) register_unequal_version_for( this_program.delete('-_').to_sym ) end end end e ' '+ sfancy( this_program.downcase.ljust(25) )+ royalblue(this_version.ljust(8))+' '+ slateblue(' [Is it included locally: ')+ verbose_truth_is_it_registered_locally_or_not+ slateblue(']')+ append_version_information_string # ===================================================================== # # Also report if we could update this next # ===================================================================== # if @array_these_programs_could_be_updated.include?(this_program.delete('-_').to_sym) e crimson(' ^^^ this program is registered '\ 'and could be updated') end } e end
register_unequal_version_for(i)
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Cookbooks::CheckForRemoteWebpages#reset
# File lib/rbt/check_for_updates/report_these_programs_could_be_updated.rb, line 46 def reset super() infer_the_namespace # ======================================================================= # # === @array_these_programs_could_be_updated # ======================================================================= # @array_these_programs_could_be_updated = [] end