aboutsummaryrefslogtreecommitdiff
path: root/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces')
-rw-r--r--interfaces/http/http.rb8
-rw-r--r--interfaces/http/web/web.rb2
-rw-r--r--interfaces/ruby/ruby.rb7
3 files changed, 8 insertions, 9 deletions
diff --git a/interfaces/http/http.rb b/interfaces/http/http.rb
index 5c9eca4..8947890 100644
--- a/interfaces/http/http.rb
+++ b/interfaces/http/http.rb
@@ -1,13 +1,11 @@
require 'sinatra/base'
require_relative '../ruby/ruby'
-Dir.glob('*/*.rb', base: __dir__).grep(/^(.*)\/\1\.rb$/).each do |f|
- require_relative f
-end
-
$config = Config.first
class HTTPInterface < Sinatra::Base
- use WebInterface
+ require_relative 'web/web'; use WebInterface
+ # require_relative 'admin/admin'; use AdminInterface
+ # require_relative 'rss/rss'; use RSSInterface
run! if app_file == $0
end
diff --git a/interfaces/http/web/web.rb b/interfaces/http/web/web.rb
index 8ae8afd..ca04ecc 100644
--- a/interfaces/http/web/web.rb
+++ b/interfaces/http/web/web.rb
@@ -3,4 +3,4 @@ class WebInterface < Sinatra::Base
@posts = Post.all
erb :index
end
-end \ No newline at end of file
+end
diff --git a/interfaces/ruby/ruby.rb b/interfaces/ruby/ruby.rb
index ffd6d6a..d5c0e9c 100644
--- a/interfaces/ruby/ruby.rb
+++ b/interfaces/ruby/ruby.rb
@@ -5,6 +5,7 @@ ActiveRecord::Base.establish_connection(
database: "#{__dir__}/../../db.sqlite3"
)
-Dir.glob('models/*.rb', base: __dir__).each do |f|
- require_relative f
-end
+require_relative 'models/comment'
+require_relative 'models/config'
+require_relative 'models/post'
+require_relative 'models/tag'