microengine 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/Rakefile +1 -1
- data/lib/dispatcher.rb +7 -29
- data/lib/http.rb +0 -2
- data/lib/initializer.rb +0 -8
- metadata +1 -2
- data/config/search spiders +0 -4
data/README
CHANGED
@@ -5,7 +5,7 @@ simple sites, which only share information (maybe in some languages) and
|
|
5
5
|
has web interface to edit, create and delete pages.
|
6
6
|
|
7
7
|
MicroEngine has a good support for i18n. User languages will be detected
|
8
|
-
automatically.
|
8
|
+
automatically.
|
9
9
|
|
10
10
|
MicroEngine didn't use database. Information is storage in files and may be
|
11
11
|
cached in memory on engine loading.
|
data/Rakefile
CHANGED
data/lib/dispatcher.rb
CHANGED
@@ -26,7 +26,6 @@ module Microengine
|
|
26
26
|
|
27
27
|
attr_writer :config
|
28
28
|
attr_writer :logger
|
29
|
-
attr_writer :spiders
|
30
29
|
attr_writer :cache
|
31
30
|
attr_writer :admin
|
32
31
|
|
@@ -46,28 +45,15 @@ module Microengine
|
|
46
45
|
next
|
47
46
|
end
|
48
47
|
|
49
|
-
if
|
50
|
-
|
51
|
-
unless http.get['lang']
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
next
|
56
|
-
end
|
48
|
+
if http.get['lang']
|
49
|
+
http.set_cookie 'lang', http.get['lang'], 30
|
50
|
+
unless langs.include? http.get['lang']
|
51
|
+
http.redirect http.url
|
52
|
+
request.finish
|
53
|
+
next
|
57
54
|
end
|
58
|
-
http.redirect http.url + '?lang=' + language(http, langs)
|
59
|
-
else
|
60
|
-
# Human visitor
|
61
|
-
if http.get['lang']
|
62
|
-
http.set_cookie 'lang', http.get['lang'], 30
|
63
|
-
unless langs.include? http.get['lang']
|
64
|
-
http.redirect http.url
|
65
|
-
request.finish
|
66
|
-
next
|
67
|
-
end
|
68
|
-
end
|
69
|
-
http << @cache.get(http.url, language(http, langs))
|
70
55
|
end
|
56
|
+
http << @cache.get(http.url, language(http, langs))
|
71
57
|
request.finish
|
72
58
|
end
|
73
59
|
end
|
@@ -103,13 +89,5 @@ module Microengine
|
|
103
89
|
end
|
104
90
|
end
|
105
91
|
|
106
|
-
# Check HTTP_USER_AGENT value for search engine spiders
|
107
|
-
def spider?(agent)
|
108
|
-
@spiders.each do |spider|
|
109
|
-
return true if agent.include? spider
|
110
|
-
end
|
111
|
-
false
|
112
|
-
end
|
113
|
-
|
114
92
|
end
|
115
93
|
end
|
data/lib/http.rb
CHANGED
@@ -25,7 +25,6 @@ module Microengine
|
|
25
25
|
attr_reader :url
|
26
26
|
attr_reader :post
|
27
27
|
attr_reader :langs
|
28
|
-
attr_reader :agent
|
29
28
|
attr_reader :ip
|
30
29
|
attr_reader :cookie
|
31
30
|
attr_reader :get
|
@@ -35,7 +34,6 @@ module Microengine
|
|
35
34
|
def initialize(request)
|
36
35
|
@out = request.out
|
37
36
|
@env = request.env
|
38
|
-
@agent = request.env['HTTP_USER_AGENT']
|
39
37
|
@ip = request.env['REMOTE_ADDR']
|
40
38
|
@langs = format_langs request.env['HTTP_ACCEPT_LANGUAGE']
|
41
39
|
@url = normalize_url format_url(request.env['REQUEST_URI'])
|
data/lib/initializer.rb
CHANGED
@@ -55,7 +55,6 @@ module Microengine
|
|
55
55
|
admin.shadow = load_shadow
|
56
56
|
admin.dispatcher = dispatcher
|
57
57
|
admin.assambler = assambler
|
58
|
-
dispatcher.spiders = load_seach_spiders
|
59
58
|
dispatcher.admin = admin
|
60
59
|
|
61
60
|
begin
|
@@ -82,12 +81,5 @@ module Microengine
|
|
82
81
|
rescue
|
83
82
|
raise "Can't open shadow file. Please ensure that config/shadow.yaml exists and can be read by engine."
|
84
83
|
end
|
85
|
-
|
86
|
-
# Load search spider list
|
87
|
-
def load_seach_spiders
|
88
|
-
IO.readlines(MICROENGINE_ROOT + '/config/search spiders')
|
89
|
-
rescue
|
90
|
-
raise "Can't open spiders file. Please ensure that '/config/search spiders' exists and can be read by engine."
|
91
|
-
end
|
92
84
|
end
|
93
85
|
end
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: microengine
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
6
|
+
version: 0.2.0
|
7
7
|
date: 2008-03-11 00:00:00 +03:00
|
8
8
|
summary: MicroEngine is a fast, simple and minimalistic site engine.
|
9
9
|
require_paths:
|
@@ -31,7 +31,6 @@ authors:
|
|
31
31
|
files:
|
32
32
|
- bin/microengine
|
33
33
|
- config/settings.yaml
|
34
|
-
- config/search spiders
|
35
34
|
- config/shadow.yaml
|
36
35
|
- content/403
|
37
36
|
- content/403/ru.body
|
data/config/search spiders
DELETED