rayo 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/rayo/tags/property_tags.rb +21 -5
- data/lib/rayo/version.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -149,7 +149,7 @@ Rayo supports transparent caching of your generated pages in filesystem which is
|
|
149
149
|
|
150
150
|
Every page after request are written to corresponding file in cache directory, so next requests will be served from there. And if you configure your web server to search for files in cache directory ruby application will not be touched at all.
|
151
151
|
|
152
|
-
For single-domain setups it may be useful to point <tt>cache_dir</tt> to the public location, so it will be served by web-server without additional configuration.
|
152
|
+
For single-domain setups it may be useful to point <tt>cache_dir</tt> to the public location, so it will be served by web-server without additional configuration.
|
153
153
|
|
154
154
|
== Planned features
|
155
155
|
|
@@ -33,7 +33,7 @@ module Rayo::Tags::PropertyTags
|
|
33
33
|
end
|
34
34
|
|
35
35
|
tag 'url' do |tag|
|
36
|
-
u = "/#{tag.locals.page.lang}/#{tag.locals.page.path.join('/')}"
|
36
|
+
u = "/#{tag.attr['lang'] || tag.locals.page.lang}/#{tag.locals.page.path.join('/')}"
|
37
37
|
u << ".#{tag.globals.format}" if tag.globals.format != tag.globals.config.default_format
|
38
38
|
u
|
39
39
|
end
|
@@ -42,12 +42,28 @@ module Rayo::Tags::PropertyTags
|
|
42
42
|
"<a href=\"#{send 'tag:path', tag}\">#{tag.single? ? send( 'tag:title', tag ) : tag.expand}</a>"
|
43
43
|
end
|
44
44
|
|
45
|
+
tag 'if_lang' do |tag|
|
46
|
+
if_matches( tag.locals.page.lang, tag ) ? tag.expand : ''
|
47
|
+
end
|
48
|
+
|
49
|
+
tag 'unless_lang' do |tag|
|
50
|
+
if_matches( tag.locals.page.lang, tag ) ? '' : tag.expand
|
51
|
+
end
|
52
|
+
|
45
53
|
tag 'if_url' do |tag|
|
46
|
-
|
54
|
+
if_matches( tag.locals.page.path.join('/'), tag ) ? tag.expand : ''
|
47
55
|
end
|
48
56
|
|
49
57
|
tag 'unless_url' do |tag|
|
50
|
-
|
58
|
+
if_matches( tag.locals.page.path.join('/'), tag ) ? '' : tag.expand
|
59
|
+
end
|
60
|
+
|
61
|
+
tag 'if_domain' do |tag|
|
62
|
+
(tag.locals.page.storage.config.respond_to?(:name) && if_matches( tag.locals.page.storage.config.name, tag )) ? tag.expand : ''
|
63
|
+
end
|
64
|
+
|
65
|
+
tag 'unless_domain' do |tag|
|
66
|
+
(tag.locals.page.storage.config.respond_to?(:name) && if_matches( tag.locals.page.storage.config.name, tag )) ? '' : tag.expand
|
51
67
|
end
|
52
68
|
|
53
69
|
tag 'date' do |tag|
|
@@ -70,8 +86,8 @@ module Rayo::Tags::PropertyTags
|
|
70
86
|
end
|
71
87
|
end
|
72
88
|
|
73
|
-
def
|
74
|
-
|
89
|
+
def if_matches( prop, tag )
|
90
|
+
prop =~ Regexp.new( tag.attr['matches'] )
|
75
91
|
end
|
76
92
|
|
77
93
|
end
|
data/lib/rayo/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rayo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexey Noskov
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-03-01 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|