active-fedora 9.0.0.rc3 → 9.0.0
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.
- checksums.yaml +4 -4
- data/History.txt +1054 -0
- data/active-fedora.gemspec +1 -1
- data/config/predicate_mappings.yml +2 -2
- data/lib/active_fedora.rb +3 -0
- data/lib/active_fedora/attached_files.rb +31 -14
- data/lib/active_fedora/base.rb +2 -0
- data/lib/active_fedora/caching_connection.rb +80 -0
- data/lib/active_fedora/callbacks.rb +13 -14
- data/lib/active_fedora/core.rb +9 -17
- data/lib/active_fedora/errors.rb +1 -1
- data/lib/active_fedora/fedora.rb +5 -1
- data/lib/active_fedora/file.rb +42 -39
- data/lib/active_fedora/ldp_cache.rb +46 -0
- data/lib/active_fedora/ldp_resource_service.rb +27 -0
- data/lib/active_fedora/loadable_from_json.rb +3 -1
- data/lib/active_fedora/log_subscriber.rb +38 -0
- data/lib/active_fedora/persistence.rb +22 -12
- data/lib/active_fedora/predicates.rb +3 -3
- data/lib/active_fedora/railtie.rb +3 -0
- data/lib/active_fedora/rdf.rb +0 -1
- data/lib/active_fedora/relation/finder_methods.rb +2 -3
- data/lib/active_fedora/validations.rb +1 -3
- data/lib/active_fedora/version.rb +1 -1
- data/lib/generators/active_fedora/config/solr/templates/jetty.yml +3 -2
- data/spec/fixtures/rails_root/config/predicate_mappings.yml +2 -2
- data/spec/integration/associations_spec.rb +19 -19
- data/spec/integration/attached_files_spec.rb +3 -3
- data/spec/integration/belongs_to_association_spec.rb +9 -9
- data/spec/integration/caching_spec.rb +59 -0
- data/spec/integration/collection_association_spec.rb +1 -1
- data/spec/integration/fedora_solr_sync_spec.rb +2 -2
- data/spec/integration/file_spec.rb +41 -43
- data/spec/integration/has_and_belongs_to_many_associations_spec.rb +8 -8
- data/spec/integration/has_many_associations_spec.rb +15 -15
- data/spec/integration/nested_attribute_spec.rb +2 -2
- data/spec/integration/relation_spec.rb +1 -1
- data/spec/integration/solr_instance_loader_spec.rb +2 -1
- data/spec/samples/special_thing.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- data/spec/unit/attached_files_spec.rb +41 -5
- data/spec/unit/attributes_spec.rb +1 -1
- data/spec/unit/change_set_spec.rb +1 -1
- data/spec/unit/code_configurator_spec.rb +3 -3
- data/spec/unit/core_spec.rb +16 -1
- data/spec/unit/file_spec.rb +14 -10
- data/spec/unit/has_and_belongs_to_many_association_spec.rb +6 -6
- data/spec/unit/has_many_association_spec.rb +4 -4
- data/spec/unit/indexing_service_spec.rb +2 -2
- data/spec/unit/ldp_resource_spec.rb +17 -0
- data/spec/unit/logger_spec.rb +1 -1
- data/spec/unit/persistence_spec.rb +24 -20
- data/spec/unit/predicates_spec.rb +7 -7
- data/spec/unit/sparql_insert_spec.rb +2 -2
- data/spec/unit/validations_spec.rb +12 -2
- metadata +13 -8
- data/lib/active_fedora/rdf/rels_ext.rb +0 -26
@@ -10,7 +10,7 @@ describe ActiveFedora::SparqlInsert do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
class Book < ActiveFedora::Base
|
13
|
-
belongs_to :library, predicate: ActiveFedora::RDF::RelsExt.hasConstituent
|
13
|
+
belongs_to :library, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.hasConstituent
|
14
14
|
property :title, predicate: ::RDF::DC.title
|
15
15
|
end
|
16
16
|
|
@@ -26,7 +26,7 @@ describe ActiveFedora::SparqlInsert do
|
|
26
26
|
|
27
27
|
|
28
28
|
it "should return the string" do
|
29
|
-
expect(subject.build).to eq "DELETE { <> <
|
29
|
+
expect(subject.build).to eq "DELETE { <> <info:fedora/fedora-system:def/relations-external#hasConstituent> ?change . }\n WHERE { <> <info:fedora/fedora-system:def/relations-external#hasConstituent> ?change . } ;\nDELETE { <> <http://purl.org/dc/terms/title> ?change . }\n WHERE { <> <http://purl.org/dc/terms/title> ?change . } ;\nINSERT { \n<> <info:fedora/fedora-system:def/relations-external#hasConstituent> <http://localhost:8983/fedora/rest/test/foo> .\n<> <http://purl.org/dc/terms/title> \"bar\" .\n}\n WHERE { }"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -12,7 +12,7 @@ describe ActiveFedora::Base do
|
|
12
12
|
|
13
13
|
validates_presence_of :fubar
|
14
14
|
validates_length_of :swank, :minimum=>5
|
15
|
-
|
15
|
+
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -26,7 +26,7 @@ describe ActiveFedora::Base do
|
|
26
26
|
before do
|
27
27
|
subject.attributes={ fubar: ['here'], swank:'long enough'}
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
it { should be_valid}
|
31
31
|
end
|
32
32
|
describe "an invalid object" do
|
@@ -44,4 +44,14 @@ describe ActiveFedora::Base do
|
|
44
44
|
it { should be_required(:fubar) }
|
45
45
|
it { should_not be_required(:swank) }
|
46
46
|
end
|
47
|
+
|
48
|
+
|
49
|
+
describe "#save!" do
|
50
|
+
before { allow(subject).to receive(:create_record) } #prevent saving to Fedora/Solr
|
51
|
+
|
52
|
+
it "should validate only once" do
|
53
|
+
expect(subject).to receive(:perform_validations).once.and_return(true)
|
54
|
+
subject.save!
|
55
|
+
end
|
56
|
+
end
|
47
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.0.0
|
4
|
+
version: 9.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-01-
|
13
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -130,14 +130,14 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - "~>"
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.2.
|
133
|
+
version: 0.2.1
|
134
134
|
type: :runtime
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
138
|
- - "~>"
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: 0.2.
|
140
|
+
version: 0.2.1
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: rdf-ldp
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
@@ -318,6 +318,7 @@ files:
|
|
318
318
|
- lib/active_fedora/attributes/serializers.rb
|
319
319
|
- lib/active_fedora/autosave_association.rb
|
320
320
|
- lib/active_fedora/base.rb
|
321
|
+
- lib/active_fedora/caching_connection.rb
|
321
322
|
- lib/active_fedora/callbacks.rb
|
322
323
|
- lib/active_fedora/change_set.rb
|
323
324
|
- lib/active_fedora/cleaner.rb
|
@@ -337,9 +338,12 @@ files:
|
|
337
338
|
- lib/active_fedora/fixity_service.rb
|
338
339
|
- lib/active_fedora/indexing.rb
|
339
340
|
- lib/active_fedora/indexing_service.rb
|
341
|
+
- lib/active_fedora/ldp_cache.rb
|
340
342
|
- lib/active_fedora/ldp_resource.rb
|
343
|
+
- lib/active_fedora/ldp_resource_service.rb
|
341
344
|
- lib/active_fedora/loadable_from_json.rb
|
342
345
|
- lib/active_fedora/locale/en.yml
|
346
|
+
- lib/active_fedora/log_subscriber.rb
|
343
347
|
- lib/active_fedora/model.rb
|
344
348
|
- lib/active_fedora/nested_attributes.rb
|
345
349
|
- lib/active_fedora/nom_datastream.rb
|
@@ -364,7 +368,6 @@ files:
|
|
364
368
|
- lib/active_fedora/rdf/project_hydra.rb
|
365
369
|
- lib/active_fedora/rdf/rdf_datastream.rb
|
366
370
|
- lib/active_fedora/rdf/rdfxml_datastream.rb
|
367
|
-
- lib/active_fedora/rdf/rels_ext.rb
|
368
371
|
- lib/active_fedora/reflection.rb
|
369
372
|
- lib/active_fedora/relation.rb
|
370
373
|
- lib/active_fedora/relation/calculations.rb
|
@@ -436,6 +439,7 @@ files:
|
|
436
439
|
- spec/integration/base_spec.rb
|
437
440
|
- spec/integration/belongs_to_association_spec.rb
|
438
441
|
- spec/integration/bug_spec.rb
|
442
|
+
- spec/integration/caching_spec.rb
|
439
443
|
- spec/integration/collection_association_spec.rb
|
440
444
|
- spec/integration/complex_rdf_datastream_spec.rb
|
441
445
|
- spec/integration/datastream_rdf_nested_attributes_spec.rb
|
@@ -507,6 +511,7 @@ files:
|
|
507
511
|
- spec/unit/indexing_service_spec.rb
|
508
512
|
- spec/unit/indexing_spec.rb
|
509
513
|
- spec/unit/inheritance_spec.rb
|
514
|
+
- spec/unit/ldp_resource_spec.rb
|
510
515
|
- spec/unit/logger_spec.rb
|
511
516
|
- spec/unit/model_spec.rb
|
512
517
|
- spec/unit/nom_datastream_spec.rb
|
@@ -550,12 +555,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
550
555
|
version: 1.9.3
|
551
556
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
552
557
|
requirements:
|
553
|
-
- - "
|
558
|
+
- - ">="
|
554
559
|
- !ruby/object:Gem::Version
|
555
|
-
version:
|
560
|
+
version: '0'
|
556
561
|
requirements: []
|
557
562
|
rubyforge_project:
|
558
|
-
rubygems_version: 2.
|
563
|
+
rubygems_version: 2.2.2
|
559
564
|
signing_key:
|
560
565
|
specification_version: 4
|
561
566
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'rdf'
|
2
|
-
class ActiveFedora::RDF::RelsExt < RDF::StrictVocabulary("http://fedora.info/definitions/v4/rels-ext#")
|
3
|
-
property :hasAnnotation
|
4
|
-
property :hasCollectionMember
|
5
|
-
property :hasConstituent
|
6
|
-
property :hasDependent
|
7
|
-
property :hasDerivation
|
8
|
-
property :hasDescription
|
9
|
-
property :hasEquivalent
|
10
|
-
property :hasExternalContent
|
11
|
-
property :hasMember
|
12
|
-
property :hasMetadata
|
13
|
-
property :hasPart
|
14
|
-
property :hasSubset
|
15
|
-
property :isAnnotationOf
|
16
|
-
property :isConstituentOf
|
17
|
-
property :isDependentOf
|
18
|
-
property :isDerivationOf
|
19
|
-
property :isDescriptionOf
|
20
|
-
property :isExternalContentOf
|
21
|
-
property :isMemberOf
|
22
|
-
property :isMemberOfCollection
|
23
|
-
property :isMetadataFor
|
24
|
-
property :isPartOf
|
25
|
-
property :isSubsetOf
|
26
|
-
end
|