marginalia 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +10 -0
- data/lib/marginalia.rb +8 -2
- data/lib/marginalia/comment.rb +3 -1
- data/marginalia.gemspec +1 -1
- data/test/query_comments_test.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d87c1e1a9f2c0653a979e4bc598c686c8fb7e7af4281f6571c915cb76eee2742
|
4
|
+
data.tar.gz: 18b9c7227dc0fedf7fc74954023274484a79a30fe8d9cc47d09c6ecb46010538
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88df0c3b95e116f53a63f6acb1dd6ba63baba048b11e09b47e723d394588c20bab9fadd7035da5a5183fa120fc6871dc2d04205f6397744669f564f684a9f8d5
|
7
|
+
data.tar.gz: d91e987e20e1d6a9c257cd5c68b2251b3ced7194f20c38b35e28711088ad030823b0f7018667ce5cb9e02015f472c0fe0a0a34d4ff614dac38194f78e191327b
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.6
|
data/.travis.yml
CHANGED
@@ -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
|
data/lib/marginalia.rb
CHANGED
@@ -90,9 +90,15 @@ module Marginalia
|
|
90
90
|
exec_update_without_marginalia(annotate_sql(sql), name, binds)
|
91
91
|
end
|
92
92
|
|
93
|
-
|
94
|
-
|
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
|
data/lib/marginalia/comment.rb
CHANGED
@@ -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 ||=
|
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
|
data/marginalia.gemspec
CHANGED
@@ -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.
|
11
|
+
gem.version = "1.10.0"
|
12
12
|
gem.license = "MIT"
|
13
13
|
|
14
14
|
gem.add_runtime_dependency "actionpack", ">= 2.3"
|
data/test/query_comments_test.rb
CHANGED
@@ -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.
|
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:
|
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.
|
186
|
+
rubygems_version: 3.0.3
|
187
187
|
signing_key:
|
188
188
|
specification_version: 4
|
189
189
|
summary: Attach comments to your ActiveRecord queries.
|