Created
January 17, 2017 15:40
-
-
Save bastjan/5be7a79fcafe210c92ed11424d138074 to your computer and use it in GitHub Desktop.
replace our Hash#dig with ruby2.3 Hash#dig
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
file_names = Dir.glob("**/*.rb") | |
file_names.each do |file_name| | |
content = File.read(file_name) | |
new_content = content.gsub(/\.dig\('([^']+)'\)/) { |function| function.gsub(/(.)\.(.)/, '\1\', \'\2' ) } | |
File.open(file_name, "w") {|file| file.puts new_content } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment