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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69aca3e99ad81702e279a2f87b62498bfa500d34
4
- data.tar.gz: 381ea6164dcef901c9e8086eab86cc621aa9e6e2
3
+ metadata.gz: 873866bd201a052750b757ecca8d09143f37c15b
4
+ data.tar.gz: a84652bf1ec85b3b848617fc87d508f08e57f97d
5
5
  SHA512:
6
- metadata.gz: ea73af5076668db42f5c04b7ecb2840f55c8d5869f3563744b213371500761d897ad7c34aa452628d5c26d0e75097a118609832b06b0853a65fac413fb6129fc
7
- data.tar.gz: 4d27d2554eb9204a7cbd3acba7329558ac3fadbf61591026e8d2ab2b5353e17f8a28b90868cff6d12b027c180d3ad86154ef32d97d92e5b37d065da81ce61d77
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
- v.public_send(method, *args)
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[Traject::Indexer::ALLOW_NIL_VALUES]
31
- return if accumulator.empty? and not (context.settings[Traject::Indexer::ALLOW_EMPTY_FIELDS])
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[Traject::Indexer::ALLOW_DUPLICATE_VALUES]
33
+ existing_accumulator.uniq! unless context.settings[ALLOW_DUPLICATE_VALUES]
40
34
  end
41
35
  end
42
36
  end
@@ -1,3 +1,3 @@
1
1
  module TrajectPlus
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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-04 00:00:00.000000000 Z
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: '0'
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: '0'
63
+ version: 2.3.4
58
64
  - !ruby/object:Gem::Dependency
59
65
  name: bundler
60
66
  requirement: !ruby/object:Gem::Requirement