Last active
December 17, 2015 00:39
-
-
Save abinoam/5522530 to your computer and use it in GitHub Desktop.
append_data_to_daily_files - Ruby Talk
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
def append_data_to_daily_files | |
Dir.entries('A').each do |file| | |
next unless file.match(/today/i) | |
File.open(File.join("A",file), 'a') do |file| | |
file.puts("hello") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated the line to the tip from Hassan Schroeder [email protected]
Now it reads
next unless file.match(/today/i)