paperclip-fedora 0.2.4 → 0.2.5
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.
- data/README.md +8 -1
- data/config/{paperclip-fedora.yml → fedora.yml} +0 -0
- data/lib/paperclip-fedora/version.rb +1 -1
- data/lib/paperclip-fedora.rb +5 -3
- metadata +9 -9
data/README.md
CHANGED
@@ -14,7 +14,14 @@ has_attachment:
|
|
14
14
|
|
15
15
|
`has_attached_file :content, :storage => :Fedora`
|
16
16
|
|
17
|
-
|
17
|
+
You can set your own pid for the object by specifying it in the has_attached file of your model as well, such as:
|
18
|
+
|
19
|
+
`has_attached_file :content, :storage => :Fedora, :fedora_pid => self.uuid`
|
20
|
+
|
21
|
+
(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
|
+
NAMESPACE:ID - for valid PID naming see https://wiki.duraspace.org/display/FEDORA35/Fedora+Identifiers#FedoraIdentifiers-PIDs )
|
23
|
+
|
24
|
+
For server connection options, you should have a file titled fedora.yml in your
|
18
25
|
/config folder. There is a nifty rake task to put the yaml file there for you:
|
19
26
|
|
20
27
|
`rake paperclip:fedora:setup`
|
File without changes
|
data/lib/paperclip-fedora.rb
CHANGED
@@ -18,6 +18,8 @@ module Paperclip
|
|
18
18
|
@port = @fedora_config[:port]
|
19
19
|
@context = @fedora_config[:context]
|
20
20
|
|
21
|
+
@custom_pid = @options[:fedora_pid]
|
22
|
+
|
21
23
|
@server_url = "http\://#{@host}\:#{@port}/#{@context}"
|
22
24
|
|
23
25
|
@path = ":basename_clean\::id"
|
@@ -78,7 +80,7 @@ module Paperclip
|
|
78
80
|
end
|
79
81
|
|
80
82
|
def fedora_object
|
81
|
-
@object_id = path()
|
83
|
+
@object_id = @custom_pid || path()
|
82
84
|
object = fedora.find(@object_id)
|
83
85
|
object.label = @object_id
|
84
86
|
saved_object = object.save
|
@@ -91,11 +93,11 @@ module Paperclip
|
|
91
93
|
end
|
92
94
|
|
93
95
|
def setup!
|
94
|
-
FileUtils.cp(File.dirname(__FILE__) + "/../config/
|
96
|
+
FileUtils.cp(File.dirname(__FILE__) + "/../config/fedora.yml", config_file) unless config?
|
95
97
|
end
|
96
98
|
|
97
99
|
def config_file
|
98
|
-
Rails.root.join("config", "
|
100
|
+
Rails.root.join("config", "fedora.yml").to_s
|
99
101
|
end
|
100
102
|
|
101
103
|
def config?
|
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.
|
4
|
+
version: 0.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-09-
|
12
|
+
date: 2011-09-28 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paperclip
|
16
|
-
requirement: &
|
16
|
+
requirement: &2168480540 !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: *
|
24
|
+
version_requirements: *2168480540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rubydora
|
27
|
-
requirement: &
|
27
|
+
requirement: &2165006680 !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: *
|
35
|
+
version_requirements: *2165006680
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &2165006040 !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: *
|
46
|
+
version_requirements: *2165006040
|
47
47
|
description: Adds Fedora Commons storage support for the Paperclip gem.
|
48
48
|
email:
|
49
49
|
- jaredsartin@gmail.com
|
@@ -55,7 +55,7 @@ files:
|
|
55
55
|
- Gemfile
|
56
56
|
- README.md
|
57
57
|
- Rakefile
|
58
|
-
- config/
|
58
|
+
- config/fedora.yml
|
59
59
|
- lib/paperclip-fedora.rb
|
60
60
|
- lib/paperclip-fedora/railtie.rb
|
61
61
|
- lib/paperclip-fedora/rake.rb
|