jeanny 0.91 → 0.93
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jeanny/engine.rb +19 -12
- metadata +2 -2
data/lib/jeanny/engine.rb
CHANGED
@@ -436,28 +436,35 @@ module Jeanny
|
|
436
436
|
|
437
437
|
tags = []
|
438
438
|
@code.gsub! /\[%(.*?)%\]/ do |tag|
|
439
|
-
tags <<
|
439
|
+
tags << $1
|
440
440
|
|
441
|
-
"
|
441
|
+
"__tt2-tag__#{tags.length}__"
|
442
442
|
end
|
443
|
-
|
443
|
+
|
444
444
|
super classes
|
445
445
|
|
446
446
|
tags.map! do |tag|
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
447
|
+
|
448
|
+
# Пропускаем конструкции в которых точно ничего нет
|
449
|
+
unless tag =~ /^\s*(#|PROCESS|INCLUDE|INSERT|END\s*$|ELSE\s*$)/im
|
450
|
+
each_string :in => tag do |string|
|
451
|
+
unless string =~ /\.(tt2|css|png|jpg|gif)\s*$/
|
452
|
+
string_after = string.dup
|
453
|
+
classes.each do |full_class, short_class|
|
454
|
+
while (pos = string_after =~ /#{full_class}(?=[^a-z0-9\-_\.]|$)/)
|
455
|
+
string_after[pos, full_class.length] = short_class
|
456
|
+
end
|
457
|
+
end
|
458
|
+
tag.gsub! string, string_after
|
452
459
|
end
|
453
|
-
|
454
|
-
|
460
|
+
tag
|
461
|
+
end
|
455
462
|
end
|
456
463
|
tag
|
457
464
|
end
|
458
|
-
|
465
|
+
|
459
466
|
tags.each_with_index do |tag, index|
|
460
|
-
@code.gsub!(/
|
467
|
+
@code.gsub!(/__tt2-tag__#{index + 1}__/, "[%#{tag}%]")
|
461
468
|
end
|
462
469
|
|
463
470
|
@code
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jeanny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.93"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gfranco
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-26 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|