traject_plus 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/traject_plus/extraction.rb +2 -1
- data/lib/traject_plus/indexer/step.rb +3 -9
- data/lib/traject_plus/version.rb +1 -1
- data/traject_plus.gemspec +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 873866bd201a052750b757ecca8d09143f37c15b
|
4
|
+
data.tar.gz: a84652bf1ec85b3b848617fc87d508f08e57f97d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebe6e8309618503d8458018c3de708d4d4ecf4845c07ec8380bfeb398112c8cb99ccfec58bd082ea97241b62fe5c7a50688eefd92e5a01948898052a5a3ee616
|
7
|
+
data.tar.gz: dda2f2e692447d709d126ed6518c80b8f971b7b1bb268f977e9a2d7e2e738a35cff832ba74fedc5ea7ddcd4d93d09515238fc12099b8397d01c64c53c314fd0f
|
@@ -37,7 +37,8 @@ module TrajectPlus
|
|
37
37
|
['split', 'concat', 'prepend', 'gsub', 'encode', 'insert'].each do |method|
|
38
38
|
define_method(method) do |values, *args|
|
39
39
|
values.flat_map do |v|
|
40
|
-
|
40
|
+
# Cannot prepend to frozen string; use #dup to effectively unfreeze
|
41
|
+
v.dup.public_send(method, *args)
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
@@ -16,19 +16,13 @@ module TrajectPlus
|
|
16
16
|
false
|
17
17
|
end
|
18
18
|
|
19
|
-
def execute(context)
|
20
|
-
accumulator = super
|
21
|
-
|
22
|
-
add_accumulator_to_context!(accumulator, context)
|
23
|
-
end
|
24
|
-
|
25
19
|
def add_accumulator_to_context!(accumulator, context)
|
26
20
|
self.class.add_accumulator_to_context!(self, field_name, accumulator, context)
|
27
21
|
end
|
28
22
|
|
29
23
|
def self.add_accumulator_to_context!(field, field_name, accumulator, context)
|
30
|
-
accumulator.compact! unless context.settings[
|
31
|
-
return if accumulator.empty? and not (context.settings[
|
24
|
+
accumulator.compact! unless context.settings[ALLOW_NIL_VALUES]
|
25
|
+
return if accumulator.empty? and not (context.settings[ALLOW_EMPTY_FIELDS])
|
32
26
|
|
33
27
|
if field.single?
|
34
28
|
context.output_hash[field_name] = accumulator.first if accumulator.length > 0
|
@@ -36,7 +30,7 @@ module TrajectPlus
|
|
36
30
|
context.output_hash[field_name] ||= []
|
37
31
|
|
38
32
|
existing_accumulator = context.output_hash[field_name].concat(accumulator)
|
39
|
-
existing_accumulator.uniq! unless context.settings[
|
33
|
+
existing_accumulator.uniq! unless context.settings[ALLOW_DUPLICATE_VALUES]
|
40
34
|
end
|
41
35
|
end
|
42
36
|
end
|
data/lib/traject_plus/version.rb
CHANGED
data/traject_plus.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_dependency 'activesupport'
|
24
24
|
spec.add_dependency 'jsonpath'
|
25
|
-
spec.add_dependency 'traject'
|
25
|
+
spec.add_dependency 'traject', '~> 2.3', '>= 2.3.4'
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 1.15"
|
28
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traject_plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-12-
|
14
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -45,16 +45,22 @@ dependencies:
|
|
45
45
|
name: traject
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
+
- - "~>"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '2.3'
|
48
51
|
- - ">="
|
49
52
|
- !ruby/object:Gem::Version
|
50
|
-
version:
|
53
|
+
version: 2.3.4
|
51
54
|
type: :runtime
|
52
55
|
prerelease: false
|
53
56
|
version_requirements: !ruby/object:Gem::Requirement
|
54
57
|
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.3'
|
55
61
|
- - ">="
|
56
62
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
63
|
+
version: 2.3.4
|
58
64
|
- !ruby/object:Gem::Dependency
|
59
65
|
name: bundler
|
60
66
|
requirement: !ruby/object:Gem::Requirement
|