Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

...

  • Loading branch information...
commit ee28e2c0fa30641551986d2fb47001d0fb15b06e 2 parents 30e30c2 + 67a3390
@sivers sivers authored
Showing with 34 additions and 3 deletions.
  1. +19 −0 models.rb
  2. +8 −0 server.sh
  3. +1 −3 config.ru → server1.ru
  4. +6 −0 server2.ru
View
19 models.rb
@@ -0,0 +1,19 @@
+require 'd50b/models'
+
+#DB = Sequel.postgres('d50b', user: 'd50b')
+module Sivers
+
+ class Comment < Sequel::Model(:sivers__comments)
+ many_to_one :person, class: :Person
+
+ def self.newest(num = 100)
+ order(Sequel.desc(:id)).limit(num).all
+ end
+
+ def add_reply(reply)
+ nu = '<br><span class="response">%s -- Derek</span>' % reply
+ update(html: html + nu)
+ end
+ end
+
+end
View
8 server.sh
@@ -0,0 +1,8 @@
+rackup -p9000 -Ppid-real-server -D server1.ru
+rackup -p9001 -Ppid-test-server -D server2.ru
+
+echo "real server:"
+echo "http://127.0.0.1:9000/"
+echo "test server:"
+echo "http://127.0.0.1:9001/"
+
View
4 config.ru → server1.ru
@@ -1,7 +1,5 @@
require 'sinatra/base'
-require './models.rb'
-
-# use Rack::MethodOverride
+require 'd50b/models'
require './routes/sivers-comments.rb'
map('/sivers-comments') { run SiversComments }
View
6 server2.ru
@@ -0,0 +1,6 @@
+require 'sinatra/base'
+require 'd50b/test'
+
+require './routes/sivers-comments.rb'
+map('/sivers-comments') { run SiversComments }
+
Please sign in to comment.
Something went wrong with that request. Please try again.