class Cookbooks::CheckForSlackwareUpdates
Constants
- NAMESPACE
#¶ ↑
NAMESPACE¶ ↑
#¶ ↑
- USE_THIS_REGEX_FOR_SLACKWARE
#¶ ↑
USE_THIS_REGEX_FOR_SLACKWARE¶ ↑
See this link: rubular.com/r/XejliI9eeg
#¶ ↑
- USE_THIS_SLACKWARE_SEPARATOR
#¶ ↑
USE_THIS_SLACKWARE_SEPARATOR¶ ↑
#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
Public Instance Methods
input?()
click to toggle source
iterate_over_the_results()
click to toggle source
#¶ ↑
#iterate_over_the_results¶ ↑
#¶ ↑
# File lib/cookbooks/check_for_updates/check_for_slackware_updates.rb, line 122 def iterate_over_the_results n_ljust = 45 # ======================================================================= # # Make use of ProgramInformation next. # ======================================================================= # @scanned_results.each {|this_result| _ = ProgramInformation.new(this_result) real_short_name = _.real_short_name? short_name = _.short_name? remote_version = _.program_version? if does_the_cookbook_include_this_program? real_short_name string = 'The local version of '.dup string << short_name.dup string << ' is: ' string = string.ljust(n_ljust) string.sub!(/(#{short_name.dup})/, sfancy('\\1')) opnn; e string+ simp(return_local_version_of_this_program(short_name)) opnn; e 'The remote version is: '.ljust(n_ljust)+ orange(remote_version) else opnn; e 'Not found a local program called `'+sfancy(this_result)+'`.' end } end
limit_dataset_to_last_separator()
click to toggle source
main_regex?()
click to toggle source
opnn()
click to toggle source
remote_webpage?()
click to toggle source
#¶ ↑
remote_webpage?¶ ↑
#¶ ↑
# File lib/cookbooks/check_for_updates/check_for_slackware_updates.rb, line 51 def remote_webpage? REMOTE_SLACKWARE_HOMEPAGE end
Also aliased as: remote_website?
reset()
click to toggle source
run()
click to toggle source
scan_dataset_for_matches_against_the_regex()
click to toggle source
#¶ ↑
#scan_dataset_for_matches_against_the_regex¶ ↑
#¶ ↑
# File lib/cookbooks/check_for_updates/check_for_slackware_updates.rb, line 88 def scan_dataset_for_matches_against_the_regex @scanned_results = @dataset.scan(main_regex?).flatten # ======================================================================= # # Next, sanitize these results. We will chop off trailing # '-x86_64-1' tokens. 'Keep in mind that we may also have entries # such as 'kernel-headers-4.9.49-x86-1'. # ======================================================================= # @scanned_results.map! {|entry| entry.sub!(/-x86_64-1$/,'') entry.sub!(/-x86-1$/,'') entry.sub!(/-noarch-1$/,'') entry } end