fluent-plugin-script 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8b7c2a59a03a4142ff2215547ad71758f0e5dd7f
4
- data.tar.gz: e722d96124e96dfedf35b423ab69911053349c4c
2
+ SHA256:
3
+ metadata.gz: ae60a7ee2711c90ea3df3e4e8954e22ccc40199218c5cec818ca1f79376069bf
4
+ data.tar.gz: 571c66c0ee9fd719027210848fb43456e919849d711af14d6a2cf4266282772c
5
5
  SHA512:
6
- metadata.gz: 9851a8d70d497e63d03c9f1d659700cd39a0735ac07017429f5caa82d1780086122e5279302e53a2e218a80d276e4d92b45569252130ec6da8f0db81c029d332
7
- data.tar.gz: de4ac6ced65451d860dbc569a22fdd68cabc05c0653196bfe0994f20bae36ca5157b080092d7d20ba3367539ce80bf7787262121222792fce44ad9d29e23bef0
6
+ metadata.gz: 4ba801812a9ef752f0d4691f61d293ee8e9596a6535464b8c2903a604809a2804cc3694520f2d804b2551cf4710d2c0c1dda59ecfda5c029782d9f8e68ec9b44
7
+ data.tar.gz: 6818b80ebd632abb31d91374a32b530284db33e984ce5a0cb0bc14126842ffce0f1b4f8c82496f672b331d2f3038f0b86d2113e3ee84f47b81ab4ec04576655c
data/README.md CHANGED
@@ -8,7 +8,7 @@ Fluent filter plugin to external ruby script.
8
8
  ## install
9
9
 
10
10
  ``
11
- gem install fluent-plugin-filter-script
11
+ gem install fluent-plugin-script
12
12
  ``
13
13
 
14
14
  ### Requirements
@@ -52,6 +52,21 @@ end
52
52
 
53
53
  ref. http://docs.fluentd.org/articles/plugin-development#filter-plugins
54
54
 
55
+ #### Setting default directory
56
+
57
+ By setting the `FLUENT_PLUGIN_SCRIPT_DIR` environment variable, you can specify the default directory where scripts are located and access them without specifying the full path.
58
+
59
+ ```bash
60
+ FLUENT_PLUGIN_SCRIPT_DIR="/etc/fluentd/"
61
+ ```
62
+
63
+ ```
64
+ <filter foo.bar.*>
65
+ type script
66
+ path example.rb
67
+ </filter>
68
+ ```
69
+
55
70
  ## Example
56
71
 
57
72
  #### example.rb
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "fluent-plugin-script"
3
- s.version = "0.1.0"
3
+ s.version = "0.2.0"
4
4
  s.licenses = ["MIT"]
5
5
  s.summary = "Fluentd filter plugin to external ruby script"
6
6
  s.description = s.summary
@@ -12,6 +12,6 @@ Gem::Specification.new do |s|
12
12
  s.require_paths = ["lib"]
13
13
 
14
14
  s.add_runtime_dependency "fluentd", [">= 0.14.0", "< 2"]
15
- s.add_development_dependency "rake", "~> 10.4.2"
15
+ s.add_development_dependency "rake", ">= 12.3.3"
16
16
  s.add_development_dependency "test-unit", "~> 3.1.3"
17
17
  end
@@ -12,6 +12,7 @@ module Fluent::Plugin
12
12
  end
13
13
 
14
14
  def load_script_file(path)
15
+ path = "#{ENV['FLUENT_PLUGIN_SCRIPT_DIR']}/#{path}" if path[0] != '/' && ENV['FLUENT_PLUGIN_SCRIPT_DIR']
15
16
  raise Fluent::ConfigError, "Ruby script file does not exist: #{path}" unless File.exist?(path)
16
17
  eval "self.instance_eval do;" + IO.read(path) + ";\nend"
17
18
  end
@@ -28,6 +28,11 @@ class RubyFilterTest < Test::Unit::TestCase
28
28
  conf = "path #{__dir__}/example.rb"
29
29
  assert_nothing_raised { create_driver(conf) }
30
30
  end
31
+ test 'file exist with FLUENT_PLUGIN_SCRIPT_DIR' do
32
+ ENV['FLUENT_PLUGIN_SCRIPT_DIR'] = __dir__
33
+ conf = 'path example.rb'
34
+ assert_nothing_raised { create_driver(conf) }
35
+ end
31
36
  end
32
37
 
33
38
  sub_test_case 'filter' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-script
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SNakano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-21 00:00:00.000000000 Z
11
+ date: 2024-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -34,16 +34,16 @@ dependencies:
34
34
  name: rake
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 10.4.2
39
+ version: 12.3.3
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 10.4.2
46
+ version: 12.3.3
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: test-unit
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -95,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubyforge_project:
99
- rubygems_version: 2.2.0
98
+ rubygems_version: 3.0.3.1
100
99
  signing_key:
101
100
  specification_version: 4
102
101
  summary: Fluentd filter plugin to external ruby script