utopia 0.9.42 → 0.9.43
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/utopia/tags/gallery.rb +24 -3
- data/lib/utopia/version.rb +1 -1
- metadata +4 -4
data/lib/utopia/tags/gallery.rb
CHANGED
@@ -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
|
-
|
247
|
-
transaction.tag(tag_name, "src" => path, "alt" =>
|
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
|
data/lib/utopia/version.rb
CHANGED
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:
|
4
|
+
hash: 109
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
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:
|
18
|
+
date: 2011-01-26 00:00:00 +13:00
|
19
19
|
default_executable: utopia
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|