class Cookbooks::CheckForMateDesktopUpdates
Constants
- NAMESPACE
#¶ ↑
NAMESPACE¶ ↑
#¶ ↑
- REMOTE_DOWNLOAD_URL
#¶ ↑
REMOTE_DOWNLOAD_URL¶ ↑
#¶ ↑
- REMOTE_URL
#¶ ↑
REMOTE_URL¶ ↑
#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
Public Instance Methods
decide_what_to_do_next()
click to toggle source
#¶ ↑
#decide_what_to_do_next¶ ↑
The first variant can be invoked via:
update_mate_components --size
#¶ ↑
# File lib/cookbooks/check_for_updates/check_for_mate_desktop_updates.rb, line 144 def decide_what_to_do_next if commandline_size_query_was_issued? opnn; e "There are #{sfancy(@scanned_results.size)} remote "\ "mate-desktop related programs." else # else, enter the default "modus operandi". iterate_through_the_results_and_update_old_cookbooks_entries end end
iterate_through_the_results_and_update_old_cookbooks_entries()
click to toggle source
#¶ ↑
#iterate_through_the_results_and_update_old_cookbooks_entries¶ ↑
#¶ ↑
# File lib/cookbooks/check_for_updates/check_for_mate_desktop_updates.rb, line 76 def iterate_through_the_results_and_update_old_cookbooks_entries unless Cookbooks.const_defined? :Cookbook require 'cookbooks/class/class.rb' end _ = @scanned_results n_programs_to_show = 12 opnn; e 'We will show at maximum '+sfancy(n_programs_to_show.to_s)+ ' programs related to mate-desktop.' _ = _[0, n_programs_to_show] _.each {|this_program| # <- That variable is e. g. 'plasma-vault-5.11.0' name_of_the_program, program_version = ::ProgramInformation.return_array_program_name_and_program_version(this_program) # ===================================================================== # # Next, we must compare it to the local dataset. # ===================================================================== # local_dataset = ::Cookbooks::Cookbook.new(name_of_the_program) { :bypass_menu } local_program_version = local_dataset.program_version? if local_program_version < program_version # =================================================================== # # In this case, we have to updated. # =================================================================== # @downloaded_n_programs += 1 opnn; e "There is a more recent program version "\ "available for `#{sfancy(name_of_the_program)}`." full_remote_url = "#{remote_download_url?}#{this_program}.tar.xz" opnn; e 'That remote URL should be at: '+ sfancy(full_remote_url) colourized_result = slateblue( "class Cookbooks::UpdateEntry.new(#{full_remote_url})" ) opnn; e "Now delegating towards #{colourized_result}." Cookbooks::UpdateEntry.new(full_remote_url) { :do_not_ftp_upload } end } if @downloaded_n_programs == 0 opnn; e 'No downloads occurred. This usually means that all '\ 'local programs are up to date!' end end
main_url?()
click to toggle source
opnn()
click to toggle source
remote_download_url?()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
scan_for_all_results()
click to toggle source
#¶ ↑
#scan_for_all_results¶ ↑
#¶ ↑
# File lib/cookbooks/check_for_updates/check_for_mate_desktop_updates.rb, line 126 def scan_for_all_results # ======================================================================= # # See this entry for the following regex: # http://rubular.com/r/bkXyapmXZb # ======================================================================= # use_this_regex = /<a href="(.+.tar.xz)">/ @scanned_results = @dataset.scan(use_this_regex).flatten.map {|entry| entry.sub(/\.tar\.xz$/,'') } end