blacklight_range_limit 8.2.0 → 8.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/VERSION +1 -1
- data/app/presenters/blacklight_range_limit/filter_field.rb +3 -3
- data/spec/presenters/filter_field_spec.rb +9 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05ea7ff70dd0f999147d9990af32784b0df857878223bab69db8017b48306e28
|
4
|
+
data.tar.gz: 44ce74fe4ec5d225e6da988e20b26710495e468e553e780e4e1e83d318dbf8bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1b66e4213828f0d2e86625e749a4d406217afb46000e3d8b294d0f3921b5451fa8a5647a9c480ad430b76e38aed2e29db0cd1ab550973b0861e24871c16666c
|
7
|
+
data.tar.gz: 729b9a29d7038dab2aa092939dfe83b8503edc1641812ff0f7b692de4fedda649f7d1f18b5395ccc61591f83956a0a87fe3dfd0159f717bac947bb2ae86e5f58
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
8.2.
|
1
|
+
8.2.1
|
@@ -55,9 +55,9 @@ module BlacklightRangeLimit
|
|
55
55
|
range = if params.dig(param_key, config.key).is_a? Range
|
56
56
|
params.dig(param_key, config.key)
|
57
57
|
else
|
58
|
-
begins = Array(params.dig(param_key, config.key, :begin)).map(&:
|
59
|
-
ends = Array(params.dig(param_key, config.key, :end)).map(&:
|
60
|
-
begins.zip(ends).map { |b_bound, e_bound| Range.new(b_bound, e_bound) }
|
58
|
+
begins = Array(params.dig(param_key, config.key, :begin)).map(&:presence)
|
59
|
+
ends = Array(params.dig(param_key, config.key, :end)).map(&:presence)
|
60
|
+
begins.zip(ends).map { |b_bound, e_bound| Range.new(b_bound&.to_i, e_bound&.to_i) if b_bound && e_bound }.compact
|
61
61
|
end
|
62
62
|
|
63
63
|
f = except.include?(:filters) ? [] : Array(range)
|
@@ -55,7 +55,16 @@ RSpec.describe BlacklightRangeLimit::FilterField do
|
|
55
55
|
expect(filter.include?(1234..2345)).to eq false
|
56
56
|
end
|
57
57
|
end
|
58
|
+
end
|
59
|
+
|
60
|
+
context 'with missing data' do
|
61
|
+
let(:param_values) { { range: { some_field: { begin: '', end: '' } } } }
|
58
62
|
|
63
|
+
describe '#values' do
|
64
|
+
it 'drops the empty range' do
|
65
|
+
expect(filter.values).to be_empty
|
66
|
+
end
|
67
|
+
end
|
59
68
|
end
|
60
69
|
|
61
70
|
context 'with array-mangled data' do
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_range_limit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.2.
|
4
|
+
version: 8.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
8
8
|
- Chris Beer
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-06-
|
12
|
+
date: 2022-06-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|
@@ -171,7 +171,7 @@ dependencies:
|
|
171
171
|
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '0'
|
174
|
-
description:
|
174
|
+
description:
|
175
175
|
email:
|
176
176
|
- blacklight-development@googlegroups.com
|
177
177
|
executables: []
|
@@ -276,7 +276,7 @@ homepage: https://github.com/projectblacklight/blacklight_range_limit
|
|
276
276
|
licenses:
|
277
277
|
- Apache 2.0
|
278
278
|
metadata: {}
|
279
|
-
post_install_message:
|
279
|
+
post_install_message:
|
280
280
|
rdoc_options: []
|
281
281
|
require_paths:
|
282
282
|
- lib
|
@@ -291,8 +291,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
291
|
- !ruby/object:Gem::Version
|
292
292
|
version: '0'
|
293
293
|
requirements: []
|
294
|
-
rubygems_version: 3.
|
295
|
-
signing_key:
|
294
|
+
rubygems_version: 3.2.32
|
295
|
+
signing_key:
|
296
296
|
specification_version: 4
|
297
297
|
summary: Blacklight Range Limit plugin
|
298
298
|
test_files:
|