paperclip-fedora 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,6 +18,8 @@ You can set your own pid for the object by specifying it in the has_attached fil
18
18
 
19
19
  `has_attached_file :content, :storage => :Fedora, :fedora_pid => self.uuid`
20
20
 
21
+ or have uuid on your model this is getting added to. If uuid is present on the model, this will be the Fedora object id.
22
+
21
23
  (Note, if the pid is static, all of your uploads will continually overwrite each other. Make sure to generate them in the form of
22
24
  NAMESPACE:ID - for valid PID naming see https://wiki.duraspace.org/display/FEDORA35/Fedora+Identifiers#FedoraIdentifiers-PIDs )
23
25
 
@@ -1,5 +1,5 @@
1
1
  module Paperclip
2
2
  module Fedora
3
- VERSION = "0.2.5"
3
+ VERSION = "0.2.6"
4
4
  end
5
5
  end
@@ -17,14 +17,10 @@ module Paperclip
17
17
  @host = @fedora_config[:host]
18
18
  @port = @fedora_config[:port]
19
19
  @context = @fedora_config[:context]
20
-
21
- @custom_pid = @options[:fedora_pid]
20
+ @custom_namespace = @options[:fedora_pid]
22
21
 
23
22
  @server_url = "http\://#{@host}\:#{@port}/#{@context}"
24
23
 
25
- @path = ":basename_clean\::id"
26
- @url = "#{@server_url}/objects/#{@path}/datastreams/:style/content"
27
-
28
24
  Paperclip.interpolates(:basename_clean) do |attachment, style|
29
25
  s = File.basename(attachment.original_filename, File.extname(attachment.original_filename))
30
26
  s.downcase!
@@ -80,7 +76,9 @@ module Paperclip
80
76
  end
81
77
 
82
78
  def fedora_object
83
- @object_id = @custom_pid || path()
79
+ @object_id = instance.uuid || @custom_pid || path()
80
+ @path = @object_id
81
+ @url = "#{@server_url}/objects/#{@path}/datastreams/:style/content"
84
82
  object = fedora.find(@object_id)
85
83
  object.label = @object_id
86
84
  saved_object = object.save
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-09-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: paperclip
16
- requirement: &2168480540 !ruby/object:Gem::Requirement
16
+ requirement: &2164976840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2168480540
24
+ version_requirements: *2164976840
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rubydora
27
- requirement: &2165006680 !ruby/object:Gem::Requirement
27
+ requirement: &2164976260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2165006680
35
+ version_requirements: *2164976260
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &2165006040 !ruby/object:Gem::Requirement
38
+ requirement: &2164975800 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2165006040
46
+ version_requirements: *2164975800
47
47
  description: Adds Fedora Commons storage support for the Paperclip gem.
48
48
  email:
49
49
  - jaredsartin@gmail.com