Created
March 1, 2018 18:03
-
-
Save samanthamjohn/b9e32bf8d2e7c09684878aaa79cb8372 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comment = "# frozen_string_literal: true\n" | |
filemode = "r+" | |
dirs = Dir[Rails.root.join('spec/**/*.rb').to_s] + Dir[Rails.root.join('lib/**/*.rake').to_s] + Dir[Rails.root.join('lib/**/*.rb').to_s] | |
dirs.each do |filename| | |
contents = File.open(filename, "r") do |f| | |
f.read | |
end | |
contents = comment + contents | |
File.open(filename, "w") do |f| | |
f.write contents | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment