aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interfaces/http/http.rb10
-rw-r--r--interfaces/http/web/views/index.erb (renamed from web/views/index.erb)0
-rw-r--r--interfaces/http/web/web.rb6
-rw-r--r--interfaces/ruby/models/comment.rb (renamed from models/comment.rb)0
-rw-r--r--interfaces/ruby/models/config.rb (renamed from models/config.rb)0
-rw-r--r--interfaces/ruby/models/post.rb (renamed from models/post.rb)0
-rw-r--r--interfaces/ruby/models/tag.rb (renamed from models/tag.rb)0
-rw-r--r--interfaces/ruby/ruby.rb (renamed from db.rb)0
-rw-r--r--web/interface.rb9
9 files changed, 16 insertions, 9 deletions
diff --git a/interfaces/http/http.rb b/interfaces/http/http.rb
new file mode 100644
index 0000000..0a8457c
--- /dev/null
+++ b/interfaces/http/http.rb
@@ -0,0 +1,10 @@
+require 'sinatra/base'
+require_relative '../ruby/ruby'
+require_relative 'web/web'
+
+$config = Config.first
+
+class HTTPInterface < Sinatra::Base
+ use WebInterface
+ run! if app_file == $0
+end
diff --git a/web/views/index.erb b/interfaces/http/web/views/index.erb
index 80e64a5..80e64a5 100644
--- a/web/views/index.erb
+++ b/interfaces/http/web/views/index.erb
diff --git a/interfaces/http/web/web.rb b/interfaces/http/web/web.rb
new file mode 100644
index 0000000..8ae8afd
--- /dev/null
+++ b/interfaces/http/web/web.rb
@@ -0,0 +1,6 @@
+class WebInterface < Sinatra::Base
+ get '/' do
+ @posts = Post.all
+ erb :index
+ end
+end \ No newline at end of file
diff --git a/models/comment.rb b/interfaces/ruby/models/comment.rb
index b3977f6..b3977f6 100644
--- a/models/comment.rb
+++ b/interfaces/ruby/models/comment.rb
diff --git a/models/config.rb b/interfaces/ruby/models/config.rb
index 55b4106..55b4106 100644
--- a/models/config.rb
+++ b/interfaces/ruby/models/config.rb
diff --git a/models/post.rb b/interfaces/ruby/models/post.rb
index 1d44051..1d44051 100644
--- a/models/post.rb
+++ b/interfaces/ruby/models/post.rb
diff --git a/models/tag.rb b/interfaces/ruby/models/tag.rb
index 9c24b6c..9c24b6c 100644
--- a/models/tag.rb
+++ b/interfaces/ruby/models/tag.rb
diff --git a/db.rb b/interfaces/ruby/ruby.rb
index 4c18111..4c18111 100644
--- a/db.rb
+++ b/interfaces/ruby/ruby.rb
diff --git a/web/interface.rb b/web/interface.rb
deleted file mode 100644
index 5914866..0000000
--- a/web/interface.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'sinatra'
-require_relative '../db'
-
-$config = Config.first
-
-get '/' do
- @posts = Post.all
- erb :index
-end