Don't overcomplicate things.
I've seen a lot of parse the env var and match it against some known values like:
env_var = ENV['FEATURE_ONE']
case env_var.to_s.downcase
when 'true', 't', 'yes', 'y', 'on', '1' then true
when 'false', 'f', 'no', 'n', 'off', '0' then false
else raise ArgumentError, 'Invalid input detected'
end
This is unecessarily bloated. It also doesn't help that much.
Use the existence of an env var as a guard if something is on or off.
That means: only set env vars if you need them.
Also: if you know a variable is set and you need to turn it off, simply use unset FEATURE_ONE
.
Done.