active-fedora 12.1.1 → 12.2.1
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/.circleci/config.yml +20 -26
- data/.solr_wrapper +1 -1
- data/active-fedora.gemspec +0 -1
- data/lib/active_fedora/file.rb +1 -3
- data/lib/active_fedora/indexing.rb +3 -0
- data/lib/active_fedora/indexing/descriptor.rb +1 -1
- data/lib/active_fedora/indexing/field_mapper.rb +2 -2
- data/lib/active_fedora/indexing/suffix.rb +4 -2
- data/lib/active_fedora/rake_support.rb +2 -2
- data/lib/active_fedora/version.rb +1 -1
- data/lib/generators/active_fedora/config/solr/templates/.solr_wrapper.yml +1 -1
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/_rest_managed.json +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/admin-extra.html +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/elevate.xml +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/mapping-ISOLatin1Accent.txt +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/protwords.txt +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/schema.xml +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/scripts.conf +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/solrconfig.xml +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/spellings.txt +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/stopwords.txt +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/stopwords_en.txt +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/synonyms.txt +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/xslt/example.xsl +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/xslt/example_atom.xsl +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/xslt/example_rss.xsl +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/xslt/luke.xsl +0 -0
- data/lib/generators/active_fedora/config/solr/templates/solr_wrapper_test.yml +1 -1
- data/spec/unit/active_fedora/indexing/inserter_spec.rb +5 -0
- data/spec/unit/file_spec.rb +17 -0
- metadata +19 -40
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67b87aed8ed8788a3a2fc65662dc569e0d01f49880795e88c22d120132a57245
|
|
4
|
+
data.tar.gz: dffb8c5c4286c855ba631c2f23ca7bca8c4125eaa937822b1bb5729bb49dd7e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9180480c4806e794130ffb4403dad540e88d197af319fdd709e7f2bd493dc260356eebf87cda17595152e9f2932cdc4dc66844853669af07fd5a2009bae475f3
|
|
7
|
+
data.tar.gz: 362078e96780bd6b3a69aee573e747996969e7fe3abfa119709e67f41f8f7f91be4b883058b2b3472539247d212e832518408f602ca8173024e772268734a529
|
data/.circleci/config.yml
CHANGED
|
@@ -6,15 +6,14 @@ jobs:
|
|
|
6
6
|
parameters:
|
|
7
7
|
ruby_version:
|
|
8
8
|
type: string
|
|
9
|
-
default: 2.5.5
|
|
10
9
|
bundler_version:
|
|
11
10
|
type: string
|
|
12
|
-
default:
|
|
11
|
+
default: 2.0.1
|
|
13
12
|
rails_version:
|
|
14
13
|
type: string
|
|
15
|
-
default: '5.1.6.2'
|
|
16
14
|
solr_config_path:
|
|
17
15
|
type: string
|
|
16
|
+
default: lib/generators/active_fedora/config/solr/templates/solr/conf
|
|
18
17
|
executor:
|
|
19
18
|
name: 'samvera/ruby_fcrepo_solr'
|
|
20
19
|
ruby_version: << parameters.ruby_version >>
|
|
@@ -39,31 +38,26 @@ workflows:
|
|
|
39
38
|
ci:
|
|
40
39
|
jobs:
|
|
41
40
|
- bundle_lint_test:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
rails_version: '4.2.11.1'
|
|
46
|
-
solr_config_path: 'lib/generators/active_fedora/config/solr/templates/solr/config'
|
|
41
|
+
name: ruby2-6_rails5-2
|
|
42
|
+
ruby_version: 2.6.3
|
|
43
|
+
rails_version: 5.2.3
|
|
47
44
|
- bundle_lint_test:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
name: ruby2-5_rails5-2
|
|
46
|
+
ruby_version: 2.5.5
|
|
47
|
+
rails_version: 5.2.3
|
|
51
48
|
- bundle_lint_test:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
name: ruby2-4_rails5-2
|
|
50
|
+
ruby_version: 2.4.6
|
|
51
|
+
rails_version: 5.2.3
|
|
55
52
|
- bundle_lint_test:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
rails_version:
|
|
59
|
-
solr_config_path: 'lib/generators/active_fedora/config/solr/templates/solr/config'
|
|
53
|
+
name: ruby2-6_rails5-1
|
|
54
|
+
ruby_version: 2.6.3
|
|
55
|
+
rails_version: 5.1.7
|
|
60
56
|
- bundle_lint_test:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
rails_version:
|
|
64
|
-
solr_config_path: 'lib/generators/active_fedora/config/solr/templates/solr/config'
|
|
57
|
+
name: ruby2-5_rails5.1
|
|
58
|
+
ruby_version: 2.5.5
|
|
59
|
+
rails_version: 5.1.7
|
|
65
60
|
- bundle_lint_test:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
rails_version:
|
|
69
|
-
solr_config_path: 'lib/generators/active_fedora/config/solr/templates/solr/config'
|
|
61
|
+
name: ruby2-4_rails5-1
|
|
62
|
+
ruby_version: 2.4.6
|
|
63
|
+
rails_version: 5.1.7
|
data/.solr_wrapper
CHANGED
data/active-fedora.gemspec
CHANGED
|
@@ -15,7 +15,6 @@ Gem::Specification.new do |s|
|
|
|
15
15
|
s.required_ruby_version = '~> 2.0'
|
|
16
16
|
|
|
17
17
|
s.add_dependency 'rsolr', '>= 1.1.2', '< 3'
|
|
18
|
-
s.add_dependency 'solrizer', '>= 3.4', '< 5'
|
|
19
18
|
s.add_dependency "activesupport", '>= 4.2.4', '< 5.3'
|
|
20
19
|
s.add_dependency "activemodel", '>= 4.2.10', '< 5.3'
|
|
21
20
|
s.add_dependency "active-triples", '>= 0.11.0', '< 2.0.0'
|
data/lib/active_fedora/file.rb
CHANGED
|
@@ -196,9 +196,7 @@ module ActiveFedora
|
|
|
196
196
|
end
|
|
197
197
|
|
|
198
198
|
def local_or_remote_content(ensure_fetch = true)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
@content ||= ensure_fetch ? remote_content : @ds_content
|
|
199
|
+
@content ||= ensure_fetch ? remote_content : @ds_content unless new_record?
|
|
202
200
|
@content.rewind if behaves_like_io?(@content)
|
|
203
201
|
@content
|
|
204
202
|
end
|
|
@@ -21,6 +21,9 @@ module ActiveFedora
|
|
|
21
21
|
autoload :Suffix
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# Error to be raised for encountering unsupported field types
|
|
25
|
+
class InvalidIndexDescriptor < RuntimeError; end
|
|
26
|
+
|
|
24
27
|
included do
|
|
25
28
|
# Because the previous method of setting indexer was to override
|
|
26
29
|
# the class method, we must ensure that we aren't using the instance
|
|
@@ -9,7 +9,7 @@ module ActiveFedora
|
|
|
9
9
|
@type_required = opts[:requires_type]
|
|
10
10
|
end
|
|
11
11
|
@index_type = args
|
|
12
|
-
raise
|
|
12
|
+
raise InvalidIndexDescriptor, "Invalid index type passed. It should be an array like [:string, :indexed, :stored, :multivalued]. You provided: `#{@index_type}'" unless index_type.is_a? Array
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def name_and_converter(field_name, args = nil)
|
|
@@ -89,7 +89,7 @@ module ActiveFedora
|
|
|
89
89
|
values = (results[name] ||= [])
|
|
90
90
|
values << value unless value.nil? || values.include?(value)
|
|
91
91
|
else
|
|
92
|
-
|
|
92
|
+
Rails.logger.warn "Setting #{name} to `#{value}', but it already had `#{results[name]}'" if results[name]
|
|
93
93
|
results[name] = value
|
|
94
94
|
end
|
|
95
95
|
end
|
|
@@ -111,7 +111,7 @@ module ActiveFedora
|
|
|
111
111
|
when Descriptor
|
|
112
112
|
index_type
|
|
113
113
|
else
|
|
114
|
-
raise
|
|
114
|
+
raise InvalidIndexDescriptor, "#{index_type.class} is not a valid indexer_type. Use a String, Symbol or Descriptor."
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
raise InvalidIndexDescriptor, "index type should be an Descriptor, you passed: #{index_type.class}" unless index_type.is_a? Descriptor
|
|
@@ -28,7 +28,7 @@ module ActiveFedora
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def to_s
|
|
31
|
-
raise
|
|
31
|
+
raise InvalidIndexDescriptor, "Missing datatype for #{@fields}" unless data_type
|
|
32
32
|
|
|
33
33
|
field_suffix = [config.suffix_delimiter]
|
|
34
34
|
|
|
@@ -66,8 +66,10 @@ module ActiveFedora
|
|
|
66
66
|
'b'
|
|
67
67
|
when :long
|
|
68
68
|
'lt'
|
|
69
|
+
when :float, :big_decimal
|
|
70
|
+
'f'
|
|
69
71
|
else
|
|
70
|
-
raise
|
|
72
|
+
raise InvalidIndexDescriptor, "Invalid datatype `#{type.inspect}'. Must be one of: :date, :time, :text, :text_en, :string, :symbol, :integer, :boolean"
|
|
71
73
|
end
|
|
72
74
|
end),
|
|
73
75
|
stored_suffix: 's',
|
|
@@ -16,12 +16,12 @@ def with_server(environment)
|
|
|
16
16
|
|
|
17
17
|
SolrWrapper.wrap(load_config(:solr, environment, solr_defaults)) do |solr|
|
|
18
18
|
ENV["SOLR_#{environment.upcase}_PORT"] = solr.port.to_s
|
|
19
|
-
solr_config_path = File.join('solr', '
|
|
19
|
+
solr_config_path = File.join('solr', 'conf')
|
|
20
20
|
# Check to see if configs exist in a path relative to the working directory
|
|
21
21
|
unless Dir.exist?(solr_config_path)
|
|
22
22
|
$stderr.puts "Solr configuration not found at #{solr_config_path}. Using ActiveFedora defaults"
|
|
23
23
|
# Otherwise use the configs delivered with ActiveFedora.
|
|
24
|
-
solr_config_path = File.join(File.expand_path("../..", File.dirname(__FILE__)), 'lib', 'generators', 'active_fedora', 'config', 'solr', 'templates', 'solr', '
|
|
24
|
+
solr_config_path = File.join(File.expand_path("../..", File.dirname(__FILE__)), 'lib', 'generators', 'active_fedora', 'config', 'solr', 'templates', 'solr', 'conf')
|
|
25
25
|
end
|
|
26
26
|
solr.with_collection(name: "hydra-#{environment}", dir: solr_config_path) do
|
|
27
27
|
FcrepoWrapper.wrap(load_config(:fcrepo, environment, fcrepo_defaults)) do |fcrepo|
|
data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/_rest_managed.json
RENAMED
|
File without changes
|
data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/admin-extra.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/stopwords_en.txt
RENAMED
|
File without changes
|
|
File without changes
|
data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/xslt/example.xsl
RENAMED
|
File without changes
|
data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/xslt/example_atom.xsl
RENAMED
|
File without changes
|
data/lib/generators/active_fedora/config/solr/templates/solr/{config → conf}/xslt/example_rss.xsl
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -27,4 +27,9 @@ RSpec.describe ActiveFedora::Indexing::Inserter do
|
|
|
27
27
|
described_class.create_and_insert_terms('my_name', Date.parse('2013-01-10'), [:sortable], solr_doc)
|
|
28
28
|
expect(solr_doc).to eq('my_name_dti' => '2013-01-10T00:00:00Z')
|
|
29
29
|
end
|
|
30
|
+
|
|
31
|
+
it "handles floating point integers" do
|
|
32
|
+
described_class.create_and_insert_terms('my_number', (6.022140857*10**23).to_f, [:displayable, :searchable], solr_doc)
|
|
33
|
+
expect(solr_doc).to eq('my_number_ssm' => ['6.0221408569999995e+23'], 'my_number_fim' => ['6.0221408569999995e+23'])
|
|
34
|
+
end
|
|
30
35
|
end
|
data/spec/unit/file_spec.rb
CHANGED
|
@@ -192,6 +192,23 @@ describe ActiveFedora::File do
|
|
|
192
192
|
end
|
|
193
193
|
end
|
|
194
194
|
|
|
195
|
+
context 'when file is new and content behaves like io' do
|
|
196
|
+
let(:file_content) { "hello world" }
|
|
197
|
+
|
|
198
|
+
before do
|
|
199
|
+
af_file.uri = "http://localhost:8983/fedora/rest/test/1234/abcd"
|
|
200
|
+
af_file.content = StringIO.new(file_content)
|
|
201
|
+
allow(af_file).to receive(:new_record?).and_return(true)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
describe "#content" do
|
|
205
|
+
it 'can be re-read' do
|
|
206
|
+
expect(af_file.content.read).to eq file_content
|
|
207
|
+
expect(af_file.content.read).to eq file_content
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
195
212
|
describe "#mime_type" do
|
|
196
213
|
let(:parent) { ActiveFedora::Base.create }
|
|
197
214
|
before do
|
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: 12.
|
|
4
|
+
version: 12.2.1
|
|
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:
|
|
13
|
+
date: 2020-01-24 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rsolr
|
|
@@ -32,26 +32,6 @@ dependencies:
|
|
|
32
32
|
- - "<"
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
34
|
version: '3'
|
|
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
|
-
- - "<"
|
|
43
|
-
- !ruby/object:Gem::Version
|
|
44
|
-
version: '5'
|
|
45
|
-
type: :runtime
|
|
46
|
-
prerelease: false
|
|
47
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
48
|
-
requirements:
|
|
49
|
-
- - ">="
|
|
50
|
-
- !ruby/object:Gem::Version
|
|
51
|
-
version: '3.4'
|
|
52
|
-
- - "<"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '5'
|
|
55
35
|
- !ruby/object:Gem::Dependency
|
|
56
36
|
name: activesupport
|
|
57
37
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -574,22 +554,22 @@ files:
|
|
|
574
554
|
- lib/generators/active_fedora/config/solr/solr_generator.rb
|
|
575
555
|
- lib/generators/active_fedora/config/solr/templates/.solr_wrapper.yml
|
|
576
556
|
- lib/generators/active_fedora/config/solr/templates/solr.yml
|
|
577
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
578
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
579
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
580
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
581
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
582
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
583
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
584
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
585
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
586
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
587
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
588
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
589
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
590
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
591
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
592
|
-
- lib/generators/active_fedora/config/solr/templates/solr/
|
|
557
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/_rest_managed.json
|
|
558
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/admin-extra.html
|
|
559
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/elevate.xml
|
|
560
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/mapping-ISOLatin1Accent.txt
|
|
561
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/protwords.txt
|
|
562
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/schema.xml
|
|
563
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/scripts.conf
|
|
564
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/solrconfig.xml
|
|
565
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/spellings.txt
|
|
566
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/stopwords.txt
|
|
567
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/stopwords_en.txt
|
|
568
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/synonyms.txt
|
|
569
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/xslt/example.xsl
|
|
570
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/xslt/example_atom.xsl
|
|
571
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/xslt/example_rss.xsl
|
|
572
|
+
- lib/generators/active_fedora/config/solr/templates/solr/conf/xslt/luke.xsl
|
|
593
573
|
- lib/generators/active_fedora/config/solr/templates/solr_wrapper_test.yml
|
|
594
574
|
- lib/generators/active_fedora/model/USAGE
|
|
595
575
|
- lib/generators/active_fedora/model/model_generator.rb
|
|
@@ -752,8 +732,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
752
732
|
- !ruby/object:Gem::Version
|
|
753
733
|
version: '0'
|
|
754
734
|
requirements: []
|
|
755
|
-
|
|
756
|
-
rubygems_version: 2.7.7
|
|
735
|
+
rubygems_version: 3.0.3
|
|
757
736
|
signing_key:
|
|
758
737
|
specification_version: 4
|
|
759
738
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|