active-fedora 3.1.0.pre12 → 3.1.0.pre13
Sign up to get free protection for your applications and to get access to all the features.
@@ -42,13 +42,14 @@ module ActiveFedora
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# Create an RDF statement
|
45
|
-
# @param
|
45
|
+
# @param uri a string represending the subject
|
46
46
|
# @param predicate a predicate symbol
|
47
47
|
# @param target an object to store
|
48
|
-
def build_statement(
|
49
|
-
raise "Not allowed anymore" if
|
48
|
+
def build_statement(uri, predicate, target)
|
49
|
+
raise "Not allowed anymore" if uri == :self
|
50
|
+
raise "Doesn't seem to be a URI(#{uri})" unless /^info/.match(uri)
|
50
51
|
target = target.internal_uri if target.respond_to? :internal_uri
|
51
|
-
subject = RDF::URI.new(
|
52
|
+
subject = RDF::URI.new(uri) #TODO cache
|
52
53
|
begin
|
53
54
|
literal = URI.parse(target).scheme.nil?
|
54
55
|
rescue URI::InvalidURIError
|
@@ -147,7 +148,10 @@ module ActiveFedora
|
|
147
148
|
end
|
148
149
|
|
149
150
|
def relationships
|
150
|
-
@subject
|
151
|
+
unless @subject
|
152
|
+
raise "Must have internal_uri" unless internal_uri
|
153
|
+
@subject = RDF::URI.new(internal_uri)
|
154
|
+
end
|
151
155
|
@relationships ||= RDF::Graph.new
|
152
156
|
load_relationships if !relationships_loaded
|
153
157
|
@relationships
|
@@ -31,7 +31,7 @@ task :hudson do
|
|
31
31
|
Rake::Task["active_fedora:doc"].invoke
|
32
32
|
Rake::Task["active_fedora:configure_jetty"].invoke
|
33
33
|
jetty_params = Jettywrapper.load_config
|
34
|
-
jetty_params[:startup_wait]=
|
34
|
+
jetty_params[:startup_wait]= 30
|
35
35
|
error = Jettywrapper.wrap(jetty_params) do
|
36
36
|
Rake::Task["active_fedora:load_fixtures"].invoke
|
37
37
|
Rake::Task["active_fedora:rspec"].invoke
|
@@ -9,6 +9,9 @@ class SpecNode2
|
|
9
9
|
include ActiveFedora::SemanticNode
|
10
10
|
|
11
11
|
attr_accessor :pid
|
12
|
+
def internal_uri
|
13
|
+
'info:fedora/' + pid.to_s
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
describe ActiveFedora::SemanticNode do
|
@@ -34,6 +37,9 @@ describe ActiveFedora::SemanticNode do
|
|
34
37
|
def initialize (params={})
|
35
38
|
self.pid = params[:pid]
|
36
39
|
end
|
40
|
+
def internal_uri
|
41
|
+
'info:fedora/' + pid.to_s
|
42
|
+
end
|
37
43
|
end
|
38
44
|
|
39
45
|
class AudioRecord
|
@@ -41,6 +47,9 @@ describe ActiveFedora::SemanticNode do
|
|
41
47
|
def initialize (params={})
|
42
48
|
self.pid = params[:pid]
|
43
49
|
end
|
50
|
+
def internal_uri
|
51
|
+
'info:fedora/' + pid.to_s
|
52
|
+
end
|
44
53
|
end
|
45
54
|
|
46
55
|
@node = SpecNode.new
|
@@ -367,7 +376,6 @@ describe ActiveFedora::SemanticNode do
|
|
367
376
|
local_node = SpecNode.new
|
368
377
|
mock_repo = mock("repo")
|
369
378
|
mock_repo.expects(:find_model).never
|
370
|
-
local_node.stubs(:internal_uri)
|
371
379
|
local_node.expects(:rels_ext).returns(stub('rels-ext', :content=>''))
|
372
380
|
ActiveFedora::SolrService.instance.conn.expects(:query).returns(solr_result)
|
373
381
|
local_node.constituents(:response_format => :solr).should equal(solr_result)
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1923832003
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
9
|
- 0
|
10
10
|
- pre
|
11
|
-
-
|
12
|
-
version: 3.1.0.
|
11
|
+
- 13
|
12
|
+
version: 3.1.0.pre13
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Matt Zumwalt
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-10-
|
21
|
+
date: 2011-10-27 00:00:00 -05:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|