meta_request 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa726d98ee329e0d8f5c191fb58015b1869f407a
4
- data.tar.gz: 6683df50b00f40428ea3161420f1874ab610ffca
3
+ metadata.gz: 184437fd6ea42cfd3276c87c21442aa47263b87f
4
+ data.tar.gz: 599aece8423f131b32b7da83c0e2ec7253abfe9a
5
5
  SHA512:
6
- metadata.gz: 3c17a83779def3d7466d57b2076faa5f88ece7493998c7a2f7b7e3602634f6c238c2ddef5abb97424ef23f6e19e57de65496a689dd81463d1d369dcf8793c58c
7
- data.tar.gz: 0fbf94aa9cb729400ee9900d01913a45a76373c5c8fb2fb7853c50309703a8cbd82f0e323b0c4da0b4685dc1eadab0f358046b16577df71d0d2afbae1b63c9d2
6
+ metadata.gz: eb35b8df716f3f84501d05e3dc51e831ac0bf915a07521236a9938baeb0be9d99499da9ff9d2e8382e6f60c2ecf7aca872d43d1f3f4e580188330ceb717daaff
7
+ data.tar.gz: 2ffdf7da526cfa5a1be4a68c52affbaea939961be31afbcf4725840dac7b645fb84b59ace8b0e6ad0829b95036ad3a89135ee60c4e1b873d829f76e737880310
@@ -32,20 +32,31 @@ module MetaRequest
32
32
 
33
33
  Event.new(name, start, ending, transaction_id, payload)
34
34
  }
35
+
36
+ # sql processing block - used for sql.active_record and sql.sequel
37
+
38
+ # HACK: we hardcode the event name to 'sql.active_record' so that the ui will
39
+ # display sequel events without modification. otherwise the ui would need to
40
+ # be modified to support a sequel tab (or to change the display name on the
41
+ # active_record tab when necessary - which maybe makes more sense?)
42
+ SQL_EVENT_NAME = "sql.active_record"
43
+
44
+ SQL_BLOCK = Proc.new {|*args|
45
+ name, start, ending, transaction_id, payload = args
46
+ dev_caller = caller.detect { |c| c.include? MetaRequest.rails_root }
47
+ if dev_caller
48
+ c = Callsite.parse(dev_caller)
49
+ payload.merge!(:line => c.line, :filename => c.filename, :method => c.method)
50
+ end
51
+ Event.new(SQL_EVENT_NAME, start, ending, transaction_id, payload)
52
+ }
35
53
  # Subscribe to all events relevant to RailsPanel
36
54
  #
37
55
  def self.subscribe
38
56
  new.
39
57
  subscribe("meta_request.log").
40
- subscribe("sql.active_record") do |*args|
41
- name, start, ending, transaction_id, payload = args
42
- dev_caller = caller.detect { |c| c.include? MetaRequest.rails_root }
43
- if dev_caller
44
- c = Callsite.parse(dev_caller)
45
- payload.merge!(:line => c.line, :filename => c.filename, :method => c.method)
46
- end
47
- Event.new(name, start, ending, transaction_id, payload)
48
- end.
58
+ subscribe("sql.active_record", &SQL_BLOCK).
59
+ subscribe("sql.sequel", &SQL_BLOCK).
49
60
  subscribe("render_partial.action_view").
50
61
  subscribe("render_template.action_view").
51
62
  subscribe("process_action.action_controller.exception").
@@ -1,3 +1,3 @@
1
1
  module MetaRequest
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dejan Simic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-07 00:00:00.000000000 Z
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.6.11
112
+ rubygems_version: 2.6.14
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Request your Rails request