spring_onion 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/spring_onion/config.rb +16 -12
- data/lib/spring_onion/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9029f4da9a3fa2875d738d9bd505fef3784ac40987453f30974eb3ce1d226bf8
|
4
|
+
data.tar.gz: 53eaebd2f28fa3257a9477e2fc498f08be2e944375a9316a1d746c58f6b37f4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8013cf7f3086f2f0ee8abfb6261327f98f0983adc3adb1dd2945b5cc6039e68e979181f77ed95c4d87825cd32ab54cb6baf497e47c1c7424211cc27628d93d4f
|
7
|
+
data.tar.gz: 57cf5c24c5bf52b543c64a281b2474612ba0861f85180748d92ee26fcf420675477004d8dd73a1f5e59fa8d1297e0092746767292073a03bbd888a916a153c1a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -33,7 +33,7 @@ ActiveRecord::Base.establish_connection(
|
|
33
33
|
database: 'employees',
|
34
34
|
)
|
35
35
|
|
36
|
-
SpringOnion.enabled = true
|
36
|
+
SpringOnion.enabled = true # or `SPRING_ONION_ENABLED=1`
|
37
37
|
SpringOnion.connection = ActiveRecord::Base.connection.raw_connection
|
38
38
|
SpringOnion.source_filter_re = //
|
39
39
|
|
data/lib/spring_onion/config.rb
CHANGED
@@ -25,17 +25,17 @@ module SpringOnion
|
|
25
25
|
slow_extra: ->(exp) { SLOW_EXTRA_RE =~ exp['Extra'] },
|
26
26
|
}
|
27
27
|
|
28
|
-
@enabled =
|
28
|
+
@enabled = (/\A(1|true)\z/i =~ ENV['SPRING_ONION_ENABLED'])
|
29
29
|
|
30
|
-
@sql_filter_re =
|
31
|
-
|
32
|
-
|
33
|
-
Regexp.new(ENV['SPRING_ONION_SQL_FILTER_RE'])
|
34
|
-
end
|
30
|
+
@sql_filter_re = ENV['SPRING_ONION_SQL_FILTER_RE'].yield_self do |re|
|
31
|
+
re ? Regexp.new(re) : //
|
32
|
+
end
|
35
33
|
|
36
34
|
@ignore_sql_filter_re = Regexp.union(
|
37
|
-
/\binformation_schema\b
|
38
|
-
|
35
|
+
[/\binformation_schema\b/].tap do |ary|
|
36
|
+
re = ENV['SPRING_ONION_IGNORE_SQL_FILTER_RE']
|
37
|
+
ary << Regexp.new(re) if re
|
38
|
+
end
|
39
39
|
)
|
40
40
|
|
41
41
|
@sql_filter = lambda do |sql|
|
@@ -43,13 +43,17 @@ module SpringOnion
|
|
43
43
|
end
|
44
44
|
|
45
45
|
@source_filter_re = Regexp.union(
|
46
|
-
%r{/app/}
|
47
|
-
|
46
|
+
[%r{/app/}].tap do |ary|
|
47
|
+
re = ENV['SPRING_ONION_SOURCE_FILTER_RE']
|
48
|
+
ary << Regexp.new(re) if re
|
49
|
+
end
|
48
50
|
)
|
49
51
|
|
50
52
|
@ignore_source_filter_re = Regexp.union(
|
51
|
-
|
52
|
-
|
53
|
+
[RbConfig::TOPDIR, *Gem.path].tap do |ary|
|
54
|
+
re = ENV['SPRING_ONION_IGNORE_SOURCE_FILTER_RE']
|
55
|
+
ary << Regexp.new(re) if re
|
56
|
+
end
|
53
57
|
)
|
54
58
|
|
55
59
|
@source_filter = lambda do |backtrace_lines|
|
data/lib/spring_onion/version.rb
CHANGED