ownership 0.1.2 → 0.3.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: 63e2271e9e2c427002833dc85a287563db799eb6d3cc37b639231bc3f2bbc643
4
- data.tar.gz: 37ea40f895ba8359e0627d5d9be3dce0566fe062ba888f23ce767b1886927b70
3
+ metadata.gz: 6baac02789c51d6d4d102c21973b118eba9c67f0a918556bc15d2efcbe7e698d
4
+ data.tar.gz: 31e12e304264d7f461e8197ebcdb99dc878bba9a0fc35a22c0c0f561abc99941
5
5
  SHA512:
6
- metadata.gz: 1539dbd3c928612c87463c3c4666e1d8502ff09ff923f6a8f0ac12c37e2a59eb1b8ff9a72213b23a9e0e6f2a52dc9ce35b54db78822457455d2947ab8dbe93a8
7
- data.tar.gz: 83555242d963297d64be5123895e74ba9c524bb7aa3b76c638850cbc47e10ba3b78e8116adbfb9113a9febdb84d09c9f5121c94624ea408cd905e214cdfdffee
6
+ metadata.gz: 2f7a28b8c3c4efbb2b9ba9c11777a0912f586bcd39b27ce7d36343b20d26190ce27f52207e3157a798c6a9506c168d64a35a0b98364f632f37c45ea68e90c940
7
+ data.tar.gz: 93eb12573a2399ef0bbac69da0a24c573444f3f439b11a8f26389f83bcedb2db6747799807df715f78ec036aeacddf63ed0b4639becc978e29a6fbabbf1746c9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.3.0 (2023-07-02)
2
+
3
+ - Dropped support for Ruby < 3 and Rails < 6.1
4
+
5
+ ## 0.2.0 (2022-04-26)
6
+
7
+ - Fixed issue with nested `owner` blocks
8
+ - Dropped support for Ruby < 2.6
9
+
1
10
  ## 0.1.2 (2022-03-11)
2
11
 
3
12
  - Added Active Record query log tags integration
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2022 Andrew Kane
1
+ Copyright (c) 2017-2023 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
@@ -14,17 +14,15 @@ module Ownership
14
14
  begin
15
15
  Thread.current[:ownership_owner] = owner
16
16
 
17
- begin
18
- # callbacks
19
- if Ownership.around_change
20
- Ownership.around_change.call(owner, block)
21
- else
22
- block.call
23
- end
24
- rescue Exception => e
25
- e.owner = owner
26
- raise
17
+ # callbacks
18
+ if Ownership.around_change
19
+ Ownership.around_change.call(owner, block)
20
+ else
21
+ block.call
27
22
  end
23
+ rescue Exception => e
24
+ e.owner ||= owner
25
+ raise
28
26
  ensure
29
27
  Thread.current[:ownership_owner] = previous_value
30
28
  end
@@ -1,3 +1,3 @@
1
1
  module Ownership
2
- VERSION = "0.1.2"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/ownership.rb CHANGED
@@ -1,12 +1,14 @@
1
- require "ownership/global_methods"
2
- require "ownership/honeybadger"
3
- require "ownership/rollbar"
4
- require "ownership/version"
1
+ # modules
2
+ require_relative "ownership/global_methods"
3
+ require_relative "ownership/version"
4
+
5
+ # integrations
6
+ require_relative "ownership/honeybadger"
7
+ require_relative "ownership/rollbar"
5
8
 
6
9
  module Ownership
7
10
  class << self
8
- attr_accessor :default_owner
9
- attr_accessor :around_change
11
+ attr_accessor :around_change, :default_owner
10
12
 
11
13
  def owner
12
14
  Thread.current[:ownership_owner] || default_owner
@@ -18,7 +20,7 @@ Object.include Ownership::GlobalMethods
18
20
 
19
21
  if defined?(ActiveSupport)
20
22
  ActiveSupport.on_load(:action_controller) do
21
- require "ownership/controller_methods"
23
+ require_relative "ownership/controller_methods"
22
24
  include Ownership::ControllerMethods
23
25
  end
24
26
 
@@ -27,15 +29,15 @@ if defined?(ActiveSupport)
27
29
  ActiveRecord::QueryLogs.taggings[:owner] ||= -> { Ownership.owner }
28
30
  end
29
31
 
30
- require "ownership/marginalia" if defined?(Marginalia)
32
+ require_relative "ownership/marginalia" if defined?(Marginalia)
31
33
  end
32
34
 
33
35
  ActiveSupport.on_load(:active_job) do
34
- require "ownership/job_methods"
36
+ require_relative "ownership/job_methods"
35
37
  include Ownership::JobMethods
36
38
  end
37
39
  else
38
- require "ownership/marginalia" if defined?(Marginalia)
40
+ require_relative "ownership/marginalia" if defined?(Marginalia)
39
41
  end
40
42
 
41
43
  class Exception
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ownership
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-12 00:00:00.000000000 Z
11
+ date: 2023-07-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org
@@ -39,14 +39,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: '2.4'
42
+ version: '3'
43
43
  required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirements: []
49
- rubygems_version: 3.3.7
49
+ rubygems_version: 3.4.10
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: Code ownership for Rails