Created
February 19, 2014 23:46
-
-
Save daveharris/9103994 to your computer and use it in GitHub Desktop.
Add "Module MyModule" to all ruby files
This file contains 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
Dir["**/*.rb"].each do |file| | |
contents = IO.readlines(file) | |
open(file, "w") do |f| | |
f.puts "module MyModule\n" | |
contents.each { |line| f.write " #{line}" } | |
f.puts "\nend" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment