samvera-nesting_indexer 0.3.1 → 0.3.2
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/.rubocop.yml +3 -0
- data/.travis.yml +3 -9
- data/README.md +4 -4
- data/Rakefile +3 -1
- data/lib/samvera/nesting_indexer/adapters/in_memory_adapter.rb +1 -1
- data/lib/samvera/nesting_indexer/adapters/interface_behavior_spec.rb +3 -3
- data/lib/samvera/nesting_indexer/configuration.rb +1 -2
- data/lib/samvera/nesting_indexer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ad74f407b44bdc3b0ec0662e88cd7e816859102
|
4
|
+
data.tar.gz: 612c1e2e3472b3ebc72403163bbed296824ba2bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ada7bf4240708b933108f6692428ebe4c92d114a0828adc96a9f22e180eb2dcb9a598409cc58f2d0bc27deb2c22bb65344bb76741b248beecd91196b756eb7af
|
7
|
+
data.tar.gz: 15a36430ce0f4500bd51ddce816e71388b9dc799e4e96d3f3c1f2d6d49776e750054866aaa8e9331e8076de308dd70a1d79561d17af46461553527e4cc489ce6
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Samvera::NestingIndexer
|
2
2
|
|
3
|
-
[](https://travis-ci.org/samvera-labs/samvera-nesting_indexer)
|
4
|
+
[](https://codeclimate.com/github/samvera-labs/samvera-nesting_indexer)
|
5
|
+
[](https://codeclimate.com/github/samvera-labs/samvera-nesting_indexer)
|
6
|
+
[](http://inch-ci.org/github/samvera-labs/samvera-nesting_indexer)
|
7
7
|
[](./LICENSE)
|
8
8
|
|
9
9
|
The Samvera::NestingIndexer gem is responsible for indexing the graph relationship of objects. It maps a PreservationDocument to an IndexDocument by mapping a PreservationDocument's direct parents into the paths to get from a root document to the given PreservationDocument.
|
data/Rakefile
CHANGED
@@ -4,7 +4,9 @@ require "rspec/core/rake_task"
|
|
4
4
|
namespace :commitment do
|
5
5
|
require 'rubocop/rake_task'
|
6
6
|
# Why hound? Because hound-ci assumes this file, and perhaps you'll be using this
|
7
|
-
RuboCop::RakeTask.new
|
7
|
+
RuboCop::RakeTask.new do |task|
|
8
|
+
task.options = ['--display-cop-names']
|
9
|
+
end
|
8
10
|
|
9
11
|
task :configure_test_for_code_coverage do
|
10
12
|
ENV['COVERAGE'] = 'true'
|
@@ -27,7 +27,7 @@ module Samvera
|
|
27
27
|
# @api public
|
28
28
|
# @yield Samvera::NestingIndexer::Document::PreservationDocument
|
29
29
|
def self.each_preservation_document(&block)
|
30
|
-
Preservation.find_each { |document|
|
30
|
+
Preservation.find_each { |document| block.call(document) }
|
31
31
|
end
|
32
32
|
|
33
33
|
# @api public
|
@@ -1,8 +1,8 @@
|
|
1
1
|
if defined?(RSpec)
|
2
2
|
RSpec.shared_examples 'a Samvera::NestingIndexer::Adapter' do
|
3
|
-
let(:required_keyword_parameters) { ->(method) { method.parameters.select { |type,
|
4
|
-
let(:required_parameters) { ->(method) { method.parameters.select { |type,
|
5
|
-
let(:block_parameter_extracter) { ->(method) { method.parameters.select { |type,
|
3
|
+
let(:required_keyword_parameters) { ->(method) { method.parameters.select { |type, _kwarg| type == :keyreq }.map(&:last) } }
|
4
|
+
let(:required_parameters) { ->(method) { method.parameters.select { |type, _kwarg| type == :keyreq || type == :req }.map(&:last) } }
|
5
|
+
let(:block_parameter_extracter) { ->(method) { method.parameters.select { |type, _kwarg| type == :block }.map(&:last) } }
|
6
6
|
|
7
7
|
describe '.find_preservation_document_by' do
|
8
8
|
subject { described_class.method(:find_preservation_document_by) }
|
@@ -9,8 +9,7 @@ module Samvera
|
|
9
9
|
class Configuration
|
10
10
|
DEFAULT_MAXIMUM_NESTING_DEPTH = 15
|
11
11
|
|
12
|
-
def initialize(
|
13
|
-
self.adapter = adapter
|
12
|
+
def initialize(maximum_nesting_depth: DEFAULT_MAXIMUM_NESTING_DEPTH)
|
14
13
|
self.maximum_nesting_depth = maximum_nesting_depth
|
15
14
|
end
|
16
15
|
|