rack-mini-profiler 0.10.4 → 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/mini_profiler/version.rb +1 -1
- data/lib/patches/db/pg.rb +4 -29
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f34392424f5776e5e0e9f2b4a4cdce94a25386d
|
4
|
+
data.tar.gz: 075b0768179f69aaddb7c9d70b26dbabd78852d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b062c51034ab8fd8fa0fc9a534288773e8400cd26914e40a1146b55cba41bbfe490ae1882b4dbc7dd12bc60e744a6eaf93a44401a203396e7074a7df6313dba
|
7
|
+
data.tar.gz: 8a382e89bd7e61cab7af6b6e156c1f6769676233cf17ab8b1683b3a43ca1d85d2032eb8c6d53feec7a2ab7942fe8966087fa39b97c0c69d3413a5c35bf99ff86
|
data/CHANGELOG.md
CHANGED
data/lib/patches/db/pg.rb
CHANGED
@@ -52,7 +52,7 @@ class PG::Connection
|
|
52
52
|
start = Time.now
|
53
53
|
result = exec_without_profiling(*args,&blk)
|
54
54
|
elapsed_time = SqlPatches.elapsed_time(start)
|
55
|
-
record = ::Rack::MiniProfiler.record_sql(args[0], elapsed_time
|
55
|
+
record = ::Rack::MiniProfiler.record_sql(args[0], elapsed_time)
|
56
56
|
result.instance_variable_set("@miniprofiler_sql_id", record) if result
|
57
57
|
|
58
58
|
result
|
@@ -66,7 +66,7 @@ class PG::Connection
|
|
66
66
|
elapsed_time = SqlPatches.elapsed_time(start)
|
67
67
|
mapped = args[0]
|
68
68
|
mapped = @prepare_map[mapped] || args[0] if @prepare_map
|
69
|
-
record = ::Rack::MiniProfiler.record_sql(mapped, elapsed_time
|
69
|
+
record = ::Rack::MiniProfiler.record_sql(mapped, elapsed_time)
|
70
70
|
result.instance_variable_set("@miniprofiler_sql_id", record) if result
|
71
71
|
|
72
72
|
result
|
@@ -80,7 +80,7 @@ class PG::Connection
|
|
80
80
|
elapsed_time = SqlPatches.elapsed_time(start)
|
81
81
|
mapped = args[0]
|
82
82
|
mapped = @prepare_map[mapped] || args[0] if @prepare_map
|
83
|
-
record = ::Rack::MiniProfiler.record_sql(mapped, elapsed_time
|
83
|
+
record = ::Rack::MiniProfiler.record_sql(mapped, elapsed_time)
|
84
84
|
result.instance_variable_set("@miniprofiler_sql_id", record) if result
|
85
85
|
|
86
86
|
result
|
@@ -92,36 +92,11 @@ class PG::Connection
|
|
92
92
|
start = Time.now
|
93
93
|
result = exec_without_profiling(*args,&blk)
|
94
94
|
elapsed_time = SqlPatches.elapsed_time(start)
|
95
|
-
record = ::Rack::MiniProfiler.record_sql(args[0], elapsed_time
|
95
|
+
record = ::Rack::MiniProfiler.record_sql(args[0], elapsed_time)
|
96
96
|
result.instance_variable_set("@miniprofiler_sql_id", record) if result
|
97
97
|
|
98
98
|
result
|
99
99
|
end
|
100
100
|
|
101
|
-
def get_binds(*args)
|
102
|
-
params = args[1]
|
103
|
-
return if params.nil? || params.empty?
|
104
|
-
|
105
|
-
sql = args[0]
|
106
|
-
|
107
|
-
hh = {}
|
108
|
-
arr = nil
|
109
|
-
|
110
|
-
if sql.match(/\(\$\d/)
|
111
|
-
arr = sql.match(/\((\"\w+\",?\s?)+\)/).to_s.gsub!(/[",()]/, '').split #regular selects list of names from sql query, for ex. ("name1", "name2", "name3")
|
112
|
-
end
|
113
|
-
|
114
|
-
params.each_index do |i|
|
115
|
-
if arr
|
116
|
-
hh[arr[i]]=params[i]
|
117
|
-
else
|
118
|
-
var = sql.match(/[^\s\.]+\s?=?\s\$#{i+1}/).to_s.split[0] #regular selects param name from sql query, like for ex. "name1" = $1
|
119
|
-
var.gsub!(/["]/, '') if var
|
120
|
-
hh[var]=args[1][i]
|
121
|
-
end
|
122
|
-
end
|
123
|
-
return hh
|
124
|
-
end
|
125
|
-
|
126
101
|
alias_method :query, :exec
|
127
102
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-mini-profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-05-
|
13
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|