sweet_notifications 1.1.1 → 1.1.2

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
  SHA256:
3
- metadata.gz: b6c084ecf379a17039cbda23138ef831ec067ef33da0c653ecd0be81cbd39e28
4
- data.tar.gz: 70a60a8ed86fc436352e160415563fad1f839893006655649296380bee09840b
3
+ metadata.gz: c1ccc121cfcdcb24a00131f923235e2bb1a6d124d87d43f56827848755595d8e
4
+ data.tar.gz: 2ca4d6706d8cd3e1e09a183e9750c609008fd433e6d073e7eec85cb45de3c22e
5
5
  SHA512:
6
- metadata.gz: 864cd928cdc2a05ecbb355897e93b43b9bbf375430c04f9d9758a7f3fb761a3e990a8f7fd0dd1aa57354007d447224d8e44385b6d5beac01f0c2b296c00c0604
7
- data.tar.gz: 52cfd3dc19bf1b96c79ff0701289fe30056eabb605192dfe12d9eec938605f1b3953d27929e56b117abf5e8d438c69b45c03a089a682dc9aad978dc52151449d
6
+ metadata.gz: e72a675ea8a7add13cdd5a676595ab95311ef046dca177f6a56b3dad54deb7aaa6e23da3fe19dc48fdb3ee4d50e1f5443c772f9d6cc9ef1be0f9f7263fbaec03
7
+ data.tar.gz: 7bc66935f9c27dfd6594e8ddf45e0eedb19564514bc19e897b8aad1c8b4e9ef16252041462a43ff73ef48643a6163af1c16692fb7ec73a47edbdf6224daf495a
@@ -14,10 +14,10 @@ jobs:
14
14
  - gemfiles/rails_5.2.gemfile
15
15
  - gemfiles/rails_6.0.gemfile
16
16
  - gemfiles/rails_6.1.gemfile
17
+ - gemfiles/rails_7.0.gemfile
18
+ - gemfiles/rails_7.1.gemfile
17
19
  - Gemfile
18
20
  ruby:
19
- - 2.5
20
- - 2.6
21
21
  - 2.7
22
22
  - 3.0
23
23
  - jruby
data/Appraisals CHANGED
@@ -10,6 +10,14 @@ appraise 'rails-6.1' do
10
10
  gem 'rails', '~> 6.1.0'
11
11
  end
12
12
 
13
+ appraise 'rails-7.0' do
14
+ gem 'rails', '~> 7.0.0'
15
+ end
16
+
17
+ appraise 'rails-7.1' do
18
+ gem 'rails', '~> 7.1.0'
19
+ end
20
+
13
21
  appraise 'rails-head' do
14
22
  gem 'rails', github: 'rails'
15
23
  gem 'arel', github: 'rails/arel'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.1.2 (11 July 2025)
2
+
3
+ - fix log subscriber for Rails >= 7.1 (#4)
4
+
5
+ ## 1.1.1 (27 April 2021)
6
+
7
+ - loosen Ruby version requirement to allow Ruby 3 (#3)
8
+
1
9
  ## 1.1.0 (8 November 2020)
2
10
 
3
11
  - drop support for old Ruby and Rails versions
@@ -3,5 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 5.2.0"
6
+ gem "mutex_m"
7
+ gem "bigdecimal"
6
8
 
7
9
  gemspec path: "../"
@@ -3,5 +3,8 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 6.0.0"
6
+ gem "mutex_m"
7
+ gem "bigdecimal"
8
+ gem "drb"
6
9
 
7
10
  gemspec path: "../"
@@ -3,5 +3,8 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 6.1.0"
6
+ gem "mutex_m"
7
+ gem "bigdecimal"
8
+ gem "drb"
6
9
 
7
10
  gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 7.0.0"
6
+ gem "mutex_m"
7
+ gem "bigdecimal"
8
+ gem "drb"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 7.1.0"
6
+
7
+ gemspec path: "../"
@@ -31,9 +31,9 @@ module SweetNotifications
31
31
 
32
32
  format(
33
33
  ' %s (%.2fms) %s',
34
- color(label, label_color, true),
34
+ color(label, label_color, self.class.as_7_1_or_upper? ? { bold: true } : true),
35
35
  event.duration,
36
- color(body, nil, !@odd)
36
+ color(body, nil, self.class.as_7_1_or_upper? ? { bold: !@odd } : !@odd)
37
37
  )
38
38
  end
39
39
 
@@ -75,6 +75,13 @@ module SweetNotifications
75
75
  end
76
76
  end
77
77
 
78
+ def as_7_1_or_upper?
79
+ return @as_7_1_or_upper if defined?(@as_7_1_or_upper)
80
+
81
+ @as_7_1_or_upper =
82
+ Gem::Version.new(ActiveSupport::VERSION::STRING) >= Gem::Version.new('7.1.0')
83
+ end
84
+
78
85
  protected
79
86
 
80
87
  def inherited(base)
@@ -1,3 +1,3 @@
1
1
  module SweetNotifications
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.1.2'.freeze
3
3
  end
@@ -135,8 +135,13 @@ describe SweetNotifications::LogSubscriber do
135
135
  subject.colorize_logging = true
136
136
  odd = subject.message(event, 'Label', 'body')
137
137
  even = subject.message(event, 'Label', 'body')
138
- assert odd.exclude?(ActiveSupport::LogSubscriber::BOLD + 'body')
139
- assert even.include?(ActiveSupport::LogSubscriber::BOLD + 'body')
138
+ if Gem::Version.new(ActiveSupport::VERSION::STRING) >= Gem::Version.new('7.1.0')
139
+ assert odd.exclude?("\e[#{ActiveSupport::LogSubscriber::MODES[:bold]}m" + 'body')
140
+ assert even.include?("\e[#{ActiveSupport::LogSubscriber::MODES[:bold]}m" + 'body')
141
+ else
142
+ assert odd.exclude?(ActiveSupport::LogSubscriber::BOLD + 'body')
143
+ assert even.include?(ActiveSupport::LogSubscriber::BOLD + 'body')
144
+ end
140
145
  end
141
146
 
142
147
  it 'does not use colors when setting is disabled' do
data/test/railtie_test.rb CHANGED
@@ -13,7 +13,7 @@ describe SweetNotifications::Railtie do
13
13
  end
14
14
 
15
15
  it 'attaches log subscriber to namespace' do
16
- mock = MiniTest::Mock.new
16
+ mock = Minitest::Mock.new
17
17
  mock.expect :attach_to, true, [:log_subscriber]
18
18
  railtie = SweetNotifications.railtie('log_subscriber', mock, Module.new)
19
19
  railtie.run_initializers
data/test/test_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  ENV['RAILS_ENV'] = 'test'
2
2
  require 'simplecov'
3
+ require 'logger'
3
4
 
4
5
  SimpleCov.start do
5
6
  add_filter 'test'
@@ -29,7 +30,7 @@ class ActiveSupport::TestCase
29
30
  remove_method :describe if method_defined? :describe
30
31
  end
31
32
 
32
- extend MiniTest::Spec::DSL
33
+ extend Minitest::Spec::DSL
33
34
  register_spec_type(/SweetNotifications$/, ActionController::TestCase)
34
35
  register_spec_type(/ControllerRuntime$/, ActionController::TestCase)
35
36
  register_spec_type(self)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sweet_notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ville Lautanala
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-04-27 00:00:00.000000000 Z
10
+ date: 2025-07-10 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -199,6 +198,8 @@ files:
199
198
  - gemfiles/rails_5.2.gemfile
200
199
  - gemfiles/rails_6.0.gemfile
201
200
  - gemfiles/rails_6.1.gemfile
201
+ - gemfiles/rails_7.0.gemfile
202
+ - gemfiles/rails_7.1.gemfile
202
203
  - gemfiles/rails_head.gemfile
203
204
  - lib/sweet_notifications.rb
204
205
  - lib/sweet_notifications/controller_runtime.rb
@@ -215,7 +216,6 @@ homepage: https://github.com/lautis/sweet_notifications
215
216
  licenses:
216
217
  - MIT
217
218
  metadata: {}
218
- post_install_message:
219
219
  rdoc_options: []
220
220
  require_paths:
221
221
  - lib
@@ -230,8 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  - !ruby/object:Gem::Version
231
231
  version: '0'
232
232
  requirements: []
233
- rubygems_version: 3.1.2
234
- signing_key:
233
+ rubygems_version: 3.6.2
235
234
  specification_version: 4
236
235
  summary: Syntactic sugar for ActiveSupport::LogSubscriber.
237
236
  test_files: