class Cookbooks::CheckForRemoteWebpages

Public Instance Methods

commandline?()
commandline_arguments?() click to toggle source
#

commandline_arguments?

#
# File lib/cookbooks/check_for_updates/base.rb, line 57
def commandline_arguments?
  @commandline_arguments
end
Also aliased as: input?, commandline?
commandline_size_query_was_issued?() click to toggle source
#

commandline_size_query_was_issued?

#
# File lib/cookbooks/check_for_updates/base.rb, line 65
def commandline_size_query_was_issued?
  @commandline_arguments.any? {|entry|
    entry.include? 'size'
  }
end
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/cookbooks/check_for_updates/base.rb, line 111
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
does_the_cookbook_include_this_program?(i) click to toggle source
#

does_the_cookbook_include_this_program?

#
# File lib/cookbooks/check_for_updates/base.rb, line 94
def does_the_cookbook_include_this_program?(i)
  ::Cookbooks.does_include?(i)
end
input?()
menu(i) click to toggle source
#

menu (menu tag)

#
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/cookbooks/check_for_updates/base.rb, line 138
def obtain_dataset_from_the_remote_webpage(
    url_to_the_remote_webpage = remote_webpage?
  )
  @dataset = open(url_to_the_remote_webpage).read
end
Also aliased as: obtain_remote_dataset
obtain_remote_dataset( url_to_the_remote_webpage = remote_webpage? )
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/cookbooks/check_for_updates/base.rb, line 128
def report_the_remote_webpage(
    i = remote_webpage?
  )
  opnn; e 'Attempting to obtain data from the remote URL'
  opnn; e "  `#{sfancy(i)}`."
end
reset() click to toggle source
#

reset

#
Calls superclass method Cookbooks::Base#reset
# File lib/cookbooks/check_for_updates/base.rb, line 29
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.
  @commandline_arguments = []
end
return_local_version_of_this_program(i) click to toggle source
#

#return_local_version_of_this_program

#
# File lib/cookbooks/check_for_updates/base.rb, line 87
def return_local_version_of_this_program(i)
  Cookbooks::Cookbook.new(i) { :bypass_menu }.program_version?
end
set_commandline(i = ARGV)
set_commandline_arguments(i = ARGV) click to toggle source
#

#set_commandline_arguments

#
# File lib/cookbooks/check_for_updates/base.rb, line 74
def set_commandline_arguments(i = ARGV)
  unless i.is_a? Array
    i = [i]
  end
  i.flatten!
  i.compact!
  @commandline_arguments = i
end
Also aliased as: set_commandline, set_input
set_input(i = ARGV)