couch_photo 1.0.0.beta.9 → 1.0.0.beta.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.beta.9
1
+ 1.0.0.beta.10
@@ -26,6 +26,22 @@ module CouchPhoto
26
26
  def extract_xmp_metadata?
27
27
  @extract_xmp_metadata
28
28
  end
29
+
30
+ def url_transformer(transformer_object=nil, &block)
31
+ if transformer_object
32
+ @url_transformer = proc {|url| transformer_object.transform url}
33
+ else
34
+ @url_transformer = block
35
+ end
36
+ end
37
+
38
+ def transform(url)
39
+ if @url_transformer
40
+ @url_transformer.call url
41
+ else
42
+ url
43
+ end
44
+ end
29
45
  end
30
46
 
31
47
  def load_original_from_file(filepath)
@@ -56,7 +56,7 @@ module CouchPhoto
56
56
 
57
57
  def url
58
58
  if exists?
59
- "#{@document.database.root}/#{@document.id}/#{attachment_name}"
59
+ @document.class.transform "#{@document.database.root}/#{@document.id}/#{attachment_name}"
60
60
  end
61
61
  end
62
62
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couch_photo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196369
4
+ hash: 62196375
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
10
  - beta
11
- - 9
12
- version: 1.0.0.beta.9
11
+ - 10
12
+ version: 1.0.0.beta.10
13
13
  platform: ruby
14
14
  authors:
15
15
  - Matt Parker
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-10-03 00:00:00 Z
20
+ date: 2011-10-04 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: cucumber