act-fluent-logger-rails 0.6.0 → 0.6.4

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
- SHA1:
3
- metadata.gz: 7d902898eefca5581ae67b14013df2f2e9e9c261
4
- data.tar.gz: 4971a8ca703b77495e12422db08dd136799827df
2
+ SHA256:
3
+ metadata.gz: bb748e74cfb1f32ac69cadea7c313c718a61d2bc43f145058bfd422360ecac7d
4
+ data.tar.gz: b907cd807d165589c574c43c0327a563337642c9b68d589189437b5b1718bdf9
5
5
  SHA512:
6
- metadata.gz: 2546af248a240f448f9357cb636190f2e160665a9ce8a02e74141ca491f8945138fbbaa735bb6ff24db74127bb6c47b077954820c8d99eaa6ffe4ed7d55d9434
7
- data.tar.gz: 22d449f71d50989a3ee924b2f6b48c0f475b0adcdb39f7f1a009570b49e7031b3d01d16aab484533b33f6ec0979ea6401e631ff75b63d45ea756c146d4331820
6
+ metadata.gz: '04853d8847ba5915d11dcbf0b5833a0e50802905f8b56c94a4cfb02974c3dfb9747db07dd1bdd5347f14db8542e1c38ff9a68584b28685a2f1bf49a3bde4f58d'
7
+ data.tar.gz: 638eefe4822c6e41e878e2e0dbb69c5cde63079dcd85740423836fad68144512f808375205e936c4e97e9e90a35ab6394c6f91998156a5f156093c08bf4db421
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ fail-fast: false
9
+ matrix:
10
+ os: [ubuntu-latest]
11
+ ruby: [2.4, 2.5, 2.6, 2.7, 3.0, 3.1, head]
12
+ gemfile: [rails_5_0, rails_5_1, rails_5_2, rails_6_0, rails_6_1, rails_7_0]
13
+ exclude:
14
+ - ruby: 2.4
15
+ gemfile: rails_6_0
16
+ - ruby: 2.4
17
+ gemfile: rails_6_1
18
+ - ruby: 2.4
19
+ gemfile: rails_7_0
20
+ - ruby: 2.5
21
+ gemfile: rails_7_0
22
+ - ruby: 2.6
23
+ gemfile: rails_7_0
24
+ runs-on: ${{ matrix.os }}
25
+ env:
26
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
27
+ steps:
28
+ - uses: actions/checkout@v2
29
+ - name: Set up Ruby
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby }}
33
+ bundler-cache: true
34
+ - name: Test
35
+ run: |
36
+ bundle exec rake spec
data/.gitignore CHANGED
@@ -7,6 +7,7 @@
7
7
  /vendor
8
8
  Gemfile.lock
9
9
  gemfiles/*.lock
10
+ gemfiles/vendor
10
11
  InstalledFiles
11
12
  _yardoc
12
13
  coverage
data/Appraisals CHANGED
@@ -1,34 +1,29 @@
1
- appraise 'rails-4.0' do
2
- gem 'railties', '4.0.13'
3
- gem 'activesupport', '4.0.13'
4
- end
5
-
6
- appraise 'rails-4.1' do
7
- gem 'railties', '4.1.16'
8
- gem 'activesupport', '4.1.16'
9
- end
10
-
11
- appraise 'rails-4.2' do
12
- gem 'railties', '4.2.8'
13
- gem 'activesupport', '4.2.8'
14
- end
15
-
16
- appraise 'rails-5.0' do
1
+ appraise 'rails-5_0' do
17
2
  gem 'railties', '5.0.2'
18
3
  gem 'activesupport', '5.0.2'
19
4
  end
20
5
 
21
- appraise 'rails-5.1' do
6
+ appraise 'rails-5_1' do
22
7
  gem 'railties', '5.1.0'
23
8
  gem 'activesupport', '5.1.0'
24
9
  end
25
10
 
26
- appraise 'rails-5.2' do
11
+ appraise 'rails-5_2' do
27
12
  gem 'railties', '5.2.0'
28
13
  gem 'activesupport', '5.2.0'
29
14
  end
30
15
 
31
- appraise 'rails-6.0' do
32
- gem 'railties', '6.0.0.beta2'
33
- gem 'activesupport', '6.0.0.beta2'
16
+ appraise 'rails-6_0' do
17
+ gem 'railties', '6.0.3.4'
18
+ gem 'activesupport', '6.0.3.4'
19
+ end
20
+
21
+ appraise 'rails-6_1' do
22
+ gem 'railties', '6.1.0'
23
+ gem 'activesupport', '6.1.0'
24
+ end
25
+
26
+ appraise 'rails-7_0' do
27
+ gem 'railties', '7.0.2'
28
+ gem 'activesupport', '7.0.2'
34
29
  end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 0.6.4 / Feb 19 2022
2
+ * Rails 7
3
+ * Fix the name of the gemfile used by Appraisal
4
+ * Replace Travis CI with GitHub Actions
5
+
6
+ ## 0.6.3 / Mar 22 2020
7
+ * Support tls_options #63
8
+
9
+ ## 0.6.2 / Jan 8 2020
10
+ * Rails 6.1
11
+
12
+ ## 0.6.1 / Jan 8 2020
13
+ * Fix warning printed when use Rails 6
14
+
1
15
  ## 0.6.0 / Nov 23 2019
2
16
 
3
17
  * Rails 6
data/README.md CHANGED
@@ -4,7 +4,7 @@ Fluent logger.
4
4
 
5
5
  ## Supported versions
6
6
 
7
- * Rails 4, 5, 6
7
+ * Rails 4, 5, 6, 7
8
8
 
9
9
  ## Installation
10
10
 
@@ -89,6 +89,9 @@ Don't use config.log_tags.
89
89
  2013-01-18T15:04:50+09:00 foo {"messages":["Started GET \"/\" for 127.0.0.1 at 2013-01-18 15:04:49 +0900","Processing by TopController#index as HTML","Completed 200 OK in 635ms (Views: 479.3ms | ActiveRecord: 39.6ms)"],"severity":"INFO"}
90
90
  ```
91
91
  * severity_key: The key of severity(DEBUG, INFO, WARN, ERROR).
92
+ * tls_options: A hash of tls options compatible with [fluent-logger-ruby](https://github.com/fluent/fluent-logger-ruby#tls-setting). The simplest being:
93
+ <pre>tls_options:
94
+ use_default_ca: true</pre>
92
95
 
93
96
  You can add any tags at run time.
94
97
 
@@ -113,3 +116,10 @@ ActFluentLoggerRails::Logger.new(flush_immediately: true)
113
116
  3. Commit your changes (`git commit -am 'Add some feature'`)
114
117
  4. Push to the branch (`git push origin my-new-feature`)
115
118
  5. Create new Pull Request
119
+
120
+ ## How to run test with appraisal
121
+ ```
122
+ gem install appraisal
123
+ bundle exec appraisal bundle
124
+ bundle exec appraisal rake
125
+ ```
@@ -20,6 +20,6 @@ Gem::Specification.new do |gem|
20
20
 
21
21
  gem.add_development_dependency "rspec", '~> 3.5.0'
22
22
  gem.add_runtime_dependency "fluent-logger"
23
- gem.add_runtime_dependency "railties", ">= 4", "< 6.1"
24
- gem.add_runtime_dependency "activesupport", ">= 4", "< 6.1"
23
+ gem.add_runtime_dependency "railties", ">= 4"
24
+ gem.add_runtime_dependency "activesupport", ">= 4"
25
25
  end
File without changes
File without changes
File without changes
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "railties", "4.0.13"
7
- gem "activesupport", "4.0.13"
6
+ gem "railties", "6.0.3.4"
7
+ gem "activesupport", "6.0.3.4"
8
8
 
9
9
  gemspec path: "../"
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "railties", "4.2.8"
7
- gem "activesupport", "4.2.8"
6
+ gem "railties", "6.1.0"
7
+ gem "activesupport", "6.1.0"
8
8
 
9
9
  gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "railties", "7.0.2"
7
+ gem "activesupport", "7.0.2"
8
+
9
+ gemspec path: "../"
@@ -2,6 +2,7 @@ require 'fluent-logger'
2
2
  require 'active_support/core_ext'
3
3
  require 'uri'
4
4
  require 'cgi'
5
+ require 'rails/version'
5
6
 
6
7
  module ActFluentLoggerRails
7
8
 
@@ -40,6 +41,7 @@ module ActFluentLoggerRails
40
41
  nanosecond_precision: fluent_config['nanosecond_precision'],
41
42
  messages_type: fluent_config['messages_type'],
42
43
  severity_key: fluent_config['severity_key'],
44
+ tls_options: fluent_config['tls_options']&.transform_keys { |k| k.to_sym }
43
45
  }
44
46
  end
45
47
 
@@ -85,10 +87,11 @@ module ActFluentLoggerRails
85
87
  @severity_key = (options[:severity_key] || :severity).to_sym
86
88
  @flush_immediately = options[:flush_immediately]
87
89
  logger_opts = {host: host, port: port, nanosecond_precision: nanosecond_precision}
90
+ logger_opts[:tls_options] = options[:tls_options] unless options[:tls_options].nil?
88
91
  @fluent_logger = ::Fluent::Logger::FluentLogger.new(nil, logger_opts)
89
92
  @severity = 0
90
93
  @log_tags = log_tags
91
- after_initialize if respond_to? :after_initialize
94
+ after_initialize if respond_to?(:after_initialize) && Rails::VERSION::MAJOR < 6
92
95
  end
93
96
 
94
97
  def add(severity, message = nil, progname = nil, &block)
@@ -1,3 +1,3 @@
1
1
  module ActFluentLoggerRails
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.4"
3
3
  end
data/spec/logger_spec.rb CHANGED
@@ -162,6 +162,43 @@ EOF
162
162
  end
163
163
  end
164
164
 
165
+ describe 'tls_options' do
166
+ context 'does not has key' do
167
+ before do
168
+ File.open(@config_file.path, 'w') do |f|
169
+ f.puts <<EOF
170
+ test:
171
+ fluent_host: '127.0.0.1'
172
+ fluent_port: 24224
173
+ tag: 'foo'
174
+ EOF
175
+ end
176
+ end
177
+ it do
178
+ expect(::Fluent::Logger::FluentLogger).not_to receive(:new).with(nil, hash_including(tls_options: { use_default_ca: true }))
179
+ logger
180
+ end
181
+ end
182
+ context 'has key' do
183
+ before do
184
+ File.open(@config_file.path, 'w') do |f|
185
+ f.puts <<EOF
186
+ test:
187
+ fluent_host: '127.0.0.1'
188
+ fluent_port: 24224
189
+ tag: 'foo'
190
+ tls_options:
191
+ use_default_ca: true
192
+ EOF
193
+ end
194
+ end
195
+ it do
196
+ expect(::Fluent::Logger::FluentLogger).to receive(:new).with(nil, hash_including(tls_options: { use_default_ca: true }))
197
+ logger
198
+ end
199
+ end
200
+ end
201
+
165
202
  describe 'severity_key' do
166
203
  describe 'not specified' do
167
204
  it 'severity' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: act-fluent-logger-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAHARA Yoshinori
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-23 00:00:00.000000000 Z
11
+ date: 2022-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -45,9 +45,6 @@ dependencies:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '4'
48
- - - "<"
49
- - !ruby/object:Gem::Version
50
- version: '6.1'
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
@@ -55,9 +52,6 @@ dependencies:
55
52
  - - ">="
56
53
  - !ruby/object:Gem::Version
57
54
  version: '4'
58
- - - "<"
59
- - !ruby/object:Gem::Version
60
- version: '6.1'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: activesupport
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -65,9 +59,6 @@ dependencies:
65
59
  - - ">="
66
60
  - !ruby/object:Gem::Version
67
61
  version: '4'
68
- - - "<"
69
- - !ruby/object:Gem::Version
70
- version: '6.1'
71
62
  type: :runtime
72
63
  prerelease: false
73
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -75,9 +66,6 @@ dependencies:
75
66
  - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '4'
78
- - - "<"
79
- - !ruby/object:Gem::Version
80
- version: '6.1'
81
69
  description: Fluent logger
82
70
  email:
83
71
  - read.eval.print@gmail.com
@@ -85,8 +73,8 @@ executables: []
85
73
  extensions: []
86
74
  extra_rdoc_files: []
87
75
  files:
76
+ - ".github/workflows/ci.yml"
88
77
  - ".gitignore"
89
- - ".travis.yml"
90
78
  - Appraisals
91
79
  - CHANGELOG.md
92
80
  - Gemfile
@@ -94,13 +82,12 @@ files:
94
82
  - README.md
95
83
  - Rakefile
96
84
  - act-fluent-logger-rails.gemspec
97
- - gemfiles/rails_4.0.gemfile
98
- - gemfiles/rails_4.1.gemfile
99
- - gemfiles/rails_4.2.gemfile
100
- - gemfiles/rails_5.0.gemfile
101
- - gemfiles/rails_5.1.gemfile
102
- - gemfiles/rails_5.2.gemfile
103
- - gemfiles/rails_6.0.gemfile
85
+ - gemfiles/rails_5_0.gemfile
86
+ - gemfiles/rails_5_1.gemfile
87
+ - gemfiles/rails_5_2.gemfile
88
+ - gemfiles/rails_6_0.gemfile
89
+ - gemfiles/rails_6_1.gemfile
90
+ - gemfiles/rails_7_0.gemfile
104
91
  - lib/act-fluent-logger-rails.rb
105
92
  - lib/act-fluent-logger-rails/logger.rb
106
93
  - lib/act-fluent-logger-rails/version.rb
@@ -110,7 +97,7 @@ homepage: https://github.com/actindi/act-fluent-logger-rails
110
97
  licenses:
111
98
  - MIT
112
99
  metadata: {}
113
- post_install_message:
100
+ post_install_message:
114
101
  rdoc_options: []
115
102
  require_paths:
116
103
  - lib
@@ -125,9 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
112
  - !ruby/object:Gem::Version
126
113
  version: '0'
127
114
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.4.5.1
130
- signing_key:
115
+ rubygems_version: 3.2.32
116
+ signing_key:
131
117
  specification_version: 4
132
118
  summary: Fluent logger
133
119
  test_files:
data/.travis.yml DELETED
@@ -1,47 +0,0 @@
1
- language: ruby
2
- before_install:
3
- - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
4
- - gem install bundler -v '< 2'
5
- rvm:
6
- - 2.1.10
7
- - 2.2.10
8
- - 2.3.8
9
- - 2.4.5
10
- - 2.5.3
11
- - 2.6.1
12
- gemfile:
13
- - gemfiles/rails_4.0.gemfile
14
- - gemfiles/rails_4.1.gemfile
15
- - gemfiles/rails_4.2.gemfile
16
- - gemfiles/rails_5.0.gemfile
17
- - gemfiles/rails_5.1.gemfile
18
- - gemfiles/rails_5.2.gemfile
19
- - gemfiles/rails_6.0.gemfile
20
- matrix:
21
- exclude:
22
- - rvm: 2.1.10
23
- gemfile: gemfiles/rails_5.0.gemfile
24
- - rvm: 2.1.10
25
- gemfile: gemfiles/rails_5.1.gemfile
26
- - rvm: 2.1.10
27
- gemfile: gemfiles/rails_5.2.gemfile
28
- - rvm: 2.1.10
29
- gemfile: gemfiles/rails_6.0.gemfile
30
- - rvm: 2.2.10
31
- gemfile: gemfiles/rails_6.0.gemfile
32
- - rvm: 2.3.8
33
- gemfile: gemfiles/rails_6.0.gemfile
34
- - rvm: 2.4.5
35
- gemfile: gemfiles/rails_4.0.gemfile
36
- - rvm: 2.4.5
37
- gemfile: gemfiles/rails_4.1.gemfile
38
- - rvm: 2.4.5
39
- gemfile: gemfiles/rails_6.0.gemfile
40
- - rvm: 2.5.3
41
- gemfile: gemfiles/rails_4.0.gemfile
42
- - rvm: 2.5.3
43
- gemfile: gemfiles/rails_4.1.gemfile
44
- - rvm: 2.6.1
45
- gemfile: gemfiles/rails_4.0.gemfile
46
- - rvm: 2.6.1
47
- gemfile: gemfiles/rails_4.1.gemfile
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "railties", "4.1.16"
7
- gem "activesupport", "4.1.16"
8
-
9
- gemspec path: "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "railties", "6.0.0.beta3"
7
- gem "activesupport", "6.0.0.beta3"
8
-
9
- gemspec path: "../"