about summary refs log tree commit homepage
path: root/lib/yahns/config.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-29 01:10:26 +0000
committerEric Wong <e@80x24.org>2013-10-29 02:37:05 +0000
commit15cd0f840ddd736cefac02814a581f8e11c1764d (patch)
tree7cca2ff09585d317cc2ee814d44bc3748fd4c311 /lib/yahns/config.rb
parentec74dc0cab7c0c164488dbe62c662b4f0cbd64de (diff)
downloadyahns-15cd0f840ddd736cefac02814a581f8e11c1764d.tar.gz
Negative ratio makes little sense and there's no reason to
allow it.
Diffstat (limited to 'lib/yahns/config.rb')
-rw-r--r--lib/yahns/config.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb
index 88af2de..c923434 100644
--- a/lib/yahns/config.rb
+++ b/lib/yahns/config.rb
@@ -278,7 +278,8 @@ class Yahns::Config # :nodoc:
     var = _check_in_block(nil, :client_expire_threshold)
     case val
     when Float
-      val <= 1.0 or raise ArgumentError, "#{var} must be <= 1.0 if a ratio"
+      (val > 0 && val <= 1.0) or
+        raise ArgumentError, "#{var} must be > 0 and <= 1.0 if a ratio"
     when Integer
     else
       raise ArgumentError, "#{var} must be a float or integer"