app_profiler 0.1.9 → 0.1.10

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: 6411e547488321b7d7de4fb7cc2d19c48ac462559331ac79b1e161ac11339fe7
4
- data.tar.gz: 8f78938dfcdf37ee184371c6772db42cbca73e547aaab2e904ec51135cb4b69a
3
+ metadata.gz: 70f971ebae2492140483b90ada2f0d1daf33874803dcc4ea5404877093651974
4
+ data.tar.gz: df8395bf47f6e378f9322386a17c1934e9b38ac9269ea7ded80a721de7a5c4e9
5
5
  SHA512:
6
- metadata.gz: 992474693598d4ff50a51d703143d593cb32156fa12f1e9d65fedd6489d5ff5a8d4d6a823a608dca814a64d505a85dc74a36000a07c0c4803377b9ba28cf5457
7
- data.tar.gz: f184c40a906cc4cf2989becfd0cf5e8dab28c17a3f2a7cf6ad51da3e244a69d58a60bfc8c8b5011d3bcf955602cce24f36dd2122990104e1d2645b3e76a4fc01
6
+ metadata.gz: 2a10f138198666ddc840658e9599c05c40d4d2a14442b0cfa52df8776e00601fda95aaea871138656cdf2a05ae697966e30fbc62c3a1e5351b04987639a63b82
7
+ data.tar.gz: 2c6af888489015d1bcd827704a7710512455bd2c05d4e3aee596c32063d3b134049d592e5c0012d947e7f1f4731e8a55752303064f866cb535d8fb9ae06b91b9
@@ -4,8 +4,8 @@ module AppProfiler
4
4
  class Middleware
5
5
  class ViewAction < BaseAction
6
6
  class << self
7
- def call(profile, _params = {})
8
- profile.view
7
+ def call(profile, params = {})
8
+ profile.view(**params)
9
9
  end
10
10
  end
11
11
  end
@@ -33,8 +33,8 @@ module AppProfiler
33
33
  @data[:mode]
34
34
  end
35
35
 
36
- def view
37
- AppProfiler.viewer.view(self)
36
+ def view(params = {})
37
+ AppProfiler.viewer.view(self, **params)
38
38
  end
39
39
 
40
40
  def upload
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppProfiler
4
- VERSION = "0.1.9"
4
+ VERSION = "0.1.10"
5
5
  end
@@ -4,12 +4,12 @@ module AppProfiler
4
4
  module Viewer
5
5
  class BaseViewer
6
6
  class << self
7
- def view(profile)
8
- new(profile).view
7
+ def view(profile, params = {})
8
+ new(profile).view(**params)
9
9
  end
10
10
  end
11
11
 
12
- def view(_profile)
12
+ def view(_params = {})
13
13
  raise NotImplementedError
14
14
  end
15
15
  end
@@ -7,8 +7,8 @@ module AppProfiler
7
7
  module Viewer
8
8
  class SpeedscopeRemoteViewer < BaseViewer
9
9
  class << self
10
- def view(profile)
11
- new(profile).view
10
+ def view(profile, params = {})
11
+ new(profile).view(**params)
12
12
  end
13
13
  end
14
14
 
@@ -17,9 +17,15 @@ module AppProfiler
17
17
  @profile = profile
18
18
  end
19
19
 
20
- def view
20
+ def view(response: nil, autoredirect: nil, async: false)
21
21
  id = Middleware.id(@profile.file)
22
- AppProfiler.logger.info("[Profiler] Profile available at /app_profiler/#{id}\n")
22
+
23
+ if response && response[0].to_i < 500
24
+ response[1]["Location"] = "/app_profiler/#{id}"
25
+ response[0] = 303
26
+ else
27
+ AppProfiler.logger.info("[Profiler] Profile available at /app_profiler/#{id}\n")
28
+ end
23
29
  end
24
30
  end
25
31
  end
@@ -9,8 +9,8 @@ module AppProfiler
9
9
  include Yarn::WithSpeedscope
10
10
 
11
11
  class << self
12
- def view(profile)
13
- new(profile).view
12
+ def view(profile, params = {})
13
+ new(profile).view(**params)
14
14
  end
15
15
  end
16
16
 
@@ -19,7 +19,7 @@ module AppProfiler
19
19
  @profile = profile
20
20
  end
21
21
 
22
- def view
22
+ def view(_params = {})
23
23
  yarn("run", "speedscope", @profile.file.to_s)
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gannon McGibbon
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2023-12-08 00:00:00.000000000 Z
16
+ date: 2023-12-13 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activesupport