# use a YML file, which has key , value pairs
yml_hosts = YAML::load(File.open('hosts.yml'))
.....
# for each pair
yml_hosts.each_pair {|key_hosts , value_hosts|
......
redirect to a String "value_hosts"
value_hosts << "#{$.} #{line}" if line =~ /recoverable NFE/
Есть ли лучший способ сделать это, так как я использую условие:
if ! value_hosts.empty?
to do an action, like sending email, etc
but value_hosts is never Empty
so i always get an email, even though, i ONLY want top get an email, if
line =~ /recoverable NFE/