Class | File |
In: |
lib/rscm/line_editor.rb
|
Parent: | Object |
# File lib/rscm/line_editor.rb, line 35 35: def File.comment_out(path, line_regex, comment_template) 36: temp_file = Tempfile.new(File.basename(path)) 37: temp_file_path = temp_file.path 38: original = File.new(path) 39: RSCM::LineEditor.comment_out(original, line_regex, comment_template, temp_file) 40: 41: temp_file.close 42: original.close 43: 44: File.copy(temp_file_path, path) 45: end