Created
October 13, 2014 03:13
-
-
Save vamdt/bc5bba732ce7c897f27f to your computer and use it in GitHub Desktop.
Add module nest to ruby class
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
#!/usr/bin/env ruby | |
module_name = "Api" | |
files = Dir["*.rb"] | |
files.each do |file| | |
data = IO.read(file) | |
data.gsub!("\n", "\n ") | |
new_data = "module #{module_name}\n\n " + data + "\nend" | |
IO.write(file, new_data) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment