rack-mini-profiler 0.10.4 → 0.10.5

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
  SHA1:
3
- metadata.gz: 52608cf610b318600730735af4ee684170808aec
4
- data.tar.gz: 5de1e9d98833a32185b8cc3fd2870c3d9cb4be1e
3
+ metadata.gz: 1f34392424f5776e5e0e9f2b4a4cdce94a25386d
4
+ data.tar.gz: 075b0768179f69aaddb7c9d70b26dbabd78852d7
5
5
  SHA512:
6
- metadata.gz: 73d456154a17ee0ce4600a6df6c3aba45d3c718dea2862cfc4ffd42e0ed2b91717754f68cd7f0c77e04aaf2b05d05b48174a84a86ecebedc16287014bd288650
7
- data.tar.gz: a814060e1036885a7384115c5bcddb7b87a900e346d18c40a8285bfb42579983067b975cb5faf8b94cf4eae25a337bb43e611da7c1f1811465881824bd37c09a
6
+ metadata.gz: 4b062c51034ab8fd8fa0fc9a534288773e8400cd26914e40a1146b55cba41bbfe490ae1882b4dbc7dd12bc60e744a6eaf93a44401a203396e7074a7df6313dba
7
+ data.tar.gz: 8a382e89bd7e61cab7af6b6e156c1f6769676233cf17ab8b1683b3a43ca1d85d2032eb8c6d53feec7a2ab7942fe8966087fa39b97c0c69d3413a5c35bf99ff86
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.10.5 2017-05-22
4
+
5
+ - [FIX] revert PG bind sniffing until it is properly tested
6
+
3
7
  ## 0.10.4 2017-05-17
4
8
 
5
9
  - [FEATURE] log binds for pg @neznauy
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class MiniProfiler
3
- VERSION = '0.10.4'
3
+ VERSION = '0.10.5'
4
4
  end
5
5
  end
@@ -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, get_binds(*args))
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, get_binds(mapped, args[1]))
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, get_binds(mapped, args[1]))
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, get_binds(*args))
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
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-17 00:00:00.000000000 Z
13
+ date: 2017-05-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack