diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/guff.cr | 15 | ||||
-rw-r--r-- | src/guff/database.cr | 7 | ||||
-rw-r--r-- | src/guff/model.cr | 11 |
3 files changed, 18 insertions, 15 deletions
diff --git a/src/guff.cr b/src/guff.cr index b19db4c..e62ff1f 100644 --- a/src/guff.cr +++ b/src/guff.cr @@ -1,22 +1,7 @@ -require "sqlite3" require "http/server" require "./guff/*" module Guff - class Database < ::SQLite3::Database - # TODO (add table_exists?) - end - - class Model - getter :db - - def initialize(@config : Config) - # create site database - db_path = "%s/site.db" % [config["data"]] - @db = Database.new(db_path) - end - end - class BlogHandler < Handler MATCHES = [%r{ ^/ diff --git a/src/guff/database.cr b/src/guff/database.cr new file mode 100644 index 0000000..de11eb2 --- /dev/null +++ b/src/guff/database.cr @@ -0,0 +1,7 @@ +require "sqlite3" + +module Guff + class Database < ::SQLite3::Database + # TODO (add table_exists?) + end +end diff --git a/src/guff/model.cr b/src/guff/model.cr new file mode 100644 index 0000000..370229c --- /dev/null +++ b/src/guff/model.cr @@ -0,0 +1,11 @@ +module Guff + class Model + getter :db + + def initialize(@config : Config) + # create site database + db_path = "%s/site.db" % [config["data"]] + @db = Database.new(db_path) + end + end +end |