marginalia 1.9.0 → 1.10.0

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: 31ba959aad96344c36a5044e5eed7affc9e837c1ebf6fefe204dc401e3c02cff
4
- data.tar.gz: 5c84a52e9828ff87940bad7ca82ba495f59159fd2154793cc4eeafaacd47da50
3
+ metadata.gz: d87c1e1a9f2c0653a979e4bc598c686c8fb7e7af4281f6571c915cb76eee2742
4
+ data.tar.gz: 18b9c7227dc0fedf7fc74954023274484a79a30fe8d9cc47d09c6ecb46010538
5
5
  SHA512:
6
- metadata.gz: 422739201b1a3e455b233d37500795fb80c4d92e167e4f5c8b7f70a9ee9f5db510fcee7e6623cdea951a8c8db7929b0ce8fcf2fcc5f7fbc15af8c8cd2445a45a
7
- data.tar.gz: f89615ffdfd2cdffe9cef3edabbaf7bc2a9f5fb4124ec03cb3b402a0a0f1368c1616ade7b2f8a18d2292324d9e63589a70b366f1fb1ec7bc72a4ce8a90f498e4
6
+ metadata.gz: 88df0c3b95e116f53a63f6acb1dd6ba63baba048b11e09b47e723d394588c20bab9fadd7035da5a5183fa120fc6871dc2d04205f6397744669f564f684a9f8d5
7
+ data.tar.gz: d91e987e20e1d6a9c257cd5c68b2251b3ced7194f20c38b35e28711088ad030823b0f7018667ce5cb9e02015f472c0fe0a0a34d4ff614dac38194f78e191327b
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.6.6
@@ -9,6 +9,9 @@ rvm:
9
9
  - 2.2
10
10
  - 2.3
11
11
  - 2.4
12
+ - 2.5
13
+ - 2.6
14
+ - 2.7
12
15
 
13
16
  services:
14
17
  - mysql
@@ -22,3 +25,10 @@ gemfile:
22
25
  - gemfiles/5.0.gemfile
23
26
  - gemfiles/5.1.gemfile
24
27
  - gemfiles/5.2.gemfile
28
+
29
+ matrix:
30
+ exclude:
31
+ - rvm: 2.7
32
+ gemfile: gemfiles/4.2.gemfile
33
+ - rvm: 2.7
34
+ gemfile: gemfiles/4.2.api.gemfile
@@ -90,9 +90,15 @@ module Marginalia
90
90
  exec_update_without_marginalia(annotate_sql(sql), name, binds)
91
91
  end
92
92
 
93
- def execute_and_clear_with_marginalia(sql, *args, &block)
94
- execute_and_clear_without_marginalia(annotate_sql(sql), *args, &block)
93
+ if ActiveRecord::VERSION::MAJOR >= 5
94
+ def execute_and_clear_with_marginalia(sql, *args, **kwargs, &block)
95
+ execute_and_clear_without_marginalia(annotate_sql(sql), *args, **kwargs, &block)
95
96
  end
97
+ else
98
+ def execute_and_clear_with_marginalia(sql, *args, &block)
99
+ execute_and_clear_without_marginalia(annotate_sql(sql), *args, &block)
100
+ end
101
+ end
96
102
  end
97
103
 
98
104
  module ActionControllerInstrumentation
@@ -107,8 +107,10 @@ module Marginalia
107
107
  marginalia_job["class"] if marginalia_job && marginalia_job.respond_to?(:[])
108
108
  end
109
109
 
110
+ DEFAULT_LINES_TO_IGNORE_REGEX = %r{\.rvm|/ruby/gems/|vendor/|marginalia|rbenv|monitor\.rb.*mon_synchronize}
111
+
110
112
  def self.line
111
- Marginalia::Comment.lines_to_ignore ||= /\.rvm|gem|vendor\/|marginalia|rbenv|monitor\.rb.*mon_synchronize/
113
+ Marginalia::Comment.lines_to_ignore ||= DEFAULT_LINES_TO_IGNORE_REGEX
112
114
 
113
115
  last_line = caller.detect do |line|
114
116
  line !~ Marginalia::Comment.lines_to_ignore
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.test_files = `git ls-files -- {test}/*`.split("\n")
9
9
  gem.name = "marginalia"
10
10
  gem.require_paths = ["lib"]
11
- gem.version = "1.9.0"
11
+ gem.version = "1.10.0"
12
12
  gem.license = "MIT"
13
13
 
14
14
  gem.add_runtime_dependency "actionpack", ">= 2.3"
@@ -216,6 +216,16 @@ class MarginaliaTest < MiniTest::Test
216
216
  assert_match %r{/\*line:.*lib/marginalia/comment.rb:[0-9]+}, @queries.first
217
217
  end
218
218
 
219
+ def test_default_lines_to_ignore_regex
220
+ line = "/gems/a_gem/lib/a_gem.rb:1:in `some_method'"
221
+ call_stack = [line] + caller
222
+
223
+ assert_match(
224
+ call_stack.detect { |line| line !~ Marginalia::Comment::DEFAULT_LINES_TO_IGNORE_REGEX },
225
+ line
226
+ )
227
+ end
228
+
219
229
  def test_hostname_and_pid
220
230
  Marginalia::Comment.components = [:hostname, :pid]
221
231
  PostsController.action(:driver_only).call(@env)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marginalia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Lorang
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-08-05 00:00:00.000000000 Z
13
+ date: 2021-01-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
185
  requirements: []
186
- rubygems_version: 3.1.2
186
+ rubygems_version: 3.0.3
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Attach comments to your ActiveRecord queries.