fluent-plugin-file-alternative 0.2.0 → 0.2.1

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
2
  SHA1:
3
- metadata.gz: ea52057a062ad50131a6e1cf865c06c7bb8b69d2
4
- data.tar.gz: efd08dcdc758d6f6ffab1b1767ecf613ea9a7cc9
3
+ metadata.gz: d3796ea866576055a4dbef203334e70d6df34a31
4
+ data.tar.gz: 1f555bcb055ca5afdfc8bc263d0c1e564cceee4c
5
5
  SHA512:
6
- metadata.gz: c78ef8f78cb7cbaf29ae78287beaba67d6267624599b3116bf9aa69050a158175e5fba4ec50c125ed9adb1a959f398dd20e55aa0e32d6b231b651023e9bb6f30
7
- data.tar.gz: 3d618956f885a15c80984cec1da9425783e8332fa3912bc0218e56e3b6c5d8a30a705865e271cc9c02055b1279d1affe0819d2dd0e116616bbd9f2590ed67f3f
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.0"
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 = "APLv2"
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
- FileUtils.chmod @dir_mode.to_i(8), File.dirname(p) unless File.directory?(p)
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.0
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-01-16 00:00:00.000000000 Z
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
- - APLv2
88
+ - Apache-2.0
89
89
  metadata: {}
90
90
  post_install_message:
91
91
  rdoc_options: []