cul_scv_hydra 0.14.1 → 0.14.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzMzNjljZWE0ZmY3OGNiMjM5ZjU1MzZmMmI0N2E3OWMwODVlYzcxOQ==
4
+ OGNiMWVjMGJkNjg5NzdlOTQ0MWViODRlNjE0YTc1YzcxODQxYTcxNg==
5
5
  data.tar.gz: !binary |-
6
- MzNlYTljNmJjNjE3YjU1ZDAzYzg1NmI3MmZlODVmOWQwOTM3NDU3YQ==
6
+ ZDZmZWZhMzQwOGJkY2RjYmM0ZDg2Y2QxMjA2MTRjZDA2NjE2YWU5Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2NjN2EyNmZmMWQ1YjE1MmQ0ZTJiZDc4MGZhNDc3NDkzNzY1YTI2NGZhNTVk
10
- NTBkODBlODhlZWUwMDYxMTVkOWU3MWQ0NWIwNjYwNjZiZjBhZGNjNWUwYjMw
11
- NTQ5M2NjNDY5MzQxNzY1NGNhNTQ1ZTk2YzQ3ZDRkODA4ZDA1NzM=
9
+ NjlmZTg3YjdmODlhYWI1OGFkOTM3ZDFjNTI3N2I2NmVkNmUyNDJlOWRiNjlh
10
+ YjFmZGQwNThjNGY3ZmZlNWM3ZGZhODNlZjlhMjc0NjExYzAxODMyODg4MzQ4
11
+ ZGY4Y2FkMjRmYTAwZWExYjFjMDMzYTdhNTRiMTY1NGMxYTdmMjk=
12
12
  data.tar.gz: !binary |-
13
- MmQ2Mjk1NDE2ODUxN2ZlODgyYjNhNDA3Yzc3OWZiMWVkMTlhM2ZmNzlmYmVi
14
- MmI3OWY0YWVjMGZmOThjNjEzNGM0YThhMDI3Yzk3ZjA3ODExMDI3ODdiNTQz
15
- NjViZWM4OThlOGJkYzIzYThhNDFkZDcxOGQ4MmVlNDI0MTg0MmM=
13
+ YmViODEyNGFjMzBiNzYzYmYyODkwZDdlMjMwMTMwMTEwMjdiYjY0MTVlZTk0
14
+ OGIwYjBjMjYwNGVhNDcyMGQ5MjViNjI4ODE0Y2VjODg1OWJhY2FhNmEzMmFl
15
+ MzU3NTlkYWE4NjliNDhjZTI1N2VmMjFjYjI2MTg1NzcyMzE4NmY=
@@ -10,6 +10,12 @@ module Cul
10
10
  def new_record?
11
11
  @isNew
12
12
  end
13
+ def new_record=(val)
14
+ @isNew = val
15
+ end
16
+ def internal_uri
17
+ @uri ||= "info:fedora/#{@pid}"
18
+ end
13
19
  def connection
14
20
  Cul::Scv::Fedora.connection
15
21
  end
@@ -17,7 +23,7 @@ module Cul
17
23
  Cul::Scv::Fedora.repository
18
24
  end
19
25
  def spawn(pid)
20
- s = DummyObject.new(pid)
26
+ s = DummyObject.new(pid, @isNew)
21
27
  s.connection= connection
22
28
  s.repository= repository
23
29
  s
@@ -1,7 +1,7 @@
1
1
  module Cul
2
2
  module Scv
3
3
  module Hydra
4
- VERSION = '0.14.1'
4
+ VERSION = '0.14.2'
5
5
  def self.version
6
6
  VERSION
7
7
  end
data/lib/cul_scv_hydra.rb CHANGED
@@ -29,8 +29,13 @@ module Cul
29
29
  def self.ds_for_uri(fedora_uri, fake_obj=nil)
30
30
  return nil unless fedora_uri =~ /info\:fedora\/.*/
31
31
  p = fedora_uri.split('/')
32
- fake_obj = fake_obj.nil? ? DummyObject.new(p[1]) : fake_obj.spawn(p[1])
33
- ::Rubydora::Datastream.new(fake_obj, p[2])
32
+ return ds_for_opts({pid: p[1], dsid: p[2]})
33
+ end
34
+
35
+ def self.ds_for_opts(opts={}, fake_obj=nil)
36
+ return nil unless opts[:pid] and opts[:dsid]
37
+ fake_obj = fake_obj.nil? ? DummyObject.new(opts[:pid]) : fake_obj.spawn(opts[:pid])
38
+ return (opts[:class] || ::Rubydora::Datastream).new(fake_obj, opts[:dsid])
34
39
  end
35
40
  end
36
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_scv_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Armintor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-14 00:00:00.000000000 Z
11
+ date: 2014-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blacklight