speedy-af 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +17 -13
- data/Rakefile +9 -0
- data/lib/speedy_af/base.rb +6 -3
- data/lib/speedy_af/version.rb +1 -1
- data/spec/integration/base_spec.rb +10 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fd6d0ac71c3da9c7807fe63bf98774a75abf4796130be797e19a9eba4ac6292
|
4
|
+
data.tar.gz: 549a1835b24011c7ebebef142654afb7c8ab0afdd0b70e39a713e7e1c9055dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50e4f754a2f59937b4d08a3ccd9d460e64ecbba50d1e5eed821a28fcb77aab99f77a62307c9185269d27ac1f0baab58e72f8e56cc9debbab71bd99c2c54700e5
|
7
|
+
data.tar.gz: f0f1e0fd4e04f475085ada08769cf9617a95f6ddcd2b0955cea44adc91284844862d0c3c6729c9bc17c32ba456067e448d83c81be9899520003b5dea3b142ed1
|
data/.circleci/config.yml
CHANGED
@@ -10,7 +10,7 @@ jobs:
|
|
10
10
|
type: string
|
11
11
|
bundler_version:
|
12
12
|
type: string
|
13
|
-
default: 2.
|
13
|
+
default: 2.5.18
|
14
14
|
ffmpeg_version:
|
15
15
|
type: string
|
16
16
|
default: 4.1.4
|
@@ -38,18 +38,22 @@ workflows:
|
|
38
38
|
ci:
|
39
39
|
jobs:
|
40
40
|
- bundle_and_test:
|
41
|
-
name: "
|
42
|
-
ruby_version: "
|
43
|
-
rails_version: "7.
|
41
|
+
name: "ruby3-3_rails7-2"
|
42
|
+
ruby_version: "3.3.4"
|
43
|
+
rails_version: "7.2.1"
|
44
44
|
- bundle_and_test:
|
45
|
-
name: "
|
46
|
-
ruby_version: "2.
|
47
|
-
rails_version: "
|
45
|
+
name: "ruby3-2_rails7-1"
|
46
|
+
ruby_version: "3.2.5"
|
47
|
+
rails_version: "7.1.4"
|
48
48
|
- bundle_and_test:
|
49
|
-
name: "
|
50
|
-
ruby_version: "
|
51
|
-
rails_version: "
|
49
|
+
name: "ruby3-1_rails7-1"
|
50
|
+
ruby_version: "3.1.6"
|
51
|
+
rails_version: "7.1.4"
|
52
52
|
- bundle_and_test:
|
53
|
-
name: "
|
54
|
-
ruby_version: "2.
|
55
|
-
rails_version: "
|
53
|
+
name: "ruby3-2_rails7-0"
|
54
|
+
ruby_version: "3.2.5"
|
55
|
+
rails_version: "7.0.8.4"
|
56
|
+
- bundle_and_test:
|
57
|
+
name: "ruby3-1_rails7-0"
|
58
|
+
ruby_version: "3.1.6"
|
59
|
+
rails_version: "7.0.8.4"
|
data/Rakefile
CHANGED
@@ -5,6 +5,15 @@ require 'active_fedora/rake_support'
|
|
5
5
|
require 'bundler'
|
6
6
|
Bundler::GemHelper.install_tasks
|
7
7
|
|
8
|
+
# This is to fix a breaking change with Ruby 3.2 where some methods
|
9
|
+
# in fcrepo_wrapper use the removed `File.exists?` alias, preventing
|
10
|
+
# tests from being set up.
|
11
|
+
class File
|
12
|
+
class << self
|
13
|
+
alias exists? exist?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
8
17
|
require 'rspec/core/rake_task'
|
9
18
|
desc 'Run tests only'
|
10
19
|
RSpec::Core::RakeTask.new(:rspec) do |spec|
|
data/lib/speedy_af/base.rb
CHANGED
@@ -42,11 +42,11 @@ module SpeedyAF
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def find(id, opts = {})
|
45
|
-
where(%(id:"#{id}"), opts).first
|
45
|
+
where(%(id:"#{id}"), opts.merge(rows: 1)).first
|
46
46
|
end
|
47
47
|
|
48
48
|
def where(query, opts = {})
|
49
|
-
docs = ActiveFedora::SolrService.query(query, rows: SOLR_ALL)
|
49
|
+
docs = ActiveFedora::SolrService.query(query, rows: opts[:rows] || SOLR_ALL)
|
50
50
|
from(docs, opts)
|
51
51
|
end
|
52
52
|
|
@@ -92,7 +92,10 @@ module SpeedyAF
|
|
92
92
|
|
93
93
|
def query_for_belongs_to(proxy_hash, _opts)
|
94
94
|
proxy_hash.collect do |_id, proxy|
|
95
|
-
proxy.belongs_to_reflections.collect
|
95
|
+
proxy.belongs_to_reflections.collect do |_name, reflection|
|
96
|
+
id = proxy.attrs[predicate_for_reflection(reflection).to_sym]
|
97
|
+
id.blank? ? nil : "id:#{id}"
|
98
|
+
end.compact
|
96
99
|
end.flatten.join(" OR ")
|
97
100
|
end
|
98
101
|
|
data/lib/speedy_af/version.rb
CHANGED
@@ -61,7 +61,7 @@ describe SpeedyAF::Base do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
it '.to_query' do
|
64
|
-
expect(book.to_query('book_id')).to eq("book_id=#{URI.
|
64
|
+
expect(book.to_query('book_id')).to eq("book_id=#{URI::Parser.new.escape(book.id, /[^\-_.!~*'()a-zA-Z\d;?:@&=+$,\[\]]/)}")
|
65
65
|
end
|
66
66
|
|
67
67
|
context 'reflections' do
|
@@ -105,6 +105,15 @@ describe SpeedyAF::Base do
|
|
105
105
|
expect(book_presenter).not_to be_real
|
106
106
|
end
|
107
107
|
|
108
|
+
context 'missing parent id' do
|
109
|
+
let(:book) { Book.new title: 'Ordered Things', publisher: 'ActiveFedora Performance LLC', library: nil }
|
110
|
+
it 'does not cause belongs_to reflections to error' do
|
111
|
+
expect(book_presenter.library_id).to be_nil
|
112
|
+
expect(book_presenter.library).to be_nil
|
113
|
+
expect(book_presenter).not_to be_real
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
108
117
|
context 'preloaded subresources' do
|
109
118
|
let(:book_presenter) { described_class.find(book.id, load_reflections: true) }
|
110
119
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speedy-af
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael B. Klein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active-fedora
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
- !ruby/object:Gem::Version
|
227
227
|
version: '0'
|
228
228
|
requirements: []
|
229
|
-
rubygems_version: 3.
|
229
|
+
rubygems_version: 3.5.16
|
230
230
|
signing_key:
|
231
231
|
specification_version: 4
|
232
232
|
summary: Performance enhancements for ActiveFedora
|