fluent-plugin-file-alternative 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3796ea866576055a4dbef203334e70d6df34a31
|
4
|
+
data.tar.gz: 1f555bcb055ca5afdfc8bc263d0c1e564cceee4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8bf1e6f664ad3e757e9a7e529f029ae3a72c962668549ed0c7225dcdfc5c8f3bc790a91d990edb01b7eba46b63d4dc4b230aef4185f9b01e105e3f01fcd2cc8
|
7
|
+
data.tar.gz: ea189049c4a6d50aef172d5d5fcff3fc25b6b36f6d9299c14a4ee394082e60a09d5e7e4e952c42aeec9bd902ed4d2a2303c8e2c633b64fe7c49066cdfd4f4c59
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "fluent-plugin-file-alternative"
|
5
|
-
gem.version = "0.2.
|
5
|
+
gem.version = "0.2.1"
|
6
6
|
|
7
7
|
gem.authors = ["TAGOMORI Satoshi"]
|
8
8
|
gem.email = ["tagomoris@gmail.com"]
|
9
9
|
gem.description = %q{alternative implementation of out_file, with various configurations}
|
10
10
|
gem.summary = %q{alternative implementation of out_file}
|
11
11
|
gem.homepage = "https://github.com/tagomoris/fluent-plugin-file-alternative"
|
12
|
-
gem.license = "
|
12
|
+
gem.license = "Apache-2.0"
|
13
13
|
|
14
14
|
gem.files = `git ls-files`.split($\)
|
15
15
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -29,6 +29,8 @@ class Fluent::FileAlternativeOutput < Fluent::TimeSlicedOutput
|
|
29
29
|
|
30
30
|
config_param :dir_mode, :string, :default => '0777'
|
31
31
|
|
32
|
+
config_param :set_dir_mode, :bool, :default => true
|
33
|
+
|
32
34
|
include Fluent::Mixin::PlainTextFormatter
|
33
35
|
|
34
36
|
def initialize
|
@@ -139,7 +141,9 @@ class Fluent::FileAlternativeOutput < Fluent::TimeSlicedOutput
|
|
139
141
|
|
140
142
|
Pathname.new(path).descend {|p|
|
141
143
|
FileUtils.mkdir_p( File.dirname(p)) unless File.directory?(p)
|
142
|
-
|
144
|
+
if @set_dir_mode
|
145
|
+
FileUtils.chmod @dir_mode.to_i(8), File.dirname(p) unless File.directory?(p)
|
146
|
+
end
|
143
147
|
}
|
144
148
|
|
145
149
|
case @compress
|
@@ -135,6 +135,7 @@ class FileAlternativeOutputTest < Test::Unit::TestCase
|
|
135
135
|
d4 = create_driver %[
|
136
136
|
path #{TMP_DIR}/path_to_test/%Y/%m/%d/accesslog.%Y-%m-%d-%H-%M-%S
|
137
137
|
dir_mode 0700
|
138
|
+
utc
|
138
139
|
]
|
139
140
|
|
140
141
|
time = Time.parse("2011-01-02 13:14:15 UTC").to_i
|
@@ -172,4 +173,21 @@ class FileAlternativeOutputTest < Test::Unit::TestCase
|
|
172
173
|
end
|
173
174
|
end
|
174
175
|
|
176
|
+
def test_disable_chmod
|
177
|
+
d = create_driver %{
|
178
|
+
path #{TMP_DIR}/path_to_test/%Y/%m/%d/accesslog.%Y-%m-%d-%H-%M-%S
|
179
|
+
dir_mode 0700
|
180
|
+
set_dir_mode false
|
181
|
+
utc
|
182
|
+
}
|
183
|
+
time = Time.parse("2011-01-02 13:14:15 UTC").to_i
|
184
|
+
d.emit({"server" => "www01", "level" => "warn", "log" => "Exception\n"}, time)
|
185
|
+
# directory's permission should follow umask, even dir_mode specified
|
186
|
+
dir_mask = (040777 ^ File.umask).to_s(8)
|
187
|
+
path = d.run
|
188
|
+
assert_equal dir_mask, File.stat(File.dirname(File.dirname(File.dirname(path[0])))).mode.to_s(8)
|
189
|
+
assert_equal dir_mask, File.stat(File.dirname(File.dirname(path[0]))).mode.to_s(8)
|
190
|
+
assert_equal dir_mask, File.stat(File.dirname(path[0])).mode.to_s(8)
|
191
|
+
end
|
192
|
+
|
175
193
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-file-alternative
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -85,7 +85,7 @@ files:
|
|
85
85
|
- test/plugin/test_out_file_alternative.rb
|
86
86
|
homepage: https://github.com/tagomoris/fluent-plugin-file-alternative
|
87
87
|
licenses:
|
88
|
-
-
|
88
|
+
- Apache-2.0
|
89
89
|
metadata: {}
|
90
90
|
post_install_message:
|
91
91
|
rdoc_options: []
|