class YoutubeDlhelper

The main class YoutubeDlhelper

MannsShared Class

Constants

VERSION

@note Version variable

Public Class Methods

search_replace(search, replace, file) click to toggle source

Method for replacing content in a file @param [String] search is the search text in the target file @param [String] replace the replace text @param [String] file Target file like Author_Group.xml @return [String] true or false

# File lib/youtube_dlhelper/change.rb, line 28
def self.search_replace(search, replace, file)
  text = File.read(file)
  new_value = text.gsub(search, replace)
  puts new_value
  File.open(file, 'w') do |file1|
    file1.puts new_value
  end
end