F
Frank Church
I have this sequence of commands to write a list of values to a file
f = File.new(configfile, File::CREAT|File::WRONLY, 0700)
header_commands.each {|x| f.puts x }
mysql_commands.each {|x| f.puts x }
dir_commands.each {|x| f.puts x }
scp_commands.each {|x| f.puts x }
Is there a way to do something like
[header_commands, mysql_commands, dir_commands, scp_commands] each {|x|
f.puts x }
I know there must be a number of ruby ways to do it.
Any examples?
- Frank
f = File.new(configfile, File::CREAT|File::WRONLY, 0700)
header_commands.each {|x| f.puts x }
mysql_commands.each {|x| f.puts x }
dir_commands.each {|x| f.puts x }
scp_commands.each {|x| f.puts x }
Is there a way to do something like
[header_commands, mysql_commands, dir_commands, scp_commands] each {|x|
f.puts x }
I know there must be a number of ruby ways to do it.
Any examples?
- Frank