rack-mini-profiler 4.0.0 → 4.0.1

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
  SHA256:
3
- metadata.gz: fb35c9ff911dd9dcc3fc5cccf15d62f21f0c04ed79ff5dec3e88746fcb90a43f
4
- data.tar.gz: a8cd39cdb11b4bb2ed154e9c3269de66b6f9c351c8cdcdb775e73e0c25e5d5a2
3
+ metadata.gz: 42fc6776e2b641650c4bd2f16f62a9e11bfdf3a5638e6c306b9436de6cdac729
4
+ data.tar.gz: 9d8d76bb678e2164c9794fd69952f0cd640c0c5d9ead859fc76d01f91b1b880b
5
5
  SHA512:
6
- metadata.gz: 1c1123a2fc22b5f20ea63fa089b4914f214a6da3d88dbba2fe1b3f597c92c653a166dc1c97d8a68e51a71893b9787ca11b99db1a68aa19da04cad494d8f33af9
7
- data.tar.gz: b21baa7055d5252cf3f57031be17e67810d898e4b40428d12409027454bfa15b414e2346f07e49d09b139945eb177f8951a34f41c765773ac543c49c2f0efd81
6
+ metadata.gz: 1a65680e4e68317d53b9edbd8d4381a49206f4a97b4a681c63023247d4c4d756480420e5bbaf4ccf2ed07f7b73a9ccd46e19c436e8f5ab47ae5e973bf4f7ac11
7
+ data.tar.gz: 2fadd5b851e08c507f536dc2e59a5480ffe53807f421f75af840cfebc59615ae06967fee4f53dd94dadd99768993953e2b95abf207c650b0f5a34c7bbe4ab283
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 4.0.1 - 2025-07-31
4
+
5
+ - [FIX] Ensure Rack 2 / 3 cross compatibility [#654](https://github/com/MiniProfiler/rack-mini-profiler/pull/654)
3
6
  ## 4.0 - 2025-06-11
4
7
 
5
8
  - [BREAKING CHANGE] Ruby version 3.1.0 or later is required. [#632](https://github.com/MiniProfiler/rack-mini-profiler/pull/632)
@@ -151,7 +151,7 @@ String stats:
151
151
  body << "#{count} : #{string}\n"
152
152
  end
153
153
 
154
- [200, { 'Content-Type' => 'text/plain' }, body]
154
+ [200, { Rack::CONTENT_TYPE => 'text/plain' }, body]
155
155
  ensure
156
156
  prev_gc_state ? GC.disable : GC.enable
157
157
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Rack
4
4
  class MiniProfiler
5
- VERSION = "4.0.0"
5
+ VERSION = "4.0.1"
6
6
  SOURCE_CODE_URI = "https://github.com/MiniProfiler/rack-mini-profiler"
7
7
  end
8
8
  end
data/lib/mini_profiler.rb CHANGED
@@ -329,7 +329,7 @@ module Rack
329
329
  )
330
330
  end
331
331
  elsif path == '/rack-mini-profiler/requests'
332
- status, headers, body = [200, { 'Content-Type' => 'text/html' }, [blank_page_html.dup]] # important to dup here!
332
+ status, headers, body = [200, { Rack::CONTENT_TYPE => 'text/html' }, [blank_page_html.dup]] # important to dup here!
333
333
  else
334
334
  status, headers, body = @app.call(env)
335
335
  end
@@ -423,20 +423,20 @@ module Rack
423
423
  def inject_profiler(env, status, headers, body)
424
424
  # mini profiler is meddling with stuff, we can not cache cause we will get incorrect data
425
425
  # Rack::ETag has already inserted some nonesense in the chain
426
- content_type = headers['Content-Type']
426
+ content_type = headers[Rack::CONTENT_TYPE]
427
427
 
428
428
  if config.disable_caching
429
- headers.delete('ETag')
430
- headers.delete('Date')
429
+ headers.delete(Rack::ETAG)
430
+ headers.delete('date') || headers.delete('Date')
431
431
  end
432
432
 
433
- headers['X-MiniProfiler-Original-Cache-Control'] = headers['Cache-Control'] unless headers['Cache-Control'].nil?
434
- headers['Cache-Control'] = "#{"no-store, " if config.disable_caching}must-revalidate, private, max-age=0"
433
+ headers['x-miniprofiler-original-cache-control'] = headers[Rack::CACHE_CONTROL] unless headers[Rack::CACHE_CONTROL].nil?
434
+ headers[Rack::CACHE_CONTROL] = "#{"no-store, " if config.disable_caching}must-revalidate, private, max-age=0"
435
435
 
436
436
  # inject header
437
437
  if headers.is_a? Hash
438
- headers['X-MiniProfiler-Ids'] = ids_comma_separated(env)
439
- headers['X-MiniProfiler-Flamegraph-Path'] = flamegraph_path(env) if current.page_struct[:has_flamegraph]
438
+ headers['x-miniprofiler-ids'] = ids_comma_separated(env)
439
+ headers['x-miniprofiler-flamegraph-path'] = flamegraph_path(env) if current.page_struct[:has_flamegraph]
440
440
  end
441
441
 
442
442
  if current.inject_js && content_type =~ /text\/html/
@@ -589,7 +589,7 @@ module Rack
589
589
  end
590
590
 
591
591
  def text_result(body, status: 200, headers: nil)
592
- headers = (headers || {}).merge('Content-Type' => 'text/plain; charset=utf-8')
592
+ headers = (headers || {}).merge(Rack::CONTENT_TYPE => 'text/plain; charset=utf-8')
593
593
  [status, headers, [body]]
594
594
  end
595
595
 
@@ -15,12 +15,12 @@ module Rack
15
15
  end
16
16
  end
17
17
 
18
- def log_with_miniprofiler(*args, &block)
19
- return log_without_miniprofiler(*args, &block) unless SqlPatches.should_measure?
18
+ def log_with_miniprofiler(*args, **kwargs, &block)
19
+ return log_without_miniprofiler(*args, **kwargs, &block) unless SqlPatches.should_measure?
20
20
 
21
21
  sql, name, binds = args
22
22
  start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
23
- rval = log_without_miniprofiler(*args, &block)
23
+ rval = log_without_miniprofiler(*args, **kwargs, &block)
24
24
 
25
25
  # Don't log schema queries if the option is set
26
26
  return rval if Rack::MiniProfiler.config.skip_schema_queries && name =~ (/SCHEMA/)
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-mini-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  - Robin Ward
9
9
  - Aleks Totic
10
+ autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2025-06-10 00:00:00.000000000 Z
13
+ date: 2025-07-31 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rack
@@ -347,6 +348,7 @@ licenses:
347
348
  metadata:
348
349
  source_code_uri: https://github.com/MiniProfiler/rack-mini-profiler
349
350
  changelog_uri: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md
351
+ post_install_message:
350
352
  rdoc_options: []
351
353
  require_paths:
352
354
  - lib
@@ -361,7 +363,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
361
363
  - !ruby/object:Gem::Version
362
364
  version: '0'
363
365
  requirements: []
364
- rubygems_version: 3.6.3
366
+ rubygems_version: 3.5.22
367
+ signing_key:
365
368
  specification_version: 4
366
369
  summary: Profiles loading speed for rack applications.
367
370
  test_files: []