active-fedora 10.1.0 → 10.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87658dd9989ef6b9dcb8e43ec5b1cd5d7cb05348
4
- data.tar.gz: 86e4e8778223f2c8716cfafa305da4a6b1fc6e4c
3
+ metadata.gz: edd51836aa6c45e18a108d020753474a74b39a8a
4
+ data.tar.gz: 467181b690984218af00de00f2d0644e6d059601
5
5
  SHA512:
6
- metadata.gz: 240c154b9a54a470c1837752ec2763d2cec77ecdee788e9e82f75c48175f39d56cf8e71ee90ffa4a4c3ef8b4df25341a5755640cfa20a1c89b46d442a7d113fa
7
- data.tar.gz: 50c233379480b07d252afdb6192721fdded0235ff776f579049b619961c9986f14b82bef9b9192261639664d1abc9d8b1af012ef30e240b8aa130ad8db9fda65
6
+ metadata.gz: 9b8c013c28881485042b14d79d37ec2123fcc8e2647ede3fe9c99875afc3d02dbc1e797405c1b355f271c480e3303f6790df3f8f494cafc068aa25d19a59f46b
7
+ data.tar.gz: 8e8ea6f566fcc5f4067be91e28f5d4e594a711a623dae5364445cc52f3fdc017063e8f568f2d53a62e740f2856633fabf52b50a09df1ca3b7f8439d44d844b8c
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency "activemodel", '>= 4.2', '< 6'
23
23
  s.add_dependency "active-triples", '~> 0.7.1'
24
24
  s.add_dependency "rdf-rdfxml", '~> 1.1'
25
- s.add_dependency "linkeddata"
26
25
  s.add_dependency "deprecation"
27
26
  s.add_dependency "ldp", '~> 0.5.0'
28
27
 
@@ -25,12 +25,12 @@ module ActiveFedora
25
25
 
26
26
  def find_or_initialize_target(&block)
27
27
  if reflection.klass < ActiveFedora::File
28
- reflection.build_association(target_uri, &block)
28
+ reflection.build_association(id: target_uri, &block)
29
29
  else
30
30
  reflection.klass.find(target_uri)
31
31
  end
32
32
  rescue ActiveFedora::ObjectNotFoundError
33
- reflection.build_association(target_uri, &block)
33
+ reflection.build_association(id: target_uri, &block)
34
34
  end
35
35
 
36
36
  def replace(record)
@@ -22,7 +22,7 @@ module ActiveFedora
22
22
  def self.find_or_initialize(id)
23
23
  find(id)
24
24
  rescue ActiveFedora::ObjectNotFoundError
25
- new(id)
25
+ new(id: id)
26
26
  end
27
27
 
28
28
  private
@@ -2,6 +2,7 @@ module ActiveFedora
2
2
  module Core
3
3
  extend ActiveSupport::Autoload
4
4
  extend ActiveSupport::Concern
5
+ extend Deprecation
5
6
  include ActiveFedora::Common
6
7
 
7
8
  autoload :FedoraIdTranslator
@@ -148,6 +149,7 @@ module ActiveFedora
148
149
  def initialize_attributes(attributes_or_id)
149
150
  case attributes_or_id
150
151
  when String
152
+ Deprecation.warn(Core, "calling #{self.class}.new with a string is deprecated. Pass a hash with id instead.")
151
153
  attributes = { id: attributes_or_id }.with_indifferent_access
152
154
  when Hash
153
155
  attributes = attributes_or_id.with_indifferent_access
@@ -30,7 +30,7 @@ module ActiveFedora
30
30
  # @yield [self] Yields self
31
31
  # @yieldparam [File] self the newly created file
32
32
  def initialize(identifier = nil, &_block)
33
- identifier = nil if identifier.is_a? Hash
33
+ identifier = identifier.delete(:id) if identifier.is_a? Hash
34
34
  run_callbacks(:initialize) do
35
35
  case identifier
36
36
  when nil, ::RDF::URI
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "10.1.0".freeze
2
+ VERSION = "10.2.0".freeze
3
3
  end
@@ -17,11 +17,11 @@
17
17
  -->
18
18
 
19
19
  <!--
20
- This is a stripped down config file used for a simple example...
21
- It is *not* a good example to work from.
20
+ This is a stripped down config file used for a simple example...
21
+ It is *not* a good example to work from.
22
22
  -->
23
23
  <config>
24
-
24
+
25
25
  <!-- Controls what version of Lucene various components of Solr
26
26
  adhere to. Generally, you want to use the latest version to
27
27
  get all bug fixes and improvements. It is highly recommended
@@ -29,30 +29,29 @@
29
29
  affect both how text is indexed and queried.
30
30
  -->
31
31
  <luceneMatchVersion>5.0.0</luceneMatchVersion>
32
-
32
+
33
33
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
34
34
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
35
35
  <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
36
36
  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
37
37
 
38
- <directoryFactory name="DirectoryFactory"
38
+ <directoryFactory name="DirectoryFactory"
39
39
  class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
40
- </directoryFactory>
40
+ </directoryFactory>
41
41
 
42
42
  <codecFactory class="solr.SchemaCodecFactory"/>
43
43
 
44
44
  <schemaFactory class="ClassicIndexSchemaFactory"/>
45
45
 
46
-
47
46
  <dataDir>${solr.blacklight-core.data.dir:}</dataDir>
48
-
47
+
49
48
  <requestDispatcher handleSelect="true" >
50
49
  <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048000" />
51
50
  </requestDispatcher>
52
-
51
+
53
52
  <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
54
53
 
55
- <!-- config for the admin interface -->
54
+ <!-- config for the admin interface -->
56
55
  <admin>
57
56
  <defaultQuery>*:*</defaultQuery>
58
57
  </admin>
@@ -187,10 +186,21 @@
187
186
  </lst>
188
187
  </requestHandler>
189
188
 
189
+ <searchComponent name="termsComponent" class="solr.TermsComponent" />
190
+
191
+ <requestHandler name="/terms" class="solr.SearchHandler">
192
+ <lst name="defaults">
193
+ <bool name="terms">true</bool>
194
+ </lst>
195
+ <arr name="components">
196
+ <str>termsComponent</str>
197
+ </arr>
198
+ </requestHandler>
199
+
190
200
  <!-- Spell Check
191
201
 
192
202
  The spell check component can return a list of alternative spelling
193
- suggestions.
203
+ suggestions.
194
204
 
195
205
  http://wiki.apache.org/solr/SpellCheckComponent
196
206
  -->
@@ -245,7 +255,7 @@
245
255
  </lst>
246
256
  -->
247
257
 
248
- <!-- a spellchecker that use an alternate comparator
258
+ <!-- a spellchecker that use an alternate comparator
249
259
 
250
260
  comparatorClass be one of:
251
261
  1. score (default)
@@ -308,4 +318,3 @@
308
318
  <!-- </lst> -->
309
319
  </requestHandler>
310
320
  </config>
311
-
@@ -19,7 +19,7 @@ describe ActiveFedora::Base do
19
19
  end
20
20
  context "in a typical sitation" do
21
21
  specify "it cannot be reused" do
22
- expect { described_class.create(ghost) }.to raise_error(Ldp::Gone)
22
+ expect { described_class.create(id: ghost) }.to raise_error(Ldp::Gone)
23
23
  end
24
24
  end
25
25
  specify "remove its tombstone" do
@@ -123,7 +123,7 @@ EOF
123
123
  subject.destroy
124
124
  end
125
125
 
126
- subject { RdfTest.new('/test:99') }
126
+ subject { RdfTest.new(id: '/test:99') }
127
127
 
128
128
  it "writes rdf with proper subjects" do
129
129
  subject.reload
@@ -141,6 +141,7 @@ describe ActiveFedora::Base do
141
141
 
142
142
  context "with an id argument" do
143
143
  it "is able to create with a custom id" do
144
+ expect(Deprecation).to receive(:warn)
144
145
  expect(FooHistory).to receive(:id_to_uri).and_call_original
145
146
  f = FooHistory.new('baz_1')
146
147
  expect(f.id).to eq 'baz_1'
@@ -18,7 +18,7 @@ describe ActiveFedora::Associations::HasAndBelongsToManyAssociation do
18
18
  Object.send(:remove_const, :Book)
19
19
  Object.send(:remove_const, :Page)
20
20
  end
21
- subject { Book.new('subject-a') }
21
+ subject { Book.new(id: 'subject-a') }
22
22
 
23
23
  context "a one way relationship " do
24
24
  describe "adding memeber" do
@@ -12,8 +12,8 @@ describe ActiveFedora::Associations::HasManyAssociation do
12
12
  Object.send(:remove_const, :Book)
13
13
  Object.send(:remove_const, :Page)
14
14
  end
15
- let(:book) { Book.new('subject-a') }
16
- let(:page) { Page.new('object-b') }
15
+ let(:book) { Book.new(id: 'subject-a') }
16
+ let(:page) { Page.new(id: 'object-b') }
17
17
 
18
18
  describe "setting the foreign key" do
19
19
  before do
@@ -35,7 +35,7 @@ RSpec.describe ActiveFedora::Orders::ListNode do
35
35
  end
36
36
  context "and it doesn't exist" do
37
37
  it "returns an AT::Resource" do
38
- member = Member.new("testing")
38
+ member = Member.new(id: "testing")
39
39
  graph << [rdf_subject, RDF::Vocab::ORE.proxyFor, member.resource.rdf_subject]
40
40
  expect(subject.target.rdf_subject).to eq member.uri
41
41
  end
@@ -128,9 +128,9 @@ describe ActiveFedora::Base do
128
128
  .and_return('response' => { 'docs' => mock_docs })
129
129
 
130
130
  allow(relation).to receive(:load_from_fedora).with("changeme-30", nil)
131
- .and_return(SpecModel::Basic.new('changeme-30'))
131
+ .and_return(SpecModel::Basic.new(id: 'changeme-30'))
132
132
  allow(relation).to receive(:load_from_fedora).with("changeme-22", nil)
133
- .and_return(SpecModel::Basic.new('changeme-22'))
133
+ .and_return(SpecModel::Basic.new(id: 'changeme-22'))
134
134
  SpecModel::Basic.find_each { |obj| obj.class == SpecModel::Basic }
135
135
  end
136
136
 
@@ -144,8 +144,8 @@ describe ActiveFedora::Base do
144
144
  let(:mock_docs) { [{ "id" => "changeme-30" }, { "id" => "changeme-22" }] }
145
145
 
146
146
  it "filters by the provided fields" do
147
- expect(relation).to receive(:load_from_fedora).with("changeme-30", nil).and_return(SpecModel::Basic.new('changeme-30'))
148
- expect(relation).to receive(:load_from_fedora).with("changeme-22", nil).and_return(SpecModel::Basic.new('changeme-22'))
147
+ expect(relation).to receive(:load_from_fedora).with("changeme-30", nil).and_return(SpecModel::Basic.new(id: 'changeme-30'))
148
+ expect(relation).to receive(:load_from_fedora).with("changeme-22", nil).and_return(SpecModel::Basic.new(id: 'changeme-22'))
149
149
 
150
150
  expect(mock_docs).to receive(:has_next?).and_return(false)
151
151
  expect(solr).to receive(:paginate).with(1, 1000, 'select', expected_params).and_return('response' => { 'docs' => mock_docs })
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: 10.1.0
4
+ version: 10.2.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: 2016-07-29 00:00:00.000000000 Z
13
+ date: 2016-08-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr
@@ -142,20 +142,6 @@ dependencies:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
144
  version: '1.1'
145
- - !ruby/object:Gem::Dependency
146
- name: linkeddata
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - ">="
150
- - !ruby/object:Gem::Version
151
- version: '0'
152
- type: :runtime
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - ">="
157
- - !ruby/object:Gem::Version
158
- version: '0'
159
145
  - !ruby/object:Gem::Dependency
160
146
  name: deprecation
161
147
  requirement: !ruby/object:Gem::Requirement
@@ -782,3 +768,4 @@ signing_key:
782
768
  specification_version: 4
783
769
  summary: A convenience libary for manipulating documents in the Fedora Repository.
784
770
  test_files: []
771
+ has_rdoc: