fluent-plugin-mongo 1.2.1 → 1.2.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: 892fbaf245b427435db3ebb4edaa6e4681d5fd07
4
- data.tar.gz: de0b7e9b1b054e02819f5242888361bb4ebbf8a5
3
+ metadata.gz: eedc0d2a61f67e0ef0e8e4b36066e1e0491d263d
4
+ data.tar.gz: d4bec2e33837adc3dda2a54cfe270ac82f6ad805
5
5
  SHA512:
6
- metadata.gz: 9193319af1591a3b21b5ceeb1c98155434f41cb01ad5125fe6bb3dfaea30bd40d4fbea868421f38f85fccb30f8eea1480f912c84ddeea3f2415b3b2f6520e45a
7
- data.tar.gz: c486200f457c322e6c0350dfba0191776dac3909b85cf5e46547c705680ccae5c9b19be2857e7076c00f195e7d93528698bebd8aa7e76d81f1fa27d78ef536ca
6
+ metadata.gz: f1b9d8b626bd916c3837465430535bb598487cf3742bb52da05b28ca13198d0b98591a1c399923426e59c15f35cb4b47c5a53e23630555c532854b827dbbb6e1
7
+ data.tar.gz: '085554829eaa6becd079dafa4bbc61ad6f9122f93aba4c39e9f2eb0d8f186e37e0a2ae775cb32c71af4351ac24166eb5b4eec4ed764202fa8858e1183176cd05'
@@ -13,7 +13,8 @@ services:
13
13
  - mongodb
14
14
 
15
15
  before_install:
16
- - gem update --system
16
+ - gem update --system=2.7.8
17
+
17
18
  before_script:
18
19
  - git submodule update -i
19
20
 
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Release 1.2.2 - 2019/04/01
2
+
3
+ * out_mongo: Don't handle database placholders when specifying connection_string parameter
4
+
1
5
  Release 1.2.1 - 2018/12/18
2
6
 
3
7
  * out_mongo_replset: Fix internal signature mismatch
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.2.2
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  gem.require_paths = ['lib']
19
19
 
20
- gem.add_dependency "fluentd", [">= 0.14.12", "< 2"]
20
+ gem.add_dependency "fluentd", [">= 0.14.22", "< 2"]
21
21
  gem.add_runtime_dependency "mongo", "~> 2.6.0"
22
22
  gem.add_development_dependency "rake", ">= 0.9.2"
23
23
  gem.add_development_dependency "simplecov", ">= 0.5.4"
@@ -172,8 +172,9 @@ module Fluent::Plugin
172
172
  end
173
173
 
174
174
  def write(chunk)
175
- collection_name = extract_placeholders(@collection, chunk.metadata)
176
- database_name = extract_placeholders(@database, chunk.metadata)
175
+ collection_name = extract_placeholders(@collection, chunk)
176
+ # In connection_string case, we shouldn't handle extract_placeholers for @database.
177
+ database_name = extract_placeholders(@database, chunk) unless @connection_string
177
178
  operate(database_name, format_collection_name(collection_name), collect_records(chunk))
178
179
  end
179
180
 
@@ -183,6 +183,27 @@ class MongoOutputTest < ::Test::Unit::TestCase
183
183
  assert_equal(expected, actual_documents)
184
184
  end
185
185
 
186
+ def test_write_with_connection_string
187
+ d = create_driver(%[
188
+ @type mongo
189
+ connection_string mongodb://localhost:#{port}/#{database_name}
190
+ collection #{collection_name}
191
+ capped
192
+ capped_size 100
193
+ ])
194
+ assert_equal("mongodb://localhost:#{port}/#{database_name}", d.instance.connection_string)
195
+ assert_nil d.instance.database
196
+
197
+ d.run(default_tag: 'test') do
198
+ emit_documents(d)
199
+ end
200
+ actual_documents = get_documents
201
+ time = event_time("2011-01-02 13:14:15 UTC")
202
+ expected = [{'a' => 1, d.instance.inject_config.time_key => Time.at(time).localtime},
203
+ {'a' => 2, d.instance.inject_config.time_key => Time.at(time).localtime}]
204
+ assert_equal(expected, actual_documents)
205
+ end
206
+
186
207
  class WriteWithCollectionPlaceholder < self
187
208
  def setup
188
209
  @tag = 'custom'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Nakagawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2019-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.12
19
+ version: 0.14.22
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.14.12
29
+ version: 0.14.22
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2'