Class: YoutubeDlhelper

Inherits:
Object
  • Object
show all
Defined in:
lib/youtube_dlhelper.rb,
lib/youtube_dlhelper/change.rb

Overview

MannsShared Class

Constant Summary collapse

VERSION =
Note:

Version variable

'2.0.3'

Class Method Summary collapse

Class Method Details

.search_replace(search, replace, file) ⇒ String

Method for replacing content in a file


28
29
30
31
32
33
34
35
# 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