Binary logic in "if" directive

Is it possible to combine several conditions in the if directive, like

condition1 AND condition2 OR condition3

?

Or at least just condition1 AND condition2?

Thanks in advance,
Igor K…

Hello!

On Thu, Oct 22, 2009 at 04:04:32PM +0400, Igor K. wrote:

Is it possible to combine several conditions in the if directive, like

condition1 AND condition2 OR condition3

?

Or at least just condition1 AND condition2?

No.

Workaround is to use set + regex checks in if, e.g.

set $blah "$arg_a:$arg_b";

if ($blah ~ ^a:b$) {
    ...
}

Note though that if is evil. Search list archives for details.

Maxim D.

Maxim D. wrote:

Or at least just condition1 AND condition2?

Note though that if is evil. Search list archives for details.

Maxim D.

Thanks! That workaround works ok.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs