class RBT::ImproveTheCookbookRecipes
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
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/improve_the_cookbook_recipes/improve_the_cookbook_recipes.rb, line 79 def run set_work_on_these_yaml_files( Dir[RUBY_SRC_DIR+'rbt/lib/rbt/yaml/cookbooks/*.yml'] ) found_n_problems = 0 # How many faulty .yml files were found. @work_on_these_yaml_files.each {|entry| dataset = File.read(entry) # Read in the full content of the .yml file here. # ===================================================================== # # === keep_extracted: f # ===================================================================== # if dataset =~ /keep_extracted: f$/ found_n_problems += 1 e 'The file `'+steelblue(entry.to_s)+rev+ '` has a less-than-optimal '\ 'keep_extracted value (of "f").' if is_on_roebe? this_has_been_corrected # copy_file(entry, '/Depot/j/'+File.basename(entry)) data = File.read(entry) data.sub!(/keep_extracted: f/,'keep_extracted: no') e 'Saving into '+sfile(entry)+rev+' next.' write_what_into(data, entry) end end # ===================================================================== # # === keep_extracted: t # ===================================================================== # if dataset =~ /keep_extracted: t$/ found_n_problems += 1 e 'The file `'+steelblue(entry.to_s)+'` has a less-than-optimal '\ 'keep_extracted value (of "t").' if is_on_roebe? this_has_been_corrected data = File.read(entry) data.sub!(/keep_extracted: t/,'keep_extracted: yes') e 'Saving into '+sfile(entry)+rev+' next.' write_what_into(data, entry) end end # ===================================================================== # # === symlink_headers: t # ===================================================================== # if dataset =~ /symlink_headers: t$/ found_n_problems += 1 e 'The file `'+steelblue(entry.to_s)+'` has a less-than-optimal '\ 'symlink_headers value (of "t").' if is_on_roebe? this_has_been_corrected data = File.read(entry) data.sub!(/symlink_headers: t/,'symlink_headers: yes') e 'Saving into '+sfile(entry)+rev+' next.' write_what_into(data, entry) end end # ===================================================================== # # === symlink_pkgconfig_files: t # ===================================================================== # if dataset =~ /symlink_pkgconfig_files: t$/ found_n_problems += 1 e 'The file `'+steelblue(entry.to_s)+'` has a less-than-optimal '\ 'symlink_pkgconfig_files value (of "t").' if is_on_roebe? this_has_been_corrected data = File.read(entry) data.sub!(/symlink_pkgconfig_files: t/,'symlink_pkgconfig_files: yes') e 'Saving into '+sfile(entry)+rev+' next.' write_what_into(data, entry) end end } if found_n_problems == 0 verbose_report_to_the_user_that_no_problem_was_found end end
set_work_on_these_yaml_files(i)
click to toggle source
this_has_been_corrected()
click to toggle source
verbose_report_to_the_user_that_no_problem_was_found()
click to toggle source