cul_scv_hydra 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/config/fedora.yml CHANGED
@@ -2,7 +2,7 @@ development:
2
2
  # :url: http://127.0.0.1:8983/fedora
3
3
  # :user: fedoraAdmin
4
4
  # :password: fedoraAdmin
5
- :url: http://sayers.cul.columbia.edu:8080/fedora
5
+ :url: http://alcott.cul.columbia.edu:8080/fedora
6
6
  :user: fedoraAdmin
7
7
  :password: f+BULUS*^
8
8
  test:
@@ -11,35 +11,35 @@ module Aggregator
11
11
  def aggregator!
12
12
  add_relationship(:rdf_type, Cul::Scv::Hydra::ActiveFedora::AGGREGATOR_TYPE.to_s)
13
13
  @metadata_is_dirty = true
14
- update
14
+ self.save
15
15
  end
16
16
 
17
17
  def add_member(member, container=self)
18
- if container.respond_to?:internal_uri
19
- container = container.internal_uri
20
- end
21
- if container =~ /\A[\w\-]+:[\w\-]+\Z/
22
- container = "info:fedora/#{container}"
23
- end
24
- member.add_relationship(:cul_member_of, container)
18
+ member.add_relationship(:cul_member_of, to_uri(container))
25
19
  member.datastreams["RELS-EXT"].content_will_change!
26
20
  member.save
27
21
  end
28
22
 
29
23
  def remove_member(member, container=self)
30
- if container.respond_to?:internal_uri
31
- container = container.internal_uri
32
- end
33
- if container =~ /\A[\w\-]+:[\w\-]+\Z/
34
- container = "info:fedora/#{container}"
35
- end
36
24
  rel = ActiveFedora::Relationship.new()
37
25
  rel.subject_pid= :self
38
- rel.object = container
26
+ rel.object = to_uri(container)
39
27
  rel.predicate = :cul_member_of
40
28
  member.remove_relationship(rel)
41
29
  member.datastreams["RELS-EXT"].content_will_change!
42
30
  member.save
43
31
  end
32
+
33
+ private
34
+ def to_uri(obj)
35
+ if obj.respond_to? :internal_uri
36
+ return obj.internal_uri
37
+ end
38
+ obj = obj.pid unless obj.is_a? String
39
+ if obj.is_a? String and obj =~ /\A[\w\-]+:[\w\-]+\Z/
40
+ obj = "info:fedora/#{obj}"
41
+ end
42
+ return obj
43
+ end
44
44
  end
45
45
  end
@@ -1,7 +1,7 @@
1
1
  module Cul
2
2
  module Scv
3
3
  module Hydra
4
- VERSION = '0.9.0'
4
+ VERSION = '0.10.0'
5
5
  def self.version
6
6
  VERSION
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_scv_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-21 00:00:00.000000000 Z
12
+ date: 2014-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight
@@ -32,17 +32,17 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ~>
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: '6.1'
37
+ version: 6.7.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ~>
43
+ - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: '6.1'
45
+ version: 6.7.0
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: hydra-head
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
- version: 0.1.3
69
+ version: '0'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.1.3
77
+ version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: active_fedora_relsint
80
80
  requirement: !ruby/object:Gem::Requirement