From ac346b5abcfa6253bd792091e5fb011774c40d49 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 7 Sep 2011 00:36:58 +0000 Subject: add preliminary SSL support This will also be the foundation of SSL support in Rainbows! and Zbatery. Some users may also want to use this in Unicorn on LANs to meet certain security/auditing requirements. Of course, Nightmare! (in whatever form) should also be able to use it. --- lib/unicorn/configurator.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/unicorn/configurator.rb') diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 8816c85..a93c1dc 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -1,5 +1,6 @@ # -*- encoding: binary -*- require 'logger' +require 'unicorn/ssl_configurator' # Implements a simple DSL for configuring a \Unicorn server. # @@ -12,6 +13,7 @@ require 'logger' # See the link:/TUNING.html document for more information on tuning unicorn. class Unicorn::Configurator include Unicorn + include Unicorn::SSLConfigurator # :stopdoc: attr_accessor :set, :config_file, :after_reload @@ -563,13 +565,16 @@ private end end - def set_bool(var, bool) #:nodoc: + def check_bool(var, bool) # :nodoc: case bool when true, false - set[var] = bool - else - raise ArgumentError, "#{var}=#{bool.inspect} not a boolean" + return bool end + raise ArgumentError, "#{var}=#{bool.inspect} not a boolean" + end + + def set_bool(var, bool) #:nodoc: + set[var] = check_bool(var, bool) end def set_hook(var, my_proc, req_arity = 2) #:nodoc: -- cgit v1.2.3-24-ge0c7