utopia 0.9.18 → 0.9.20
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.
- data/lib/utopia/middleware/benchmark.rb +3 -10
- data/lib/utopia/tags/gallery.rb +6 -2
- data/lib/utopia/version.rb +1 -1
- metadata +3 -3
@@ -30,16 +30,9 @@ module Utopia
|
|
30
30
|
finish = Time.now
|
31
31
|
|
32
32
|
time = "%0.4f" % (finish - start)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
response[2].each do |text|
|
37
|
-
buf.write(text.gsub(@tag, time))
|
38
|
-
end
|
39
|
-
|
40
|
-
buf.rewind
|
41
|
-
|
42
|
-
[response[0], response[1], buf]
|
33
|
+
env['rack.errors'].puts "Benchmark: Request #{env["PATH_INFO"]} took #{time}s"
|
34
|
+
|
35
|
+
return response
|
43
36
|
end
|
44
37
|
end
|
45
38
|
|
data/lib/utopia/tags/gallery.rb
CHANGED
@@ -152,19 +152,23 @@ class Utopia::Tags::Gallery
|
|
152
152
|
gallery = new(transaction.end_tags[-2].node, Utopia::Path.create(state["path"] || "./"))
|
153
153
|
metadata = gallery.metadata
|
154
154
|
metadata.default = {}
|
155
|
-
|
155
|
+
|
156
156
|
tag_name = state["tag"] || "img"
|
157
157
|
|
158
158
|
options = {}
|
159
159
|
options[:process] = state["process"]
|
160
160
|
|
161
|
+
filter = Regexp.new(state["filter"]) if state["filter"]
|
162
|
+
|
161
163
|
transaction.tag("div", "class" => "gallery") do |node|
|
162
164
|
images = gallery.images(options).sort_by do |path|
|
163
165
|
name = path.original.basename
|
164
166
|
metadata[name]["order"] || name
|
165
167
|
end
|
166
|
-
|
168
|
+
|
167
169
|
images.each do |path|
|
170
|
+
next if filter and !filter.match(path.original.basename)
|
171
|
+
|
168
172
|
alt_text = metadata[path.original.basename]["caption"]
|
169
173
|
transaction.tag(tag_name, "src" => path, "alt" => alt_text)
|
170
174
|
end
|
data/lib/utopia/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 9
|
8
|
-
-
|
9
|
-
version: 0.9.
|
8
|
+
- 20
|
9
|
+
version: 0.9.20
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Samuel Williams
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-24 00:00:00 +13:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|