C
Corey
I'd like to make the following code more terse... i.e. more expressive w/ less
lines:
if free || os
if line =~ new_re
cvs(host)
host, free, os = nil
next
end
end
I'm looking for something more along the lines of:
( line =~ new_re && do { cvs(host); host, free, os = nil; next } )
if free || os
But of course that's giving me plenty of errors...
What would the ruby idiom for the above be?
( I'm coming from perl... so I'm still thinking in perl unfortunately )
Many thanks!
lines:
if free || os
if line =~ new_re
cvs(host)
host, free, os = nil
next
end
end
I'm looking for something more along the lines of:
( line =~ new_re && do { cvs(host); host, free, os = nil; next } )
if free || os
But of course that's giving me plenty of errors...
What would the ruby idiom for the above be?
( I'm coming from perl... so I'm still thinking in perl unfortunately )
Many thanks!