class RBT::Cookbooks::GobolinuxRecipesComparer
Constants
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
- REMOTE_RECIPES_HOMEPAGE
#¶ ↑
REMOTE_RECIPES_HOMEPAGE
¶ ↑#¶ ↑
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/rbt/utility_scripts/gobolinux_recipes_comparer.rb, line 94 def iterate_over_the_results @scanned_results.each_with_index {|line, index| index += 1 if line.include? '&ver=' splitted = line.split('&ver=') program_name = splitted.first.downcase program_version = splitted.last if program_version.include?('-r') and program_version =~ /\d+$/ # End with a regex. end_position = (program_version.index('-r')-1) program_version = program_version[0 .. end_position] end e e orange(index) e if does_include?(program_name, :do_not_use_aliases) opnn; e 'The program '+sfancy(program_name)+' is included.' opnn; e 'The remote program version is '+simp(program_version)+'.' local_program_version = RBT.swift_return_version_of_this_program(program_name) opnn; e 'The local program version is '+simp(local_program_version)+'.' a = gem_version(local_program_version) b = gem_version(program_version) if a and b if a < b opnn; e 'The remote version appears to be more up to date than' opnn; e 'the local version. This means that you could update.' end else e 'Something went wrong with local version ('+sfancy(local_program_version)+ ') and program version ('+sfancy(program_version)+').' end else opnn; e 'The program '+sfancy(program_name)+' is NOT included.' end e end } end
read_in_dataset_from_the_remote_webpage()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
scan_for_remote_versions()
click to toggle source
#¶ ↑
scan_for_remote_versions
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/gobolinux_recipes_comparer.rb, line 79 def scan_for_remote_versions use_this_regex = /<tr><td>\s*<a class='RecipeTitle' href='\?list=(.+?)'>/ # See: http://rubular.com/r/a3dgeZ3gb1 @scanned_results = @dataset.scan(use_this_regex).flatten end