fluent-plugin-split 0.0.2 → 0.0.3

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: f8366392d23a53164997a3121b140e32406ca732
4
- data.tar.gz: f5aeab4a8423c52a54ffed4630e81b8c420631b7
3
+ metadata.gz: 3007a375d3d03a9c5a017d93e76a2dbd13f12d8a
4
+ data.tar.gz: 7bb317c9c134dc6a8c03eb48e5797cf71fea37f1
5
5
  SHA512:
6
- metadata.gz: 67f5b41fdc9f3ecb818f0544a19fa1b0c249dfde04c5003477d82a12ba61147deb3881f42dcb5420bf7392f22d9b8201f99791bd9298b21023a7c9f493214a97
7
- data.tar.gz: 7f661bef25beb83b9769238dfaf8c5d4329923f76922c1ae7e4c1593e4079d051e89f63e04cbd454e676cf67179ec1237c62bc22114f1207a1aa9f625280040d
6
+ metadata.gz: f16d3a96fbd9f631a946e31dfcac6bba4acfcf9dcfff0010603492b9dba1feef918f1ed91591407ab3b1a71a2d25c0e6f62716d2e5eb356d126631f88d4ba9fe
7
+ data.tar.gz: 565c624b866ca7f73848d7896a3204784e8fa9b12bb8b33be9c52e35c8d0e5c87b7cf896dc7ffb871dcbf762fb913f855614b2b914a23bc66a292ae38c0d3810
data/.travis.yml CHANGED
@@ -4,3 +4,4 @@ rvm:
4
4
  - 2.0.0
5
5
  gemfile:
6
6
  - Gemfile
7
+ script: "rake spec"
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://secure.travis-ci.org/toyama0919/fluent-plugin-split.png?branch=master)](http://travis-ci.org/toyama0919/fluent-plugin-split)
2
+
1
3
  # fluent-plugin-split
2
4
 
3
5
  Output Split String Plugin for fluentd
@@ -21,11 +23,11 @@ Output Split String Plugin for fluentd
21
23
 
22
24
  param | value
23
25
  --------|------
24
- output_tag|output tag
25
- output_key|output split word key
26
- format|csv or tsv or space
27
- key_name|target key name
28
- keep_keys|keep keys(comma separator)
26
+ output_tag|output tag(require)
27
+ output_key|output split word key(require)
28
+ format|csv or tsv or space(default csv)
29
+ key_name|target key name(require)
30
+ keep_keys|keep keys comma separator(optional)
29
31
 
30
32
  ## Configuration
31
33
 
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "fluent-plugin-split"
6
- gem.version = "0.0.2"
6
+ gem.version = "0.0.3"
7
7
  gem.authors = ["Hiroshi Toyama"]
8
8
  gem.email = "toyama0919@gmail.com"
9
9
  gem.homepage = "https://github.com/toyama0919/fluent-plugin-split"
@@ -18,4 +18,10 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ['lib']
19
19
 
20
20
  gem.add_runtime_dependency "fluentd"
21
+ gem.add_development_dependency "bundler", "~> 1.3"
22
+ gem.add_development_dependency "rake"
23
+ gem.add_development_dependency "rspec"
24
+ gem.add_development_dependency "spork"
25
+ gem.add_development_dependency "pry"
26
+
21
27
  end
@@ -1,3 +1,4 @@
1
+ # -*- encoding : utf-8 -*-
1
2
  module Fluent
2
3
  class SplitOutput < Output
3
4
  Fluent::Plugin.register_output('split', self)
@@ -1,15 +1,74 @@
1
1
  # encoding: UTF-8
2
- require_relative 'spec_helper'
3
-
4
- describe Fluent::SplitOutput do
5
- before { Fluent::Test.setup }
6
- CONFIG = %[
7
- type split
8
- output_tag split.keyword
9
- output_key keyword
10
- format csv
11
- key_name keywords
12
- keep_keys object_type
13
- ]
2
+ require 'spec_helper'
3
+
4
+ class SplitOutputTest < Test::Unit::TestCase
5
+ def setup
6
+ Fluent::Test.setup
7
+ end
8
+
9
+ def create_driver(conf = CONFIG, tag='test')
10
+ d = Fluent::Test::BufferedOutputTestDriver.new(Fluent::SplitOutput, tag).configure(conf)
11
+ d
12
+ end
13
+
14
+ def test_configure_error
15
+ assert_raise(Fluent::ConfigError) {
16
+ d = create_driver %[
17
+ output_key keyword
18
+ format csv
19
+ key_name keywords
20
+ keep_keys site
21
+ ]
22
+ }
23
+
24
+ # not define output_key
25
+ assert_raise(Fluent::ConfigError) {
26
+ d = create_driver %[
27
+ output_tag split.keyword
28
+ format csv
29
+ key_name keywords
30
+ keep_keys site
31
+ ]
32
+ }
33
+
34
+ # not define output_key
35
+ assert_raise(Fluent::ConfigError) {
36
+ d = create_driver %[
37
+ output_key keyword
38
+ output_tag split.keyword
39
+ format csv
40
+ keep_keys site
41
+ ]
42
+ }
43
+
44
+ assert_raise(Fluent::ConfigError) {
45
+ d = create_driver %[
46
+ output_tag split.keyword
47
+ output_key keyword
48
+ ]
49
+ }
50
+
51
+ end
52
+
53
+ def test_configure
54
+ # not define format(default csv)
55
+ assert_nothing_raised(Fluent::ConfigError) {
56
+ d = create_driver %[
57
+ output_tag split.keyword
58
+ output_key keyword
59
+ key_name keywords
60
+ keep_keys site
61
+ ]
62
+ }
63
+
64
+ assert_nothing_raised(Fluent::ConfigError) {
65
+ d = create_driver %[
66
+ output_tag split.keyword
67
+ output_key keyword
68
+ key_name keywords
69
+ ]
70
+ }
71
+
72
+ end
14
73
 
15
74
  end
data/spec/spec_helper.rb CHANGED
@@ -1,13 +1,28 @@
1
- # encoding: UTF-8
2
1
  require 'rubygems'
3
2
  require 'bundler'
4
- Bundler.setup(:default, :test)
5
- Bundler.require(:default, :test)
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
6
11
 
12
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
13
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
14
  require 'fluent/test'
8
- require 'rspec'
9
- require 'pry'
15
+ unless ENV.has_key?('VERBOSE')
16
+ nulllogger = Object.new
17
+ nulllogger.instance_eval {|obj|
18
+ def method_missing(method, *args)
19
+ # pass
20
+ end
21
+ }
22
+ $log = nulllogger
23
+ end
10
24
 
11
- $TESTING=true
12
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
13
25
  require 'fluent/plugin/out_split'
26
+
27
+ class Test::Unit::TestCase
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-split
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Toyama
@@ -14,14 +14,84 @@ dependencies:
14
14
  name: fluentd
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: spork
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
25
95
  - !ruby/object:Gem::Version
26
96
  version: '0'
27
97
  description: Output Split String Plugin for fluentd
@@ -30,9 +100,9 @@ executables: []
30
100
  extensions: []
31
101
  extra_rdoc_files: []
32
102
  files:
33
- - ".gitignore"
34
- - ".rspec"
35
- - ".travis.yml"
103
+ - .gitignore
104
+ - .rspec
105
+ - .travis.yml
36
106
  - CHANGELOG.md
37
107
  - Gemfile
38
108
  - LICENSE
@@ -52,17 +122,17 @@ require_paths:
52
122
  - lib
53
123
  required_ruby_version: !ruby/object:Gem::Requirement
54
124
  requirements:
55
- - - ">="
125
+ - - '>='
56
126
  - !ruby/object:Gem::Version
57
127
  version: '0'
58
128
  required_rubygems_version: !ruby/object:Gem::Requirement
59
129
  requirements:
60
- - - ">="
130
+ - - '>='
61
131
  - !ruby/object:Gem::Version
62
132
  version: '0'
63
133
  requirements: []
64
134
  rubyforge_project:
65
- rubygems_version: 2.2.0.rc.1
135
+ rubygems_version: 2.0.14
66
136
  signing_key:
67
137
  specification_version: 4
68
138
  summary: Output Split String Plugin for fluentd