class RBT::Cookbooks::CheckForRemoteWebpages
Public Instance Methods
commandline_arguments?()
click to toggle source
#¶ ↑
commandline_arguments?¶ ↑
#¶ ↑
# File lib/rbt/check_for_updates/base.rb, line 65 def commandline_arguments? @commandline_arguments end
Also aliased as: input?, commandline?
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 108 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
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
¶ ↑
#¶ ↑
# File lib/rbt/check_for_updates/base.rb, line 162 def obtain_dataset_from_the_remote_webpage( url_to_the_remote_webpage = remote_webpage? ) begin @dataset = open(url_to_the_remote_webpage).read rescue OpenURI::HTTPError => error opnn; e 'OpenURI::HTTPError was encountered. This usually' opnn; e "happens when the URL is invalid (#{sfancy(url_to_the_remote_webpage)}" opnn; e '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 135 def report_that_these_programs_were_updated(array) unless array.empty? opnn; e "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
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/check_for_updates/base.rb, line 33 def reset super() @dataset = nil # <- Will store the downloaded-dataset (from open-uri). @downloaded_n_programs = 0 # <- Keeps track of how many programs were batch-downloaded. # ======================================================================= # # The next Array can keep track of which programs were updated. # ======================================================================= # @array_these_programs_were_updated = [] @commandline_arguments = [] end
return_local_version_of_this_program(i)
click to toggle source
set_commandline_arguments(i = ARGV)
click to toggle source
#¶ ↑
set_commandline_arguments
¶ ↑
#¶ ↑
# File lib/rbt/check_for_updates/base.rb, line 82 def set_commandline_arguments(i = ARGV) i = [i].flatten.compact @commandline_arguments = i end
Also aliased as: set_commandline, set_input