class RBT::Linux::ParseBlfsWebpage
Constants
- DEFAULT_FILE
#¶ ↑
DEFAULT_FILE
¶ ↑#¶ ↑
Public Class Methods
[](i = ARGV)
click to toggle source
new( commandline_arguments = nil, run_already = true ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/rbt/linux/lfs/parse_blfs_webpage.rb, line 45 def initialize( commandline_arguments = nil, run_already = true ) reset set_commandline_arguments( commandline_arguments ) if block_given? case yield when :do_report @shall_we_report = true end end run if run_already end
Public Instance Methods
apply_nokogiri()
click to toggle source
report( i = @dataset_after_having_applied_the_regex )
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/linux/lfs/parse_blfs_webpage.rb, line 65 def reset super() infer_the_namespace # ======================================================================= # # === @dataset_after_having_applied_the_regex # ======================================================================= # @dataset_after_having_applied_the_regex = [] # ======================================================================= # # === @shall_we_report # ======================================================================= # @shall_we_report = false end
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/linux/lfs/parse_blfs_webpage.rb, line 146 def run first = first_argument? if first.nil? opne 'Please provide a page here.' end # ======================================================================= # # First: handle locally existing files: # ======================================================================= # if first and File.exist?(first) @dataset = File.read(first, encoding: 'iso-8859-1') elsif first and first.is_a?(String) @dataset = first else opne 'No file could be found. Please provide valid input.' end if @dataset try_to_simplify_the_dataset apply_nokogiri end report if @shall_we_report end
set_commandline_arguments(i = :default)
click to toggle source
shell_instructions?()
click to toggle source
#¶ ↑
shell_instructions?¶ ↑
#¶ ↑
# File lib/rbt/linux/lfs/parse_blfs_webpage.rb, line 106 def shell_instructions? @dataset_after_having_applied_the_regex end
Also aliased as: commands?, shell_commands?, commands?, shell_commands?
try_to_simplify_the_dataset()
click to toggle source
#¶ ↑
try_to_simplify_the_dataset
¶ ↑
#¶ ↑
# File lib/rbt/linux/lfs/parse_blfs_webpage.rb, line 129 def try_to_simplify_the_dataset # ======================================================================= # # Simplify the dataset next: # ======================================================================= # if @dataset.include? '<div class="commands"' # ===================================================================== # # This is to exclude the explanation for the commands: # ===================================================================== # @dataset = @dataset[ 0 .. @dataset.index('<div class="commands"') ] end end