class RBT::Cookbooks::CheckForRemoteWebpages
Public Instance Methods
add_these_programs_were_updated(i)
click to toggle source
array_these_programs_were_updated?()
click to toggle source
commandline_size_query_was_issued?()
click to toggle source
correct_for_common_mistakes_in_program_names(i)
click to toggle source
#¶ ↑
correct_for_common_mistakes_in_program_names
¶ ↑
The BLFS folks, but also the slackware folks, use some wrong names.
The following ad-hoc case/when menu will correct some of these wrong names.
The correct name is the one that comes from the official tarball release. So for example, for “gtk+-3.93.0.tar.xz”, the official name is exactly “gtk+” and NOT “gtk+3”, despite the BLFS team thinking otherwise.
#¶ ↑
# File lib/rbt/check_for_updates/base.rb, line 118 def correct_for_common_mistakes_in_program_names(i) case i # case tag, sanitize tag when 'node.js' i = 'node' when 'openjpeg2' i = 'openjpeg' when 'gtk+3' i = 'gtk+' end return i end
dataset?()
click to toggle source
distrowatch_url?()
click to toggle source
do_use_wget()
click to toggle source
ensure_download_mode_is_system_wget_from_now_on()
click to toggle source
notify_the_user_that_no_downloads_have_occurred()
click to toggle source
obtain_dataset_from_the_remote_webpage( url_to_the_remote_webpage = remote_webpage? )
click to toggle source
#¶ ↑
obtain_dataset_from_the_remote_webpage
¶ ↑
The argument to this method can be a String such as “download.kde.org/stable/frameworks/5.102/”.
#¶ ↑
# File lib/rbt/check_for_updates/base.rb, line 223 def obtain_dataset_from_the_remote_webpage( url_to_the_remote_webpage = remote_webpage? ) begin @dataset = URI.open(url_to_the_remote_webpage).read # ======================================================================= # # The next clause will be entered when we encountered some OpenSSL # related problem. # ======================================================================= # rescue OpenSSL::SSL::SSLError => error opne tomato('An error occurred, related to OpenSSL. Perhaps openssl') opne tomato('has not been installed correctly. Either way the') opne tomato('download mode will be changed.') ensure_download_mode_is_system_wget_from_now_on cd log_dir? # We are now in "/home/x/Temp/rbt/". local_file = log_dir?+'index.html' delete_file(local_file) esystem "wget #{url_to_the_remote_webpage}" @dataset = File.read(local_file) rescue OpenURI::HTTPError => error opnn; etomato('OpenURI::HTTPError was encountered. This usually') opnn; etomato("happens when the URL is invalid "\ "(#{sfancy(url_to_the_remote_webpage)}") opnn; etomato('Consider fixing the URL and trying again.') pp error exit end end
Also aliased as: obtain_remote_dataset
obtain_remote_dataset( url_to_the_remote_webpage = remote_webpage? )
Alias for: obtain_dataset_from_the_remote_webpage
report_that_these_programs_were_updated(array)
click to toggle source
#¶ ↑
report_that_these_programs_were_updated
¶ ↑
#¶ ↑
# File lib/rbt/check_for_updates/base.rb, line 133 def report_that_these_programs_were_updated(array) unless array.empty? opne "The following #{simp(array.size.to_s)} programs were updated:" array.each {|this_program| e " #{sfancy(this_program)}" } end end
report_the_remote_webpage( i = remote_webpage? )
click to toggle source
#¶ ↑
report_the_remote_webpage
¶ ↑
Standard method to report the remote webpage in use.
#¶ ↑
# File lib/rbt/check_for_updates/base.rb, line 206 def report_the_remote_webpage( i = remote_webpage? ) opne grey('Attempting to obtain data from the following ')+ lightblue('remote URL')+ (':') e e " #{steelblue(i)}" e end
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/check_for_updates/base.rb, line 30 def reset super() # ======================================================================= # # === @internal_hash # ======================================================================= # @internal_hash = {} # ======================================================================= # # === :use_wget # ======================================================================= # @internal_hash[:use_wget] = false # ======================================================================= # # === :use_this_download_mode # ======================================================================= # @internal_hash[:use_this_download_mode] = :ruby_wrapper_over_wget # ======================================================================= # # === :array_these_programs_were_updated # # The next Array can keep track of which programs were updated. # ======================================================================= # @internal_hash[:array_these_programs_were_updated] = [] # ======================================================================= # # === @dataset # ======================================================================= # @dataset = nil # ← This variable will store the downloaded-dataset (from open-uri). # ======================================================================= # # === @downloaded_n_programs # ======================================================================= # @downloaded_n_programs = 0 # ← Keeps track of how many programs were batch-downloaded. do_use_colours end
return_local_version_of_this_program(i)
click to toggle source
show_help()
click to toggle source
update_entry(full_remote_url)
click to toggle source