about summary refs log tree commit homepage
path: root/lib/yahns/config.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-04-06 05:15:29 +0000
committerEric Wong <yahns-public@yhbt.net>2017-04-06 06:47:36 +0000
commit0a6f03cde0a336597358668041fa8eb6f463bac5 (patch)
tree911aca11655925d6dbad41afb3af91dcdbd2ead9 /lib/yahns/config.rb
parentf76ff00466e679e367713bc6345d0a95191629cd (diff)
downloadyahns-0a6f03cde0a336597358668041fa8eb6f463bac5.tar.gz
Since the common case is still to run a single app inside yahns,
we can simplify setup a bit for systemd (and like) users by
allowing them to omit the "listen" directive when they are
running a single app in yahns.
Diffstat (limited to 'lib/yahns/config.rb')
-rw-r--r--lib/yahns/config.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb
index e545d59..bcea0d4 100644
--- a/lib/yahns/config.rb
+++ b/lib/yahns/config.rb
@@ -438,4 +438,9 @@ class Yahns::Config # :nodoc:
 
     @app_ctx.each { |app| app.logger ||= server.logger }
   end
+
+  def register_inherited(name)
+    return unless @config_listeners.empty? && @app_ctx.size == 1
+    @config_listeners[name] = { :yahns_app_ctx => @app_ctx[0] }
+  end
 end