loga 2.5.4 → 2.6.0

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
  SHA256:
3
- metadata.gz: b0e5af261daf89f7f7e4b80be296a8f19307a33f187a501e23eb5295fbedd8f2
4
- data.tar.gz: ed0d0281f4d40078051363434600bdd9a8f843ba70a85fde3b110d56a58e2ca3
3
+ metadata.gz: 5366cef0d19c0384219e570b910635edeced8c13f7d27a7726f76397de78b492
4
+ data.tar.gz: 1015b91450e060ca3d705a93c50decf6111136a51d4819429f3be45f97687e53
5
5
  SHA512:
6
- metadata.gz: 64128d6a8442ce7006629f3056c94487e9316f7c07cd284b3f96f3bb01fd5daccd3a7e4372dfb746376e8e91e2ccb52e015e381bd1c2fdc1774b86e5a5a78f43
7
- data.tar.gz: bf0393ec37a4f9f8a023d031b5823ad94151fc98b9f1d2ce1ee2bea8b580c88db3013b35b73c68636dfb482dbabd1019771b0b0542ec11c8b2ab0baad290a022
6
+ metadata.gz: 151f8dddb93eeaf02ed792e45d51e7c694f349d6d397d18602ac6928953844f7047abaf7ae31b681cfa068f75842799d54eb90a948c75cead9e3b2edd1200175
7
+ data.tar.gz: 80a2b4f443aaea2403388de748fb181aeea34c81f6e693cc08b50b6b9893a48bcfed447c747d0f241823d99904b28772b64e7495870ac03426b71b0be6991f97
data/.circleci/config.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  basic_build: &basic_build
2
2
  working_directory: ~/loga
3
3
  docker:
4
- - image: circleci/ruby:2.5.1
4
+ - image: cimg/ruby:2.7.5
5
5
 
6
6
  test_build: &test_build
7
7
  working_directory: ~/loga
@@ -25,43 +25,11 @@ test_build: &test_build
25
25
  at: ./tmp
26
26
  - run: RACK_ENV=development bundle exec appraisal rspec
27
27
  - run: RACK_ENV=production bundle exec appraisal rspec
28
- - run: ./tmp/cc-test-reporter format-coverage -t simplecov -o $(ruby -e 'puts "tmp/codeclimate.#{RUBY_VERSION}.json"') coverage/.resultset.json
29
- - persist_to_workspace:
30
- root: tmp
31
- paths:
32
- - codeclimate.*.json
33
28
  - store_artifacts:
34
29
  path: coverage
35
30
 
36
31
  version: 2
37
32
  jobs:
38
- build:
39
- <<: *basic_build
40
- steps:
41
- - run:
42
- name: Download cc-test-reporter
43
- command: |
44
- mkdir -p tmp/
45
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
46
- chmod +x ./tmp/cc-test-reporter
47
- - persist_to_workspace:
48
- root: ./tmp
49
- paths:
50
- - cc-test-reporter
51
- upload-coverage:
52
- <<: *basic_build
53
- steps:
54
- - attach_workspace:
55
- at: ./tmp
56
- - run:
57
- name: Upload coverage results to Code Climate
58
- command: |
59
- ./tmp/cc-test-reporter sum-coverage tmp/codeclimate.*.json -o tmp/codeclimate.total.json
60
- ./tmp/cc-test-reporter upload-coverage -i tmp/codeclimate.total.json -r $CODECLIMATE_REPO_TOKEN
61
- ruby-2.3:
62
- docker:
63
- - image: circleci/ruby:2.3
64
- <<: *test_build
65
33
  ruby-2.4:
66
34
  docker:
67
35
  - image: circleci/ruby:2.4
@@ -76,7 +44,11 @@ jobs:
76
44
  <<: *test_build
77
45
  ruby-2.7:
78
46
  docker:
79
- - image: circleci/ruby:2.7
47
+ - image: cimg/ruby:2.7
48
+ <<: *test_build
49
+ ruby-3.0:
50
+ docker:
51
+ - image: cimg/ruby:3.0
80
52
  <<: *test_build
81
53
  rubocop:
82
54
  <<: *basic_build
@@ -107,55 +79,32 @@ workflows:
107
79
  version: 2
108
80
  test-then-push-gem:
109
81
  jobs:
110
- - build:
111
- filters:
112
- tags:
113
- only: /.*/
114
82
  - rubocop:
115
83
  filters:
116
84
  tags:
117
85
  only: /.*/
118
- - ruby-2.3:
119
- filters:
120
- tags:
121
- only: /.*/
122
- requires:
123
- - build
124
86
  - ruby-2.4:
125
87
  filters:
126
88
  tags:
127
89
  only: /.*/
128
- requires:
129
- - build
130
90
  - ruby-2.5:
131
91
  filters:
132
92
  tags:
133
93
  only: /.*/
134
- requires:
135
- - build
136
94
  - ruby-2.6:
137
95
  filters:
138
96
  tags:
139
97
  only: /.*/
140
- requires:
141
- - build
142
98
  - ruby-2.7:
143
99
  filters:
144
100
  tags:
145
101
  only: /.*/
146
- requires:
147
- - build
148
- - upload-coverage:
102
+ - ruby-3.0:
149
103
  filters:
150
104
  tags:
151
105
  only: /.*/
152
- requires:
153
- - ruby-2.3
154
- - ruby-2.4
155
- - ruby-2.5
156
- - ruby-2.6
157
- - ruby-2.7
158
106
  - push-to-rubygems:
107
+ context: org-rubygems
159
108
  filters:
160
109
  tags:
161
110
  only: /^v\d.+/
@@ -163,8 +112,8 @@ workflows:
163
112
  ignore: /.*/
164
113
  requires:
165
114
  - rubocop
166
- - ruby-2.3
167
115
  - ruby-2.4
168
116
  - ruby-2.5
169
117
  - ruby-2.6
170
118
  - ruby-2.7
119
+ - ruby-3.0
data/Appraisals CHANGED
@@ -36,6 +36,16 @@ if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.5.0')
36
36
  end
37
37
  end
38
38
 
39
+ if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.7.0')
40
+ appraise 'rails61' do
41
+ gem 'rails', '~> 6.1.4.4'
42
+ end
43
+
44
+ appraise 'rails70' do
45
+ gem 'rails', '~> 7.0.0'
46
+ end
47
+ end
48
+
39
49
  appraise 'sidekiq51' do
40
50
  gem 'sidekiq', '~> 5.1.0'
41
51
  end
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [2.6.0] - 2021-12-22
8
+ ### Added
9
+ - Allow using the gem with rails 7
10
+ - Add a build for ruby 3.0
11
+
12
+ ### Removed
13
+ - Remove build for ruby 2.3
14
+
7
15
  ## [2.5.4] - 2021-03-24
8
16
  ### Fixed
9
17
  - Remove state from Rack middleware, to prevent race conditions where one request would overwrite the state of another
data/Guardfile CHANGED
@@ -15,7 +15,7 @@ end
15
15
 
16
16
  group :rails do
17
17
  %w[production development].each do |env|
18
- %w[rails32 rails40 rails50 rails52].each do |appraisal|
18
+ %w[rails52 rails61 rails70].each do |appraisal|
19
19
  cmd = "RACK_ENV=#{env} bundle exec appraisal #{appraisal} rspec"
20
20
 
21
21
  guard :rspec, all_on_start: true, cmd: cmd do
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.1.4.4"
6
+
7
+ group :test do
8
+ gem "simplecov", "~> 0.17.0"
9
+ end
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 7.0.0"
6
+
7
+ group :test do
8
+ gem "simplecov", "~> 0.17.0"
9
+ end
10
+
11
+ gemspec path: "../"
data/lib/loga/railtie.rb CHANGED
@@ -125,7 +125,7 @@ module Loga
125
125
  def silence_rails_rack_logger
126
126
  case Rails::VERSION::MAJOR
127
127
  when 3 then require 'loga/ext/rails/rack/logger3.rb'
128
- when 4..6 then require 'loga/ext/rails/rack/logger.rb'
128
+ when 4..7 then require 'loga/ext/rails/rack/logger.rb'
129
129
  else
130
130
  raise Loga::ConfigurationError,
131
131
  "Rails #{Rails::VERSION::MAJOR} is unsupported"
data/lib/loga/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Loga
2
- VERSION = '2.5.4'.freeze
2
+ VERSION = '2.6.0'.freeze
3
3
  end
data/loga.gemspec CHANGED
@@ -21,17 +21,17 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency 'activesupport', '>= 2.3.8'
22
22
  spec.add_dependency 'rack'
23
23
 
24
- spec.add_development_dependency 'appraisal', '~> 2.2.0'
24
+ spec.add_development_dependency 'appraisal', '~> 2.4'
25
25
  spec.add_development_dependency 'bundler', '>= 1.6'
26
26
  spec.add_development_dependency 'byebug'
27
27
  spec.add_development_dependency 'guard', '~> 2.13'
28
- spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
28
+ spec.add_development_dependency 'guard-rspec', '~> 4.7'
29
29
  spec.add_development_dependency 'guard-rubocop', '~> 1.2'
30
30
  spec.add_development_dependency 'pry'
31
31
  spec.add_development_dependency 'rack-test'
32
32
  spec.add_development_dependency 'rake'
33
33
  spec.add_development_dependency 'fakeredis'
34
- spec.add_development_dependency 'rspec', '~> 3.7.0'
34
+ spec.add_development_dependency 'rspec', '~> 3.7'
35
35
  spec.add_development_dependency 'rubocop', '~> 0.57.0'
36
36
  spec.add_development_dependency 'rubocop-rspec'
37
37
  spec.add_development_dependency 'timecop'
@@ -0,0 +1,80 @@
1
+ require 'action_controller/railtie'
2
+ require 'action_mailer/railtie'
3
+
4
+ Bundler.require(*Rails.groups)
5
+
6
+ STREAM = StringIO.new unless defined?(STREAM)
7
+
8
+ class Dummy < Rails::Application
9
+ config.eager_load = true
10
+ config.filter_parameters += [:password]
11
+ config.secret_key_base = '2624599ca9ab3cf3823626240138a128118a87683bf03ab8f155844c33b3cd8cbbfa3ef5e29db6f5bd182f8bd4776209d9577cfb46ac51bfd232b00ab0136b24'
12
+ config.session_store :cookie_store, key: '_rails61_session'
13
+
14
+ config.log_tags = [:uuid, 'TEST_TAG']
15
+ config.loga = {
16
+ device: STREAM,
17
+ host: 'bird.example.com',
18
+ service_name: 'hello_world_app',
19
+ service_version: '1.0',
20
+ }
21
+ config.action_mailer.delivery_method = :test
22
+ end
23
+
24
+ class ApplicationController < ActionController::Base
25
+ include Rails.application.routes.url_helpers
26
+ protect_from_forgery with: :null_session
27
+
28
+ def ok
29
+ render plain: 'Hello Rails'
30
+ end
31
+
32
+ def error
33
+ nil.name
34
+ end
35
+
36
+ def show
37
+ render json: params
38
+ end
39
+
40
+ def create
41
+ render json: params
42
+ end
43
+
44
+ def new
45
+ redirect_to :ok
46
+ end
47
+
48
+ def update
49
+ @id = params[:id]
50
+ render '/user'
51
+ end
52
+ end
53
+
54
+ class FakeMailer < ActionMailer::Base
55
+ default from: 'notifications@example.com'
56
+
57
+ def self.send_email
58
+ basic_mail.deliver_now
59
+ end
60
+
61
+ def basic_mail
62
+ mail(
63
+ to: 'user@example.com',
64
+ subject: 'Welcome to My Awesome Site',
65
+ body: 'Banana muffin',
66
+ content_type: 'text/html',
67
+ )
68
+ end
69
+ end
70
+
71
+ Dummy.routes.append do
72
+ get 'ok' => 'application#ok'
73
+ get 'error' => 'application#error'
74
+ get 'show' => 'application#show'
75
+ post 'users' => 'application#create'
76
+ get 'new' => 'application#new'
77
+ put 'users/:id' => 'application#update'
78
+ end
79
+
80
+ Dummy.initialize!
@@ -0,0 +1,80 @@
1
+ require 'action_controller/railtie'
2
+ require 'action_mailer/railtie'
3
+
4
+ Bundler.require(*Rails.groups)
5
+
6
+ STREAM = StringIO.new unless defined?(STREAM)
7
+
8
+ class Dummy < Rails::Application
9
+ config.eager_load = true
10
+ config.filter_parameters += [:password]
11
+ config.secret_key_base = '2624599ca9ab3cf3823626240138a128118a87683bf03ab8f155844c33b3cd8cbbfa3ef5e29db6f5bd182f8bd4776209d9577cfb46ac51bfd232b00ab0136b24'
12
+ config.session_store :cookie_store, key: '_rails70_session'
13
+
14
+ config.log_tags = [:uuid, 'TEST_TAG']
15
+ config.loga = {
16
+ device: STREAM,
17
+ host: 'bird.example.com',
18
+ service_name: 'hello_world_app',
19
+ service_version: '1.0',
20
+ }
21
+ config.action_mailer.delivery_method = :test
22
+ end
23
+
24
+ class ApplicationController < ActionController::Base
25
+ include Rails.application.routes.url_helpers
26
+ protect_from_forgery with: :null_session
27
+
28
+ def ok
29
+ render plain: 'Hello Rails'
30
+ end
31
+
32
+ def error
33
+ nil.name
34
+ end
35
+
36
+ def show
37
+ render json: params
38
+ end
39
+
40
+ def create
41
+ render json: params
42
+ end
43
+
44
+ def new
45
+ redirect_to :ok
46
+ end
47
+
48
+ def update
49
+ @id = params[:id]
50
+ render '/user'
51
+ end
52
+ end
53
+
54
+ class FakeMailer < ActionMailer::Base
55
+ default from: 'notifications@example.com'
56
+
57
+ def self.send_email
58
+ basic_mail.deliver_now
59
+ end
60
+
61
+ def basic_mail
62
+ mail(
63
+ to: 'user@example.com',
64
+ subject: 'Welcome to My Awesome Site',
65
+ body: 'Banana muffin',
66
+ content_type: 'text/html',
67
+ )
68
+ end
69
+ end
70
+
71
+ Dummy.routes.append do
72
+ get 'ok' => 'application#ok'
73
+ get 'error' => 'application#error'
74
+ get 'show' => 'application#show'
75
+ post 'users' => 'application#create'
76
+ get 'new' => 'application#new'
77
+ put 'users/:id' => 'application#update'
78
+ end
79
+
80
+ Dummy.initialize!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loga
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.4
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Funding Circle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-24 00:00:00.000000000 Z
11
+ date: 2021-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.2.0
47
+ version: '2.4'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.2.0
54
+ version: '2.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 4.7.3
103
+ version: '4.7'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 4.7.3
110
+ version: '4.7'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: guard-rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 3.7.0
187
+ version: '3.7'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 3.7.0
194
+ version: '3.7'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rubocop
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -260,6 +260,8 @@ files:
260
260
  - gemfiles/rails50.gemfile
261
261
  - gemfiles/rails52.gemfile
262
262
  - gemfiles/rails60.gemfile
263
+ - gemfiles/rails61.gemfile
264
+ - gemfiles/rails70.gemfile
263
265
  - gemfiles/sidekiq51.gemfile
264
266
  - gemfiles/sidekiq6.gemfile
265
267
  - gemfiles/sinatra14.gemfile
@@ -294,6 +296,8 @@ files:
294
296
  - spec/fixtures/rails50.rb
295
297
  - spec/fixtures/rails52.rb
296
298
  - spec/fixtures/rails60.rb
299
+ - spec/fixtures/rails61.rb
300
+ - spec/fixtures/rails70.rb
297
301
  - spec/fixtures/random_bin
298
302
  - spec/integration/rails/action_mailer_spec.rb
299
303
  - spec/integration/rails/railtie_spec.rb
@@ -339,8 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
343
  - !ruby/object:Gem::Version
340
344
  version: '0'
341
345
  requirements: []
342
- rubyforge_project:
343
- rubygems_version: 2.7.7
346
+ rubygems_version: 3.2.32
344
347
  signing_key:
345
348
  specification_version: 4
346
349
  summary: Facilitate log aggregation via unified logging
@@ -352,6 +355,8 @@ test_files:
352
355
  - spec/fixtures/rails50.rb
353
356
  - spec/fixtures/rails52.rb
354
357
  - spec/fixtures/rails60.rb
358
+ - spec/fixtures/rails61.rb
359
+ - spec/fixtures/rails70.rb
355
360
  - spec/fixtures/random_bin
356
361
  - spec/integration/rails/action_mailer_spec.rb
357
362
  - spec/integration/rails/railtie_spec.rb