class RBT::SimplifyRootEntries
Public Class Methods
[](i = ARGV)
click to toggle source
new( commandline_arguments = nil, run_already = true )
click to toggle source
Public Instance Methods
reset()
click to toggle source
run()
click to toggle source
work_on_input_file()
click to toggle source
#¶ ↑
work_on_input_file
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/simplify_root_entries.rb, line 49 def work_on_input_file _ = first_argument? if _ and File.file?(_) save_the_file = false dataset = File.readlines(_) index = 0 dataset.map! {|line| index += 1 if line.include? 'root:root' save_the_file = true line.gsub!(/root:root/, '0:0') opne "At line #{steelblue(index)} a root:root entry "\ "has been replaced with 0:0." end line } if save_the_file into = _ opne "Now saving the modified dataset into `#{sfile(into)}`." what = dataset.join write_what_into(what, into) end end end