Skip to content

Instantly share code, notes, and snippets.

@GalenkoEugene
Last active April 3, 2018 07:14
Show Gist options
  • Save GalenkoEugene/ce99f004b7729285eda057936c20e526 to your computer and use it in GitHub Desktop.
Save GalenkoEugene/ce99f004b7729285eda057936c20e526 to your computer and use it in GitHub Desktop.
converts all rhtml files to html.erb
# converts all rhtml files to html.erb
require 'fileutils'
files = `find app/views -name '*.rhtml'`
file_ary = files.split("\n")
file_ary.each do |file|
new_file = file.gsub('rhtml', 'html.erb')
FileUtils.mv file, new_file
end
puts "#{file_ary.length} files converted."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment