aboutsummaryrefslogtreecommitdiff
path: root/interfaces/http/http.rb
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-03-02 01:38:19 +0100
committerJohn Ankarström <john@ankarstrom.se>2021-03-02 01:38:19 +0100
commitc8e09cc8ec756014268405470fdc45db6e0acb95 (patch)
treecc9d141f342a4123c78643544a08d60ee5ec73cb /interfaces/http/http.rb
parent8d21b802c35d5b1f8e6e868aaa20c1c0066275c9 (diff)
downloadcomb-c8e09cc8ec756014268405470fdc45db6e0acb95.tar.gz
Require ruby models and http sub-interfaces dynamically
This makes it easier to add/remove models/sub-interfaces. At the same time, it is very clear what is happening.
Diffstat (limited to 'interfaces/http/http.rb')
-rw-r--r--interfaces/http/http.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/interfaces/http/http.rb b/interfaces/http/http.rb
index 0a8457c..5c9eca4 100644
--- a/interfaces/http/http.rb
+++ b/interfaces/http/http.rb
@@ -1,6 +1,9 @@
require 'sinatra/base'
require_relative '../ruby/ruby'
-require_relative 'web/web'
+
+Dir.glob('*/*.rb', base: __dir__).grep(/^(.*)\/\1\.rb$/).each do |f|
+ require_relative f
+end
$config = Config.first