utopia 0.9.42 → 0.9.43

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.
@@ -141,6 +141,27 @@ class Utopia::Tags::Gallery
141
141
  end
142
142
  end
143
143
 
144
+ class ImageMetadata
145
+ def initialize(metadata)
146
+ @metadata = metadata
147
+ end
148
+
149
+ attr :metadata
150
+
151
+ def [] (key)
152
+ @metadata[key.to_s]
153
+ end
154
+
155
+ def to_s
156
+ @metadata['caption'] || ''
157
+ end
158
+
159
+ # A bit of a hack to ease migration.
160
+ def to_html
161
+ to_s.to_html
162
+ end
163
+ end
164
+
144
165
  def initialize(node, path)
145
166
  @node = node
146
167
  @path = path
@@ -242,9 +263,9 @@ class Utopia::Tags::Gallery
242
263
 
243
264
  images.each do |path|
244
265
  next if filter and !filter.match(path.original.basename)
245
-
246
- alt_text = metadata[path.original.basename]["caption"]
247
- transaction.tag(tag_name, "src" => path, "alt" => alt_text)
266
+
267
+ alt = ImageMetadata.new(metadata[path.original.basename])
268
+ transaction.tag(tag_name, "src" => path, "alt" => alt)
248
269
  end
249
270
  end
250
271
  end
@@ -6,7 +6,7 @@ module Utopia
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 9
9
- TINY = 42
9
+ TINY = 43
10
10
 
11
11
  STRING = [MAJOR, MINOR, TINY].join('.')
12
12
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- hash: 111
4
+ hash: 109
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 42
10
- version: 0.9.42
9
+ - 43
10
+ version: 0.9.43
11
11
  platform: ruby
12
12
  authors:
13
13
  - Samuel Williams
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-22 00:00:00 +13:00
18
+ date: 2011-01-26 00:00:00 +13:00
19
19
  default_executable: utopia
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency