scout_apm 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +4 -0
- data/lib/scout_apm/environment.rb +4 -0
- data/lib/scout_apm/utils/sql_sanitizer.rb +7 -20
- data/lib/scout_apm/utils/sql_sanitizer_regex.rb +28 -0
- data/lib/scout_apm/utils/sql_sanitizer_regex_1_8_7.rb +27 -0
- data/lib/scout_apm/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e79b5f288da544777712971294bf8c37adf7bf64
|
4
|
+
data.tar.gz: 5ca3cb606fee63ad83d31b48458c815024d10a91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 388a1865dbcd8dd8be6a93d8a6229ac1560e8b235af4599f58a6c75f69815b186dff72ebbb5d3ad60cac25a59bb7e88827e7e820e703ef6ebd7ece760ac96e68
|
7
|
+
data.tar.gz: 57785a9a9027acbbb5c6c6c6b4a8b7659dd3df47ded3b29705d3b215fb27dcf0613a6880a8f98a6247c165e3b60b8b044e2b676a0a2f4d019c5d2489797901ef
|
data/CHANGELOG.markdown
CHANGED
@@ -5,6 +5,13 @@ require 'scout_apm/environment'
|
|
5
5
|
module ScoutApm
|
6
6
|
module Utils
|
7
7
|
class SqlSanitizer
|
8
|
+
if ScoutApm::Environment.new.ruby_187?
|
9
|
+
require 'scout_apm/utils/sql_sanitizer_regex_1_8_7'
|
10
|
+
else
|
11
|
+
require 'scout_apm/utils/sql_sanitizer_regex'
|
12
|
+
end
|
13
|
+
include ScoutApm::Utils::SqlRegex
|
14
|
+
|
8
15
|
attr_reader :sql
|
9
16
|
attr_accessor :database_engine
|
10
17
|
|
@@ -24,16 +31,6 @@ module ScoutApm
|
|
24
31
|
|
25
32
|
private
|
26
33
|
|
27
|
-
MULTIPLE_SPACES = %r|\s+|.freeze
|
28
|
-
MULTIPLE_QUESTIONS = /\?(,\?)+/.freeze
|
29
|
-
TRAILING_SPACES = /\s+$/.freeze
|
30
|
-
|
31
|
-
PSQL_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
32
|
-
PSQL_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
|
33
|
-
PSQL_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze
|
34
|
-
PSQL_PLACEHOLDER = /\$\d+/.freeze
|
35
|
-
PSQL_IN_CLAUSE = /IN\s+\((\s*\?,?\s*)*\)/.freeze
|
36
|
-
|
37
34
|
def to_s_postgres
|
38
35
|
sql.gsub!(PSQL_PLACEHOLDER, '?')
|
39
36
|
sql.gsub!(PSQL_VAR_INTERPOLATION, '')
|
@@ -45,12 +42,6 @@ module ScoutApm
|
|
45
42
|
sql
|
46
43
|
end
|
47
44
|
|
48
|
-
MYSQL_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
49
|
-
MYSQL_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze
|
50
|
-
MYSQL_REMOVE_SINGLE_QUOTE_STRINGS = /'(?:[^']|'')*'/.freeze
|
51
|
-
MYSQL_REMOVE_DOUBLE_QUOTE_STRINGS = /"(?:[^"]|"")*"/.freeze
|
52
|
-
MYSQL_IN_CLAUSE = /IN\s+\((\s*\?,?\s*)*\)/.freeze
|
53
|
-
|
54
45
|
def to_s_mysql
|
55
46
|
sql.gsub!(MYSQL_VAR_INTERPOLATION, '')
|
56
47
|
sql.gsub!(MYSQL_REMOVE_SINGLE_QUOTE_STRINGS, '?')
|
@@ -62,10 +53,6 @@ module ScoutApm
|
|
62
53
|
sql
|
63
54
|
end
|
64
55
|
|
65
|
-
SQLITE_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
66
|
-
SQLITE_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
|
67
|
-
SQLITE_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze
|
68
|
-
|
69
56
|
def to_s_sqlite
|
70
57
|
sql.gsub!(SQLITE_VAR_INTERPOLATION, '')
|
71
58
|
sql.gsub!(SQLITE_REMOVE_STRINGS, '?')
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
module ScoutApm
|
3
|
+
module Utils
|
4
|
+
module SqlRegex
|
5
|
+
MULTIPLE_SPACES = %r|\s+|.freeze
|
6
|
+
MULTIPLE_QUESTIONS = /\?(,\?)+/.freeze
|
7
|
+
TRAILING_SPACES = /\s+$/.freeze
|
8
|
+
|
9
|
+
PSQL_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
10
|
+
PSQL_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
|
11
|
+
|
12
|
+
PSQL_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze
|
13
|
+
|
14
|
+
PSQL_PLACEHOLDER = /\$\d+/.freeze
|
15
|
+
PSQL_IN_CLAUSE = /IN\s+\((\s*\?,?\s*)*\)/.freeze
|
16
|
+
|
17
|
+
MYSQL_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
18
|
+
MYSQL_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze
|
19
|
+
MYSQL_REMOVE_SINGLE_QUOTE_STRINGS = /'(?:[^']|'')*'/.freeze
|
20
|
+
MYSQL_REMOVE_DOUBLE_QUOTE_STRINGS = /"(?:[^"]|"")*"/.freeze
|
21
|
+
MYSQL_IN_CLAUSE = /IN\s+\((\s*\?,?\s*)*\)/.freeze
|
22
|
+
|
23
|
+
SQLITE_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
24
|
+
SQLITE_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
|
25
|
+
SQLITE_REMOVE_INTEGERS = /(?<!LIMIT )\b\d+\b/.freeze
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
module ScoutApm
|
3
|
+
module Utils
|
4
|
+
module SqlRegex
|
5
|
+
MULTIPLE_SPACES = %r|\s+|.freeze
|
6
|
+
MULTIPLE_QUESTIONS = /\?(,\?)+/.freeze
|
7
|
+
TRAILING_SPACES = /\s+$/.freeze
|
8
|
+
|
9
|
+
PSQL_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
10
|
+
PSQL_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
|
11
|
+
PSQL_REMOVE_INTEGERS = /\b\d+\b/.freeze
|
12
|
+
PSQL_PLACEHOLDER = /\$\d+/.freeze
|
13
|
+
PSQL_IN_CLAUSE = /IN\s+\((\s*\?,?\s*)*\)/.freeze
|
14
|
+
|
15
|
+
MYSQL_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
16
|
+
MYSQL_REMOVE_INTEGERS = /\b\d+\b/.freeze
|
17
|
+
MYSQL_REMOVE_SINGLE_QUOTE_STRINGS = /'(?:[^']|'')*'/.freeze
|
18
|
+
MYSQL_REMOVE_DOUBLE_QUOTE_STRINGS = /"(?:[^"]|"")*"/.freeze
|
19
|
+
MYSQL_IN_CLAUSE = /IN\s+\((\s*\?,?\s*)*\)/.freeze
|
20
|
+
|
21
|
+
SQLITE_VAR_INTERPOLATION = %r|\[\[.*\]\]\s*$|.freeze
|
22
|
+
SQLITE_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
|
23
|
+
SQLITE_REMOVE_INTEGERS = /\b\d+\b/.freeze
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/scout_apm/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout_apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Haynes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-08-
|
12
|
+
date: 2015-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -93,6 +93,8 @@ files:
|
|
93
93
|
- lib/scout_apm/tracer.rb
|
94
94
|
- lib/scout_apm/utils/null_logger.rb
|
95
95
|
- lib/scout_apm/utils/sql_sanitizer.rb
|
96
|
+
- lib/scout_apm/utils/sql_sanitizer_regex.rb
|
97
|
+
- lib/scout_apm/utils/sql_sanitizer_regex_1_8_7.rb
|
96
98
|
- lib/scout_apm/version.rb
|
97
99
|
- scout_apm.gemspec
|
98
100
|
- test/data/config_test_1.yml
|