class RBT::ClassesForIndividualPrograms::Gcc::ChangeLib64ToLib
Constants
- DEFAULT_FILE
#¶ ↑
DEFAULT_FILE
¶ ↑This constant specifies the default that is to be used. After all the whole class here was written in order to modify that particular file anyway.
#¶ ↑
- SEEK_THIS_SUBSTRING
#¶ ↑
SEEK_THIS_SUBSTRING
¶ ↑#¶ ↑
Public Class Methods
[](i = ARGV)
click to toggle source
new( commandline_arguments = nil, run_already = true )
click to toggle source
Public Instance Methods
query_whether_an_argument_has_been_given()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/misc/classes_for_individual_programs/change_lib64_to_lib.rb, line 59 def reset super() infer_the_namespace # ======================================================================= # # === @dataset # ======================================================================= # @dataset = nil # <- Initial state. end
return_the_default_regex()
click to toggle source
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/misc/classes_for_individual_programs/change_lib64_to_lib.rb, line 143 def run query_whether_an_argument_has_been_given if first_argument? set_modify_this_file(first_argument?) try_to_read_in_the_main_dataset if @dataset # =================================================================== # # The replacement will only work on 64-bit systems. # =================================================================== # if is_a_64bit_system? if @dataset.include? SEEK_THIS_SUBSTRING use_this_regex = return_the_default_regex opne 'The regex to be applied is: '+steelblue(use_this_regex) @dataset.gsub!(use_this_regex, 'm64=../lib') store_file(@dataset) else opne "The file does not contain the "\ "substring #{steelblue(SEEK_THIS_SUBSTRING)}." end else opne 'Applying the regex replacing m64=../lib only works' opne 'for 64-bit systems.' end end end end
sanitize_commandline_arguments()
click to toggle source
set_commandline_arguments(i = ARGV)
click to toggle source
#¶ ↑
set_commandline_arguments
¶ ↑
#¶ ↑
# File lib/rbt/misc/classes_for_individual_programs/change_lib64_to_lib.rb, line 71 def set_commandline_arguments(i = ARGV) case i when :default i = DEFAULT_FILE end i = [i].flatten.compact if i.empty? and is_on_roebe? # ===================================================================== # # Use a default, hardcoded file path in this event. # ===================================================================== # i << DEFAULT_FILE end internal_hash_set_commandline_arguments(i) sanitize_commandline_arguments end
set_modify_this_file(i)
click to toggle source
store_file( what = @dataset, into = @modify_this_file )
click to toggle source
try_to_read_in_the_main_dataset()
click to toggle source