utopia 0.9.18 → 0.9.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,16 +30,9 @@ module Utopia
30
30
  finish = Time.now
31
31
 
32
32
  time = "%0.4f" % (finish - start)
33
- # LOG.debug "benchmark: Request #{env["PATH_INFO"]} took #{time}s"
34
- buf = StringIO.new
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
 
@@ -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
@@ -17,7 +17,7 @@ module Utopia
17
17
  module VERSION #:nodoc:
18
18
  MAJOR = 0
19
19
  MINOR = 9
20
- TINY = 18
20
+ TINY = 20
21
21
 
22
22
  STRING = [MAJOR, MINOR, TINY].join('.')
23
23
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 18
9
- version: 0.9.18
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-21 00:00:00 +13:00
17
+ date: 2010-03-24 00:00:00 +13:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency