rack-blogengine 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 03d29dbb67f31e4c0f1370fbdf0827c69b91d9e5
|
4
|
+
data.tar.gz: cc3f7d24d61d883e39b9b2bc7a1f0b674030c934
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6a3ba61a4ff79c4468f3d13f4b0d38996340c1562ee25700420c431c0a7f84864d0f337c39e9b4edd5c93fa96db5c63b5762bb76c2e287b5b9d99648df290687
|
7
|
+
data.tar.gz: e4323d8c9705400d843e9c657bfb9c17779656782935ba1fca02068f8ad5bcc4ac7ae2f0ed5322c7cd607b7d44f2e6a8135f1389821881040f15c717b39fd17d
|
@@ -12,7 +12,7 @@ module Rack
|
|
12
12
|
# @return [Array] response Array
|
13
13
|
def self.call(env)
|
14
14
|
# Router for map docs to routes
|
15
|
-
route = ApplicationRouter.map_route(env, $
|
15
|
+
route = ApplicationRouter.map_route(env, $documents)
|
16
16
|
if route
|
17
17
|
return route["response"]
|
18
18
|
else
|
@@ -10,21 +10,16 @@ module Rack
|
|
10
10
|
# @param env Env Contains path info etc...
|
11
11
|
# @param target Target folder
|
12
12
|
# @return [Hash] route Hash {:path => "/foo", :response => [Array]}
|
13
|
-
def self.map_route(env,
|
13
|
+
def self.map_route(env, documents)
|
14
14
|
status = 200
|
15
15
|
header = {"Content-Type" => "text/html; charset=UTF-8"}
|
16
16
|
path = env["PATH_INFO"]
|
17
|
-
|
18
|
-
# TODO: dont parse all docs on every request -> doc cache (maybe parse at rack-blogengine run)
|
19
|
-
# for fasten up accessing eg contentoperator in layout.html which has faraday request -> too big load times on every request!!!
|
20
|
-
documents = DocParser.parseInDocuments(target)
|
21
|
-
|
22
17
|
|
23
18
|
# Iterate through available docs, if nothing matched return nil
|
24
19
|
documents.each do |doc|
|
25
20
|
if doc[:path] == path
|
26
21
|
route_response = {
|
27
|
-
"
|
22
|
+
"path" => path,
|
28
23
|
"response" => [status, header, [doc[:html]] ]
|
29
24
|
}
|
30
25
|
|
@@ -31,12 +31,12 @@ module Rack
|
|
31
31
|
if Dir.exists?("#{target}")
|
32
32
|
system("cd #{target}")
|
33
33
|
|
34
|
-
|
35
|
-
config = getConfig(
|
34
|
+
targetfolder = "#{Dir.pwd}/#{target}"
|
35
|
+
config = getConfig(targetfolder)
|
36
36
|
|
37
37
|
app = Rack::Builder.new do
|
38
38
|
map "/assets" do
|
39
|
-
run Rack::Directory.new("#{
|
39
|
+
run Rack::Directory.new("#{targetfolder}/assets")
|
40
40
|
end
|
41
41
|
|
42
42
|
use Rack::CommonLogger
|
@@ -48,7 +48,11 @@ module Rack
|
|
48
48
|
username == config["Username"] && password == config["Password"]
|
49
49
|
end
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
|
+
# Parse in all Documents in cli.run(target)
|
53
|
+
# -> $documents are parsed in only once and then cached via a global variable
|
54
|
+
$documents = DocParser.parseInDocuments(targetfolder)
|
55
|
+
|
52
56
|
run Rack::Blogengine::Application
|
53
57
|
end
|
54
58
|
|
@@ -97,12 +101,11 @@ module Rack
|
|
97
101
|
puts "\tTo test it type rack-blogengine run #{folder}"
|
98
102
|
end
|
99
103
|
|
100
|
-
|
101
|
-
|
102
104
|
# Display Version
|
103
105
|
# return [String] VERSION
|
104
106
|
def version?
|
105
|
-
puts Rack::Blogengine::VERSION
|
107
|
+
puts "\n\tVERSION: #{Rack::Blogengine::VERSION}"
|
108
|
+
puts "\tRack::Blogengine releases are all pre-relases, first production release will be VERSION 1.0.0\n\n"
|
106
109
|
end
|
107
110
|
|
108
111
|
private
|
metadata
CHANGED
@@ -1,66 +1,80 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-blogengine
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Benny1992
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
prerelease: false
|
11
|
+
date: 2014-01-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
16
14
|
name: bundler
|
17
|
-
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
22
20
|
type: :development
|
23
|
-
requirement: *id001
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
21
|
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
26
28
|
name: rake
|
27
|
-
|
28
|
-
requirements:
|
29
|
-
-
|
30
|
-
-
|
31
|
-
|
32
|
-
version: "0"
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
33
34
|
type: :development
|
34
|
-
requirement: *id002
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
37
42
|
name: rspec
|
38
|
-
|
39
|
-
requirements:
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
40
45
|
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
46
|
+
- !ruby/object:Gem::Version
|
42
47
|
version: 2.0.0
|
43
48
|
type: :development
|
44
|
-
requirement: *id003
|
45
|
-
- !ruby/object:Gem::Dependency
|
46
49
|
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.0.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
47
56
|
name: rack
|
48
|
-
|
49
|
-
requirements:
|
50
|
-
-
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
51
62
|
type: :runtime
|
52
|
-
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
53
69
|
description: Blogengine based on rack applications
|
54
|
-
email:
|
70
|
+
email:
|
55
71
|
- klotz.benjamin@yahoo.de
|
56
|
-
executables:
|
72
|
+
executables:
|
57
73
|
- rack-blogengine
|
58
74
|
extensions: []
|
59
|
-
|
60
75
|
extra_rdoc_files: []
|
61
|
-
|
62
|
-
|
63
|
-
- .gitignore
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
64
78
|
- Gemfile
|
65
79
|
- LICENSE.txt
|
66
80
|
- README.md
|
@@ -79,29 +93,29 @@ files:
|
|
79
93
|
- lib/rack/blogengine/operator.rb
|
80
94
|
- lib/rack/blogengine/version.rb
|
81
95
|
- rack-blogengine.gemspec
|
82
|
-
homepage:
|
83
|
-
licenses:
|
96
|
+
homepage: ''
|
97
|
+
licenses:
|
84
98
|
- MIT
|
85
99
|
metadata: {}
|
86
|
-
|
87
100
|
post_install_message:
|
88
101
|
rdoc_options: []
|
89
|
-
|
90
|
-
require_paths:
|
102
|
+
require_paths:
|
91
103
|
- lib
|
92
104
|
- spec
|
93
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
-
|
96
|
-
|
97
|
-
|
98
|
-
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
99
115
|
requirements: []
|
100
|
-
|
101
116
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.2.0
|
117
|
+
rubygems_version: 2.2.0.rc.1
|
103
118
|
signing_key:
|
104
119
|
specification_version: 4
|
105
120
|
summary: Blogengine based on rack applications
|
106
121
|
test_files: []
|
107
|
-
|