Here is my code sample, let me know if it can be further improved?
excludedb = if File.exist?(arg)
IO.read(arg).split(',').map { |db_name| db_name.strip }.delete_if { |db_name| db_name == "" }
else
["master", "model", "sybsystemdb", "sybsystemprocs", "tempdb", "sybsecurity", "pubs2", "pubs3", "dbccdb", "sybmgmtdb"]
end
Here’s a couple of tiny improvements.
You can replace
with
And also you can use string array literal