Weird behaviour of and operator in ruby block of cookbook template file

Hello guys,

I have defined following Ruby if statement in one of my cookbook template file:

    if [ "$PHP_VERSION" == "System_Default" ]; then
            <% if node['platform'] == 'debian' and node[:platform_version] < "9" -%>
            <% else -%>
            <% end -%>

How it is possible that fpmdir variable in Debian10 OS contains string "/etc/php5/fpm/pool.d" and not "/etc/php/7.0/fpm/pool.d"?
I have tried to use ''&&" operator instead of "and" in above ruby block but with same weird result
Version of chef-client: 12.16.42

Thanks for any hint in advance

It's possible because you're done an ordered string comparison on the version and "10" is less than "9" because 1 comes before 9 in the ASCII character set.

You want to do node[:platform_version].to_i < 9 so that you get a numeric comparison.

Thank you @tomhughes.

Your suggestion worked as desired!