rack-insight 0.5.27 → 0.5.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/CHANGELOG +32 -0
  2. data/README.md +32 -7
  3. data/lib/rack/insight/app.rb +5 -0
  4. data/lib/rack/insight/config.rb +6 -2
  5. data/lib/rack/insight/enable-button.rb +3 -4
  6. data/lib/rack/insight/panels/request_variables_panel.rb +4 -1
  7. data/lib/rack/insight/public/__insight__/insight.js +134 -128
  8. data/lib/rack/insight/toolbar.rb +9 -6
  9. data/lib/rack/insight/version.rb +1 -1
  10. data/lib/rack/insight/views/toolbar.html.erb +11 -9
  11. metadata +69 -105
  12. checksums.yaml +0 -7
  13. data/.gitignore +0 -13
  14. data/.rspec +0 -1
  15. data/.ruby-gemset +0 -1
  16. data/.ruby-version +0 -1
  17. data/.simplecov +0 -4
  18. data/.travis.yml +0 -10
  19. data/Gemfile +0 -3
  20. data/Gemfile.lock +0 -69
  21. data/TODO +0 -9
  22. data/rack-insight.gemspec +0 -42
  23. data/spec/custom_matchers.rb +0 -0
  24. data/spec/fixtures/config.ru +0 -8
  25. data/spec/fixtures/dummy_panel.rb +0 -2
  26. data/spec/fixtures/sample_app.rb +0 -72
  27. data/spec/fixtures/star_trek_panel.rb +0 -6
  28. data/spec/fixtures/views/star_trek.html.erb +0 -17
  29. data/spec/insight_spec.rb +0 -166
  30. data/spec/instrumentation_spec.rb +0 -231
  31. data/spec/rack/insight/config_spec.rb +0 -22
  32. data/spec/rack/insight/panels/active_record_panel_spec.rb +0 -44
  33. data/spec/rack/insight/panels/active_resource_panel_spec.rb +0 -40
  34. data/spec/rack/insight/panels/cache_panel_spec.rb +0 -179
  35. data/spec/rack/insight/panels/log_panel_spec.rb +0 -43
  36. data/spec/rack/insight/panels/memory_panel_spec.rb +0 -21
  37. data/spec/rack/insight/panels/mongo_panel_spec_pending.rb +0 -52
  38. data/spec/rack/insight/panels/rails_info_panel_spec.rb +0 -30
  39. data/spec/rack/insight/panels/redis_panel_spec.rb +0 -82
  40. data/spec/rack/insight/panels/speedtracer_panel_spec.rb +0 -87
  41. data/spec/rack/insight/panels/sql_panel_spec.rb +0 -150
  42. data/spec/rack/insight/panels/templates_panel_spec.rb +0 -88
  43. data/spec/rack/insight/panels/timer_panel_spec.rb +0 -39
  44. data/spec/rcov.opts +0 -1
  45. data/spec/spec.opts +0 -1
  46. data/spec/spec_helper.rb +0 -120
@@ -3,7 +3,7 @@ module Rack::Insight
3
3
  include Render
4
4
  include Logging
5
5
 
6
- MIME_TYPES = ["text/html", "application/xhtml+xml"]
6
+ MIME_TYPES = ["text/plain", "text/html", "application/xhtml+xml"]
7
7
 
8
8
  def initialize(app, insight)
9
9
  @app = app
@@ -25,11 +25,12 @@ module Rack::Insight
25
25
  end
26
26
 
27
27
  def okay_to_modify?(env, response)
28
- req = Rack::Request.new(env)
28
+ return false unless response.ok?
29
29
  return false unless response.content_type.respond_to?(:split)
30
30
  content_type, charset = response.content_type.split(";")
31
-
32
- response.ok? && MIME_TYPES.include?(content_type) && !req.xhr?
31
+ return false unless MIME_TYPES.include?(content_type)
32
+ req = Rack::Request.new(env)
33
+ !req.xhr?
33
34
  end
34
35
 
35
36
  def inject_toolbar(response)
@@ -63,7 +64,8 @@ module Rack::Insight
63
64
 
64
65
  headers_fragment = render_template("headers_fragment",
65
66
  :panels => @insight.panels,
66
- :request_id => req_id)
67
+ :request_id => req_id,
68
+ :handle_javascript => @insight.config[:handle_javascript])
67
69
 
68
70
  current_request_fragment = render_template("request_fragment",
69
71
  :request_id => req_id,
@@ -72,7 +74,8 @@ module Rack::Insight
72
74
  render_template("toolbar",
73
75
  :request_fragment => current_request_fragment,
74
76
  :headers_fragment => headers_fragment,
75
- :request_id => req_id)
77
+ :request_id => req_id,
78
+ :handle_javascript => Rack::Insight::Config.config[:handle_javascript])
76
79
  end
77
80
  end
78
81
  end
@@ -1,7 +1,7 @@
1
1
  module Rack
2
2
  module Insight
3
3
 
4
- VERSION = '0.5.27'
4
+ VERSION = '0.5.28'
5
5
 
6
6
  end
7
7
  end
@@ -1,12 +1,14 @@
1
- <script type="text/javascript" charset="utf-8">
2
- if (typeof jQuery == 'undefined') {
3
- var jquery_url = '/__insight__/jquery-1.3.2.js';
4
- document.write(unescape('%3Cscript src="' + jquery_url + '" type="text/javascript"%3E%3C/script%3E'));
5
- }
6
- </script>
7
- <script type="text/javascript" src="/__insight__/jquery.tablesorter.min.js"></script>
8
- <script type="text/javascript" src="/__insight__/bookmarklet.js"></script>
9
- <script type="text/javascript" src="/__insight__/insight.js"></script>
1
+ <% if handle_javascript %>
2
+ <script type="text/javascript" charset="utf-8">
3
+ if (typeof jQuery == 'undefined') {
4
+ var jquery_url = '/__insight__/jquery-1.3.2.js';
5
+ document.write(unescape('%3Cscript src="' + jquery_url + '" type="text/javascript"%3E%3C/script%3E'));
6
+ }
7
+ </script>
8
+ <script type="text/javascript" src="/__insight__/jquery.tablesorter.min.js"></script>
9
+ <script type="text/javascript" src="/__insight__/bookmarklet.js"></script>
10
+ <script type="text/javascript" src="/__insight__/insight.js"></script>
11
+ <% end %>
10
12
  <style type="text/css" media="screen">
11
13
  @import url(/__insight__/insight.css);
12
14
  </style>
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-insight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.27
4
+ version: 0.5.28
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Peter Boling
@@ -11,150 +12,170 @@ authors:
11
12
  autorequire:
12
13
  bindir: bin
13
14
  cert_chain: []
14
- date: 2013-09-03 00:00:00.000000000 Z
15
+ date: 2014-01-14 00:00:00.000000000 Z
15
16
  dependencies:
16
17
  - !ruby/object:Gem::Dependency
17
18
  name: rack
18
19
  requirement: !ruby/object:Gem::Requirement
20
+ none: false
19
21
  requirements:
20
- - - '>='
22
+ - - ! '>='
21
23
  - !ruby/object:Gem::Version
22
24
  version: '0'
23
25
  type: :runtime
24
26
  prerelease: false
25
27
  version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
26
29
  requirements:
27
- - - '>='
30
+ - - ! '>='
28
31
  - !ruby/object:Gem::Version
29
32
  version: '0'
30
33
  - !ruby/object:Gem::Dependency
31
34
  name: uuidtools
32
35
  requirement: !ruby/object:Gem::Requirement
36
+ none: false
33
37
  requirements:
34
- - - '>='
38
+ - - ! '>='
35
39
  - !ruby/object:Gem::Version
36
40
  version: 2.1.2
37
41
  type: :runtime
38
42
  prerelease: false
39
43
  version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
40
45
  requirements:
41
- - - '>='
46
+ - - ! '>='
42
47
  - !ruby/object:Gem::Version
43
48
  version: 2.1.2
44
49
  - !ruby/object:Gem::Dependency
45
50
  name: sqlite3
46
51
  requirement: !ruby/object:Gem::Requirement
52
+ none: false
47
53
  requirements:
48
- - - '>='
54
+ - - ! '>='
49
55
  - !ruby/object:Gem::Version
50
56
  version: 1.3.3
51
57
  type: :runtime
52
58
  prerelease: false
53
59
  version_requirements: !ruby/object:Gem::Requirement
60
+ none: false
54
61
  requirements:
55
- - - '>='
62
+ - - ! '>='
56
63
  - !ruby/object:Gem::Version
57
64
  version: 1.3.3
58
65
  - !ruby/object:Gem::Dependency
59
66
  name: reek
60
67
  requirement: !ruby/object:Gem::Requirement
68
+ none: false
61
69
  requirements:
62
- - - '>='
70
+ - - ! '>='
63
71
  - !ruby/object:Gem::Version
64
72
  version: 1.2.13
65
73
  type: :development
66
74
  prerelease: false
67
75
  version_requirements: !ruby/object:Gem::Requirement
76
+ none: false
68
77
  requirements:
69
- - - '>='
78
+ - - ! '>='
70
79
  - !ruby/object:Gem::Version
71
80
  version: 1.2.13
72
81
  - !ruby/object:Gem::Dependency
73
82
  name: roodi
74
83
  requirement: !ruby/object:Gem::Requirement
84
+ none: false
75
85
  requirements:
76
- - - '>='
86
+ - - ! '>='
77
87
  - !ruby/object:Gem::Version
78
88
  version: 2.2.0
79
89
  type: :development
80
90
  prerelease: false
81
91
  version_requirements: !ruby/object:Gem::Requirement
92
+ none: false
82
93
  requirements:
83
- - - '>='
94
+ - - ! '>='
84
95
  - !ruby/object:Gem::Version
85
96
  version: 2.2.0
86
97
  - !ruby/object:Gem::Dependency
87
98
  name: rake
88
99
  requirement: !ruby/object:Gem::Requirement
100
+ none: false
89
101
  requirements:
90
- - - '>='
102
+ - - ! '>='
91
103
  - !ruby/object:Gem::Version
92
104
  version: 10.1.0
93
105
  type: :development
94
106
  prerelease: false
95
107
  version_requirements: !ruby/object:Gem::Requirement
108
+ none: false
96
109
  requirements:
97
- - - '>='
110
+ - - ! '>='
98
111
  - !ruby/object:Gem::Version
99
112
  version: 10.1.0
100
113
  - !ruby/object:Gem::Dependency
101
114
  name: rspec
102
115
  requirement: !ruby/object:Gem::Requirement
116
+ none: false
103
117
  requirements:
104
- - - '>='
118
+ - - ! '>='
105
119
  - !ruby/object:Gem::Version
106
120
  version: 2.14.1
107
121
  type: :development
108
122
  prerelease: false
109
123
  version_requirements: !ruby/object:Gem::Requirement
124
+ none: false
110
125
  requirements:
111
- - - '>='
126
+ - - ! '>='
112
127
  - !ruby/object:Gem::Version
113
128
  version: 2.14.1
114
129
  - !ruby/object:Gem::Dependency
115
130
  name: sinatra
116
131
  requirement: !ruby/object:Gem::Requirement
132
+ none: false
117
133
  requirements:
118
- - - '>='
134
+ - - ! '>='
119
135
  - !ruby/object:Gem::Version
120
136
  version: 1.4.3
121
137
  type: :development
122
138
  prerelease: false
123
139
  version_requirements: !ruby/object:Gem::Requirement
140
+ none: false
124
141
  requirements:
125
- - - '>='
142
+ - - ! '>='
126
143
  - !ruby/object:Gem::Version
127
144
  version: 1.4.3
128
145
  - !ruby/object:Gem::Dependency
129
146
  name: webrat
130
147
  requirement: !ruby/object:Gem::Requirement
148
+ none: false
131
149
  requirements:
132
- - - '>='
150
+ - - ! '>='
133
151
  - !ruby/object:Gem::Version
134
152
  version: 0.7.3
135
153
  type: :development
136
154
  prerelease: false
137
155
  version_requirements: !ruby/object:Gem::Requirement
156
+ none: false
138
157
  requirements:
139
- - - '>='
158
+ - - ! '>='
140
159
  - !ruby/object:Gem::Version
141
160
  version: 0.7.3
142
161
  - !ruby/object:Gem::Dependency
143
162
  name: gem-release
144
163
  requirement: !ruby/object:Gem::Requirement
164
+ none: false
145
165
  requirements:
146
- - - '>='
166
+ - - ! '>='
147
167
  - !ruby/object:Gem::Version
148
168
  version: 0.6.0
149
169
  type: :development
150
170
  prerelease: false
151
171
  version_requirements: !ruby/object:Gem::Requirement
172
+ none: false
152
173
  requirements:
153
- - - '>='
174
+ - - ! '>='
154
175
  - !ruby/object:Gem::Version
155
176
  version: 0.6.0
156
- description: "Debugging toolbar for Rack applications implemented as\n middleware.
157
- \ Based on logical-insight and rack-bug. "
177
+ description: ! "Debugging toolbar for Rack applications implemented as middleware.\n
178
+ \ Based on logical-insight and rack-bug. "
158
179
  email:
159
180
  - peter.boling@gmail.com
160
181
  executables: []
@@ -164,28 +185,12 @@ extra_rdoc_files:
164
185
  - LICENSE
165
186
  - CHANGELOG
166
187
  files:
167
- - .gitignore
168
- - .rspec
169
- - .ruby-gemset
170
- - .ruby-version
171
- - .simplecov
172
- - .travis.yml
173
- - CHANGELOG
174
- - Gemfile
175
- - Gemfile.lock
176
- - LICENSE
177
- - README.md
178
- - Rakefile
179
- - TODO
180
- - lib/rack-insight.rb
181
- - lib/rack/insight.rb
182
188
  - lib/rack/insight/app.rb
183
189
  - lib/rack/insight/config.rb
184
190
  - lib/rack/insight/database.rb
185
191
  - lib/rack/insight/default_invocation.rb
186
192
  - lib/rack/insight/enable-button.rb
187
193
  - lib/rack/insight/filtered_backtrace.rb
188
- - lib/rack/insight/instrumentation.rb
189
194
  - lib/rack/insight/instrumentation/backstage.rb
190
195
  - lib/rack/insight/instrumentation/client.rb
191
196
  - lib/rack/insight/instrumentation/eigen_client.rb
@@ -194,41 +199,42 @@ files:
194
199
  - lib/rack/insight/instrumentation/probe-definition.rb
195
200
  - lib/rack/insight/instrumentation/probe.rb
196
201
  - lib/rack/insight/instrumentation/setup.rb
202
+ - lib/rack/insight/instrumentation.rb
197
203
  - lib/rack/insight/logging.rb
198
204
  - lib/rack/insight/magic_insight.rb
199
205
  - lib/rack/insight/options.rb
200
206
  - lib/rack/insight/panel.rb
201
207
  - lib/rack/insight/panel_app.rb
202
- - lib/rack/insight/panels-content.rb
203
- - lib/rack/insight/panels-header.rb
204
208
  - lib/rack/insight/panels/active_record_panel.rb
205
- - lib/rack/insight/panels/active_resource_panel.rb
206
209
  - lib/rack/insight/panels/active_resource_panel/query.rb
207
- - lib/rack/insight/panels/cache_panel.rb
210
+ - lib/rack/insight/panels/active_resource_panel.rb
208
211
  - lib/rack/insight/panels/cache_panel/panel_app.rb
209
212
  - lib/rack/insight/panels/cache_panel/stats.rb
213
+ - lib/rack/insight/panels/cache_panel.rb
210
214
  - lib/rack/insight/panels/log_panel.rb
211
215
  - lib/rack/insight/panels/memory_panel.rb
212
- - lib/rack/insight/panels/mongo_panel.rb
213
216
  - lib/rack/insight/panels/mongo_panel/mongo_extension.rb
214
217
  - lib/rack/insight/panels/mongo_panel/stats.rb
218
+ - lib/rack/insight/panels/mongo_panel.rb
215
219
  - lib/rack/insight/panels/rails_info_panel.rb
216
- - lib/rack/insight/panels/redis_panel.rb
217
220
  - lib/rack/insight/panels/redis_panel/stats.rb
221
+ - lib/rack/insight/panels/redis_panel.rb
218
222
  - lib/rack/insight/panels/request_variables_panel.rb
219
- - lib/rack/insight/panels/speedtracer_panel.rb
220
223
  - lib/rack/insight/panels/speedtracer_panel/profiling.rb
221
224
  - lib/rack/insight/panels/speedtracer_panel/trace-app.rb
222
225
  - lib/rack/insight/panels/speedtracer_panel/tracer.rb
223
- - lib/rack/insight/panels/sphinx_panel.rb
226
+ - lib/rack/insight/panels/speedtracer_panel.rb
224
227
  - lib/rack/insight/panels/sphinx_panel/stats.rb
225
- - lib/rack/insight/panels/sql_panel.rb
228
+ - lib/rack/insight/panels/sphinx_panel.rb
226
229
  - lib/rack/insight/panels/sql_panel/panel_app.rb
227
230
  - lib/rack/insight/panels/sql_panel/query.rb
228
- - lib/rack/insight/panels/templates_panel.rb
231
+ - lib/rack/insight/panels/sql_panel.rb
229
232
  - lib/rack/insight/panels/templates_panel/rendering.rb
230
233
  - lib/rack/insight/panels/templates_panel/stats.rb
234
+ - lib/rack/insight/panels/templates_panel.rb
231
235
  - lib/rack/insight/panels/timer_panel.rb
236
+ - lib/rack/insight/panels-content.rb
237
+ - lib/rack/insight/panels-header.rb
232
238
  - lib/rack/insight/params_signature.rb
233
239
  - lib/rack/insight/path-filter.rb
234
240
  - lib/rack/insight/public/__insight__/bookmarklet.html
@@ -275,77 +281,35 @@ files:
275
281
  - lib/rack/insight/views/redirect.html.erb
276
282
  - lib/rack/insight/views/request_fragment.html.erb
277
283
  - lib/rack/insight/views/toolbar.html.erb
278
- - rack-insight.gemspec
279
- - spec/custom_matchers.rb
280
- - spec/fixtures/config.ru
281
- - spec/fixtures/dummy_panel.rb
282
- - spec/fixtures/sample_app.rb
283
- - spec/fixtures/star_trek_panel.rb
284
- - spec/fixtures/views/star_trek.html.erb
285
- - spec/insight_spec.rb
286
- - spec/instrumentation_spec.rb
287
- - spec/rack/insight/config_spec.rb
288
- - spec/rack/insight/panels/active_record_panel_spec.rb
289
- - spec/rack/insight/panels/active_resource_panel_spec.rb
290
- - spec/rack/insight/panels/cache_panel_spec.rb
291
- - spec/rack/insight/panels/log_panel_spec.rb
292
- - spec/rack/insight/panels/memory_panel_spec.rb
293
- - spec/rack/insight/panels/mongo_panel_spec_pending.rb
294
- - spec/rack/insight/panels/rails_info_panel_spec.rb
295
- - spec/rack/insight/panels/redis_panel_spec.rb
296
- - spec/rack/insight/panels/speedtracer_panel_spec.rb
297
- - spec/rack/insight/panels/sql_panel_spec.rb
298
- - spec/rack/insight/panels/templates_panel_spec.rb
299
- - spec/rack/insight/panels/timer_panel_spec.rb
300
- - spec/rcov.opts
301
- - spec/spec.opts
302
- - spec/spec_helper.rb
284
+ - lib/rack/insight.rb
285
+ - lib/rack-insight.rb
286
+ - LICENSE
287
+ - README.md
288
+ - CHANGELOG
289
+ - Rakefile
303
290
  homepage: https://github.com/pboling/rack-insight
304
291
  licenses:
305
292
  - MIT
306
- metadata: {}
307
293
  post_install_message:
308
294
  rdoc_options: []
309
295
  require_paths:
310
296
  - lib
311
297
  required_ruby_version: !ruby/object:Gem::Requirement
298
+ none: false
312
299
  requirements:
313
- - - '>='
300
+ - - ! '>='
314
301
  - !ruby/object:Gem::Version
315
302
  version: '0'
316
303
  required_rubygems_version: !ruby/object:Gem::Requirement
304
+ none: false
317
305
  requirements:
318
- - - '>='
306
+ - - ! '>='
319
307
  - !ruby/object:Gem::Version
320
308
  version: '0'
321
309
  requirements: []
322
310
  rubyforge_project:
323
- rubygems_version: 2.0.3
311
+ rubygems_version: 1.8.25
324
312
  signing_key:
325
- specification_version: 4
313
+ specification_version: 3
326
314
  summary: Debugging toolbar for Rack applications implemented as middleware.
327
- test_files:
328
- - spec/custom_matchers.rb
329
- - spec/fixtures/config.ru
330
- - spec/fixtures/dummy_panel.rb
331
- - spec/fixtures/sample_app.rb
332
- - spec/fixtures/star_trek_panel.rb
333
- - spec/fixtures/views/star_trek.html.erb
334
- - spec/insight_spec.rb
335
- - spec/instrumentation_spec.rb
336
- - spec/rack/insight/config_spec.rb
337
- - spec/rack/insight/panels/active_record_panel_spec.rb
338
- - spec/rack/insight/panels/active_resource_panel_spec.rb
339
- - spec/rack/insight/panels/cache_panel_spec.rb
340
- - spec/rack/insight/panels/log_panel_spec.rb
341
- - spec/rack/insight/panels/memory_panel_spec.rb
342
- - spec/rack/insight/panels/mongo_panel_spec_pending.rb
343
- - spec/rack/insight/panels/rails_info_panel_spec.rb
344
- - spec/rack/insight/panels/redis_panel_spec.rb
345
- - spec/rack/insight/panels/speedtracer_panel_spec.rb
346
- - spec/rack/insight/panels/sql_panel_spec.rb
347
- - spec/rack/insight/panels/templates_panel_spec.rb
348
- - spec/rack/insight/panels/timer_panel_spec.rb
349
- - spec/rcov.opts
350
- - spec/spec.opts
351
- - spec/spec_helper.rb
315
+ test_files: []