rack-blogengine 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3419bff1b3e18d863803c3decf44fd50eb59036c
|
4
|
+
data.tar.gz: 46968ddc82d376fc110a8c78abe4e714a3e1f1e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9826ec840bb3429059e1a24235e99627257d2a2167c80fb274681a5c2785a46bf7aae696a80716d196299b6e44771bbb5834bdcb6ab28491dbabb4da6454d882
|
7
|
+
data.tar.gz: b0573c644245434c3025087c8e8e9a5ba4c5cd176496284babaed1b5b0b0d31915369a9db3acdb98f6eadfa8a7c598579f2cb90881b18a139ad4ca524c3e12e9
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Rack
|
2
2
|
module Blogengine
|
3
3
|
class Application
|
4
|
-
|
5
4
|
# Call Method for run this method as Rack Middleware.
|
6
|
-
# @param env
|
5
|
+
# @param env Environment contains information such as path, headers etc...
|
6
|
+
# @return [Array] response Array
|
7
7
|
def self.call(env)
|
8
8
|
# Router for map docs to routes
|
9
9
|
route = ApplicationRouter.map_route(env, $targetfolder)
|
@@ -2,7 +2,9 @@ module Rack
|
|
2
2
|
module Blogengine
|
3
3
|
class ApplicationRouter
|
4
4
|
# Maps documents to routes.
|
5
|
-
# @param env
|
5
|
+
# @param env Env Contains path info etc...
|
6
|
+
# @param target Target folder
|
7
|
+
# @return [Hash] route Hash {:path => "/foo", :response => [Array]}
|
6
8
|
def self.map_route(env, target)
|
7
9
|
status = 200
|
8
10
|
header = {"Content-Type" => "text/html; charset=UTF-8"}
|
@@ -12,6 +12,7 @@ module Rack
|
|
12
12
|
|
13
13
|
# Parse in .content Documents.
|
14
14
|
# @param target.
|
15
|
+
# @return [Hash] Documents
|
15
16
|
def self.parseInDocuments(target)
|
16
17
|
@target = target
|
17
18
|
documents = []
|
@@ -67,6 +68,7 @@ module Rack
|
|
67
68
|
|
68
69
|
# Replace layout placeholder with content from .content file
|
69
70
|
# @param layout
|
71
|
+
# return [String] layout placeholder replaced with content
|
70
72
|
def self.fillFileContents(layout)
|
71
73
|
layout.gsub! "{title}", @title
|
72
74
|
layout["{content}"] = @content
|