active-fedora 9.9.1 → 9.10.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -2
  3. data/.travis.yml +2 -6
  4. data/active-fedora.gemspec +9 -6
  5. data/lib/active_fedora.rb +31 -15
  6. data/lib/active_fedora/associations.rb +1 -1
  7. data/lib/active_fedora/associations/association.rb +6 -2
  8. data/lib/active_fedora/associations/belongs_to_association.rb +0 -10
  9. data/lib/active_fedora/associations/builder/association.rb +85 -12
  10. data/lib/active_fedora/associations/builder/belongs_to.rb +3 -1
  11. data/lib/active_fedora/associations/builder/collection_association.rb +4 -3
  12. data/lib/active_fedora/associations/builder/contains.rb +7 -2
  13. data/lib/active_fedora/associations/builder/directly_contains.rb +7 -3
  14. data/lib/active_fedora/associations/builder/directly_contains_one.rb +8 -4
  15. data/lib/active_fedora/associations/builder/has_and_belongs_to_many.rb +6 -2
  16. data/lib/active_fedora/associations/builder/has_many.rb +6 -2
  17. data/lib/active_fedora/associations/builder/indirectly_contains.rb +7 -3
  18. data/lib/active_fedora/associations/builder/property.rb +7 -2
  19. data/lib/active_fedora/associations/builder/singular_association.rb +3 -1
  20. data/lib/active_fedora/associations/builder/singular_property.rb +3 -1
  21. data/lib/active_fedora/associations/collection_association.rb +9 -5
  22. data/lib/active_fedora/associations/collection_proxy.rb +1 -1
  23. data/lib/active_fedora/associations/contained_finder.rb +1 -2
  24. data/lib/active_fedora/associations/directly_contains_one_association.rb +1 -1
  25. data/lib/active_fedora/associations/has_many_association.rb +1 -5
  26. data/lib/active_fedora/associations/rdf.rb +1 -20
  27. data/lib/active_fedora/attached_files.rb +1 -1
  28. data/lib/active_fedora/attribute_methods.rb +18 -0
  29. data/lib/active_fedora/attributes.rb +1 -1
  30. data/lib/active_fedora/autosave_association.rb +8 -12
  31. data/lib/active_fedora/base.rb +0 -2
  32. data/lib/active_fedora/caching_connection.rb +1 -1
  33. data/lib/active_fedora/default_model_mapper.rb +24 -0
  34. data/lib/active_fedora/fedora.rb +1 -1
  35. data/lib/active_fedora/file/attributes.rb +4 -5
  36. data/lib/active_fedora/identifiable.rb +5 -0
  37. data/lib/active_fedora/indexing.rb +13 -7
  38. data/lib/active_fedora/indexing_service.rb +4 -4
  39. data/lib/active_fedora/ldp_resource.rb +1 -0
  40. data/lib/active_fedora/model.rb +18 -16
  41. data/lib/active_fedora/model_classifier.rb +77 -0
  42. data/lib/active_fedora/nested_attributes.rb +145 -18
  43. data/lib/active_fedora/persistence.rb +1 -1
  44. data/lib/active_fedora/predicates.rb +3 -0
  45. data/lib/active_fedora/qualified_dublin_core_datastream.rb +1 -1
  46. data/lib/active_fedora/query_result_builder.rb +12 -28
  47. data/lib/active_fedora/querying.rb +1 -1
  48. data/lib/active_fedora/rdf/datastream_indexing.rb +1 -1
  49. data/lib/active_fedora/reflection.rb +15 -7
  50. data/lib/active_fedora/relation.rb +17 -0
  51. data/lib/active_fedora/relation/calculations.rb +1 -5
  52. data/lib/active_fedora/relation/finder_methods.rb +39 -26
  53. data/lib/active_fedora/scoping.rb +5 -0
  54. data/lib/active_fedora/scoping/default.rb +113 -0
  55. data/lib/active_fedora/scoping/named.rb +11 -3
  56. data/lib/active_fedora/simple_datastream.rb +1 -1
  57. data/lib/active_fedora/solr_hit.rb +71 -0
  58. data/lib/active_fedora/solr_instance_loader.rb +12 -36
  59. data/lib/active_fedora/solr_query_builder.rb +20 -25
  60. data/lib/active_fedora/solr_service.rb +24 -13
  61. data/lib/active_fedora/type.rb +8 -0
  62. data/lib/active_fedora/type/boolean.rb +23 -0
  63. data/lib/active_fedora/type/value.rb +118 -0
  64. data/lib/active_fedora/validations.rb +14 -5
  65. data/lib/active_fedora/version.rb +1 -1
  66. data/lib/active_fedora/versionable.rb +8 -7
  67. data/spec/config_helper.rb +0 -5
  68. data/spec/integration/associations_spec.rb +5 -5
  69. data/spec/integration/base_spec.rb +4 -4
  70. data/spec/integration/bug_spec.rb +0 -1
  71. data/spec/integration/full_featured_model_spec.rb +4 -4
  72. data/spec/integration/has_and_belongs_to_many_associations_spec.rb +1 -1
  73. data/spec/integration/has_many_associations_spec.rb +30 -1
  74. data/spec/integration/indirect_container_spec.rb +1 -1
  75. data/spec/integration/nested_attribute_spec.rb +6 -0
  76. data/spec/integration/ntriples_datastream_spec.rb +4 -4
  77. data/spec/integration/om_datastream_spec.rb +1 -1
  78. data/spec/integration/relation_delegation_spec.rb +1 -1
  79. data/spec/integration/scoped_query_spec.rb +12 -12
  80. data/spec/integration/solr_hit_spec.rb +52 -0
  81. data/spec/samples/hydra-mods_article_datastream.rb +2 -2
  82. data/spec/spec_helper.rb +5 -9
  83. data/spec/unit/active_fedora_spec.rb +0 -26
  84. data/spec/unit/base_spec.rb +20 -0
  85. data/spec/unit/builder/has_and_belongs_to_many_spec.rb +2 -3
  86. data/spec/unit/callback_spec.rb +3 -8
  87. data/spec/unit/default_model_mapper_spec.rb +39 -0
  88. data/spec/unit/finder_methods_spec.rb +30 -6
  89. data/spec/unit/has_many_association_spec.rb +23 -1
  90. data/spec/unit/indexing_spec.rb +17 -3
  91. data/spec/unit/model_classifier_spec.rb +49 -0
  92. data/spec/unit/model_spec.rb +0 -9
  93. data/spec/unit/ntriples_datastream_spec.rb +16 -16
  94. data/spec/unit/om_datastream_spec.rb +7 -7
  95. data/spec/unit/qualified_dublin_core_datastream_spec.rb +1 -1
  96. data/spec/unit/query_result_builder_spec.rb +4 -10
  97. data/spec/unit/query_spec.rb +28 -28
  98. data/spec/unit/rdf/indexing_service_spec.rb +16 -16
  99. data/spec/unit/scoping_spec.rb +67 -0
  100. data/spec/unit/simple_datastream_spec.rb +2 -2
  101. data/spec/unit/solr_config_options_spec.rb +29 -32
  102. data/spec/unit/solr_hit_spec.rb +58 -0
  103. data/spec/unit/solr_query_builder_spec.rb +9 -1
  104. data/spec/unit/solr_service_spec.rb +19 -3
  105. metadata +73 -17
  106. data/spec/support/freeze_mocks.rb +0 -12
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.9.1
4
+ version: 9.10.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
@@ -10,13 +10,16 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-03-05 00:00:00.000000000 Z
13
+ date: 2016-03-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
22
+ - - ">="
20
23
  - !ruby/object:Gem::Version
21
24
  version: 1.0.10
22
25
  type: :runtime
@@ -24,8 +27,25 @@ dependencies:
24
27
  version_requirements: !ruby/object:Gem::Requirement
25
28
  requirements:
26
29
  - - "~>"
30
+ - !ruby/object:Gem::Version
31
+ version: '1.0'
32
+ - - ">="
27
33
  - !ruby/object:Gem::Version
28
34
  version: 1.0.10
35
+ - !ruby/object:Gem::Dependency
36
+ name: solrizer
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '3.4'
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.4'
29
49
  - !ruby/object:Gem::Dependency
30
50
  name: om
31
51
  requirement: !ruby/object:Gem::Requirement
@@ -60,14 +80,40 @@ dependencies:
60
80
  requirements:
61
81
  - - ">="
62
82
  - !ruby/object:Gem::Version
63
- version: 4.1.0
83
+ version: '4.2'
84
+ - - "<"
85
+ - !ruby/object:Gem::Version
86
+ version: '6'
87
+ type: :runtime
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '4.2'
94
+ - - "<"
95
+ - !ruby/object:Gem::Version
96
+ version: '6'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activemodel
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '4.2'
104
+ - - "<"
105
+ - !ruby/object:Gem::Version
106
+ version: '6'
64
107
  type: :runtime
65
108
  prerelease: false
66
109
  version_requirements: !ruby/object:Gem::Requirement
67
110
  requirements:
68
111
  - - ">="
69
112
  - !ruby/object:Gem::Version
70
- version: 4.1.0
113
+ version: '4.2'
114
+ - - "<"
115
+ - !ruby/object:Gem::Version
116
+ version: '6'
71
117
  - !ruby/object:Gem::Dependency
72
118
  name: active-triples
73
119
  requirement: !ruby/object:Gem::Requirement
@@ -130,14 +176,14 @@ dependencies:
130
176
  requirements:
131
177
  - - "~>"
132
178
  - !ruby/object:Gem::Version
133
- version: 0.4.0
179
+ version: 0.5.0
134
180
  type: :runtime
135
181
  prerelease: false
136
182
  version_requirements: !ruby/object:Gem::Requirement
137
183
  requirements:
138
184
  - - "~>"
139
185
  - !ruby/object:Gem::Version
140
- version: 0.4.0
186
+ version: 0.5.0
141
187
  - !ruby/object:Gem::Dependency
142
188
  name: rdoc
143
189
  requirement: !ruby/object:Gem::Requirement
@@ -170,16 +216,16 @@ dependencies:
170
216
  name: rake
171
217
  requirement: !ruby/object:Gem::Requirement
172
218
  requirements:
173
- - - ">="
219
+ - - "~>"
174
220
  - !ruby/object:Gem::Version
175
- version: '0'
221
+ version: '10.0'
176
222
  type: :development
177
223
  prerelease: false
178
224
  version_requirements: !ruby/object:Gem::Requirement
179
225
  requirements:
180
- - - ">="
226
+ - - "~>"
181
227
  - !ruby/object:Gem::Version
182
- version: '0'
228
+ version: '10.0'
183
229
  - !ruby/object:Gem::Dependency
184
230
  name: solr_wrapper
185
231
  requirement: !ruby/object:Gem::Requirement
@@ -256,14 +302,14 @@ dependencies:
256
302
  requirements:
257
303
  - - "~>"
258
304
  - !ruby/object:Gem::Version
259
- version: 0.7.1
305
+ version: '0.8'
260
306
  type: :development
261
307
  prerelease: false
262
308
  version_requirements: !ruby/object:Gem::Requirement
263
309
  requirements:
264
310
  - - "~>"
265
311
  - !ruby/object:Gem::Version
266
- version: 0.7.1
312
+ version: '0.8'
267
313
  - !ruby/object:Gem::Dependency
268
314
  name: rubocop
269
315
  requirement: !ruby/object:Gem::Requirement
@@ -390,6 +436,7 @@ files:
390
436
  - lib/active_fedora/datastream.rb
391
437
  - lib/active_fedora/datastreams.rb
392
438
  - lib/active_fedora/datastreams/nokogiri_datastreams.rb
439
+ - lib/active_fedora/default_model_mapper.rb
393
440
  - lib/active_fedora/delegated_attribute.rb
394
441
  - lib/active_fedora/errors.rb
395
442
  - lib/active_fedora/fedora.rb
@@ -418,6 +465,7 @@ files:
418
465
  - lib/active_fedora/locale/en.yml
419
466
  - lib/active_fedora/log_subscriber.rb
420
467
  - lib/active_fedora/model.rb
468
+ - lib/active_fedora/model_classifier.rb
421
469
  - lib/active_fedora/nested_attributes.rb
422
470
  - lib/active_fedora/nom_datastream.rb
423
471
  - lib/active_fedora/null_relation.rb
@@ -462,11 +510,15 @@ files:
462
510
  - lib/active_fedora/scoping/named.rb
463
511
  - lib/active_fedora/serialization.rb
464
512
  - lib/active_fedora/simple_datastream.rb
513
+ - lib/active_fedora/solr_hit.rb
465
514
  - lib/active_fedora/solr_instance_loader.rb
466
515
  - lib/active_fedora/solr_query_builder.rb
467
516
  - lib/active_fedora/solr_service.rb
468
517
  - lib/active_fedora/sparql_insert.rb
469
518
  - lib/active_fedora/test_support.rb
519
+ - lib/active_fedora/type.rb
520
+ - lib/active_fedora/type/boolean.rb
521
+ - lib/active_fedora/type/value.rb
470
522
  - lib/active_fedora/validations.rb
471
523
  - lib/active_fedora/version.rb
472
524
  - lib/active_fedora/versionable.rb
@@ -579,6 +631,7 @@ files:
579
631
  - spec/integration/relation_delegation_spec.rb
580
632
  - spec/integration/relation_spec.rb
581
633
  - spec/integration/scoped_query_spec.rb
634
+ - spec/integration/solr_hit_spec.rb
582
635
  - spec/integration/solr_instance_loader_spec.rb
583
636
  - spec/integration/versionable_spec.rb
584
637
  - spec/integration/with_metadata_spec.rb
@@ -591,7 +644,6 @@ files:
591
644
  - spec/spec.opts
592
645
  - spec/spec_helper.rb
593
646
  - spec/support/an_active_model.rb
594
- - spec/support/freeze_mocks.rb
595
647
  - spec/unit/active_fedora_spec.rb
596
648
  - spec/unit/association_hash_spec.rb
597
649
  - spec/unit/attached_files_spec.rb
@@ -611,6 +663,7 @@ files:
611
663
  - spec/unit/core/fedora_id_translator_spec.rb
612
664
  - spec/unit/core/fedora_uri_translator_spec.rb
613
665
  - spec/unit/core_spec.rb
666
+ - spec/unit/default_model_mapper_spec.rb
614
667
  - spec/unit/fedora_spec.rb
615
668
  - spec/unit/file_configurator_spec.rb
616
669
  - spec/unit/file_path_builder_spec.rb
@@ -628,6 +681,7 @@ files:
628
681
  - spec/unit/ldp_resource_spec.rb
629
682
  - spec/unit/loadable_from_json_spec.rb
630
683
  - spec/unit/logger_spec.rb
684
+ - spec/unit/model_classifier_spec.rb
631
685
  - spec/unit/model_spec.rb
632
686
  - spec/unit/nom_datastream_spec.rb
633
687
  - spec/unit/ntriples_datastream_spec.rb
@@ -651,9 +705,11 @@ files:
651
705
  - spec/unit/rspec_matchers/have_many_associated_active_fedora_objects_matcher_spec.rb
652
706
  - spec/unit/rspec_matchers/have_predicate_matcher_spec.rb
653
707
  - spec/unit/schema_indexing_strategy_spec.rb
708
+ - spec/unit/scoping_spec.rb
654
709
  - spec/unit/serializers_spec.rb
655
710
  - spec/unit/simple_datastream_spec.rb
656
711
  - spec/unit/solr_config_options_spec.rb
712
+ - spec/unit/solr_hit_spec.rb
657
713
  - spec/unit/solr_query_builder_spec.rb
658
714
  - spec/unit/solr_service_spec.rb
659
715
  - spec/unit/sparql_insert_spec.rb
@@ -669,14 +725,14 @@ require_paths:
669
725
  - lib
670
726
  required_ruby_version: !ruby/object:Gem::Requirement
671
727
  requirements:
672
- - - ">="
728
+ - - "~>"
673
729
  - !ruby/object:Gem::Version
674
- version: 1.9.3
730
+ version: '2.0'
675
731
  required_rubygems_version: !ruby/object:Gem::Requirement
676
732
  requirements:
677
- - - ">="
733
+ - - ">"
678
734
  - !ruby/object:Gem::Version
679
- version: '0'
735
+ version: 1.3.1
680
736
  requirements: []
681
737
  rubyforge_project:
682
738
  rubygems_version: 2.5.1
@@ -1,12 +0,0 @@
1
- # Don't raise errors if the object is frozen.
2
- # Work around a bug in rspec-mocks 2.14.4
3
- # https://github.com/rspec/rspec-mocks/issues/494
4
- RSpec::Mocks::MethodDouble.class_eval do
5
- alias_method :original_restore_original_method, :restore_original_method
6
- def restore_original_method
7
- original_restore_original_method
8
- rescue => e
9
- raise e unless object_singleton_class.frozen?
10
- Kernel.warn "Unable to remove stub method #{@method_name} because the object was frozen"
11
- end
12
- end