rails_band 0.8.4 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -13
- data/lib/rails_band/action_controller/event/send_stream.rb +28 -0
- data/lib/rails_band/action_controller/log_subscriber.rb +5 -0
- data/lib/rails_band/action_dispatch/event/request.rb +14 -0
- data/lib/rails_band/action_dispatch/log_subscriber.rb +5 -0
- data/lib/rails_band/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba808adbe0481a5e503e5a8bd5e621bdc3d40b08c6166081277546b7773a3291
|
4
|
+
data.tar.gz: 1795c39ac09d86aa3840364eb9a5266503f41933654c95202eb1aaf6ce737ba7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf0b8203cf992058b1a02257d5f7ffa873bfcf0e26e63786f869272085f50459ac3fb0a26ddc603210f009160afe623251272d78786f2d6aec7537968346b74c
|
7
|
+
data.tar.gz: cf539bdb9ddb74150f5551ce9e87f7ec2c92130a36ec4ce6987a72cca2845813dce5ce86dde8a8d97403558a80e24d19f74d182689d8dd1689ca134227154bca
|
data/README.md
CHANGED
@@ -64,6 +64,7 @@ These are Rails Instrumentation API hooks supported by this gem so far.
|
|
64
64
|
| [`start_processing.action_controller`](https://guides.rubyonrails.org/active_support_instrumentation.html#start-processing-action-controller) | ✅ |
|
65
65
|
| [`process_action.action_controller`](https://guides.rubyonrails.org/active_support_instrumentation.html#process-action-action-controller) | ✅ |
|
66
66
|
| [`send_file.action_controller`](https://guides.rubyonrails.org/active_support_instrumentation.html#send-file-action-controller) | ✅ |
|
67
|
+
| [`send_stream.action_controller`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#send-stream-action-controller) | ✅ |
|
67
68
|
| [`send_data.action_controller`](https://guides.rubyonrails.org/active_support_instrumentation.html#send-data-action-controller) | ✅ |
|
68
69
|
| [`redirect_to.action_controller`](https://guides.rubyonrails.org/active_support_instrumentation.html#redirect-to-action-controller) | ✅ |
|
69
70
|
| [`halted_callback.action_controller`](https://guides.rubyonrails.org/active_support_instrumentation.html#halted-callback-action-controller) | ✅ |
|
@@ -75,6 +76,7 @@ These are Rails Instrumentation API hooks supported by this gem so far.
|
|
75
76
|
| --------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
|
76
77
|
| [`process_middleware.action_dispatch`](https://guides.rubyonrails.org/active_support_instrumentation.html#process-middleware-action-dispatch) | ✅ |
|
77
78
|
| [`redirect.action_dispatch`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#redirect-action-dispatch) | ✅ |
|
79
|
+
| [`request.action_dispatch`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#request-action-dispatch) | ✅ |
|
78
80
|
|
79
81
|
### Action View
|
80
82
|
|
@@ -100,19 +102,30 @@ These are Rails Instrumentation API hooks supported by this gem so far.
|
|
100
102
|
| [`deliver.action_mailer`](https://guides.rubyonrails.org/active_support_instrumentation.html#deliver-action-mailer) | ✅ |
|
101
103
|
| [`process.action_mailer`](https://guides.rubyonrails.org/active_support_instrumentation.html#process-action-mailer) | ✅ |
|
102
104
|
|
103
|
-
### Active Support
|
104
|
-
|
105
|
-
| Event name
|
106
|
-
|
|
107
|
-
| [`cache_read.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-read-active-support)
|
108
|
-
| `cache_read_multi.active_support`
|
109
|
-
| [`cache_generate.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-generate-active-support)
|
110
|
-
| [`cache_fetch_hit.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-fetch-hit-active-support)
|
111
|
-
| [`cache_write.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-write-active-support)
|
112
|
-
| `cache_write_multi.active_support`
|
113
|
-
| [`
|
114
|
-
| `
|
115
|
-
| [`
|
105
|
+
### Active Support — Caching
|
106
|
+
|
107
|
+
| Event name | Supported |
|
108
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
|
109
|
+
| [`cache_read.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-read-active-support) | ✅ |
|
110
|
+
| [`cache_read_multi.active_support`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#cache-read-multi-active-support) | ✅ |
|
111
|
+
| [`cache_generate.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-generate-active-support) | ✅ |
|
112
|
+
| [`cache_fetch_hit.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-fetch-hit-active-support) | ✅ |
|
113
|
+
| [`cache_write.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-write-active-support) | ✅ |
|
114
|
+
| [`cache_write_multi.active_support`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#cache-write-multi-active-support) | ✅ |
|
115
|
+
| [`cache_increment.active_support`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#cache-increment-active-support) | |
|
116
|
+
| [`cache_decrement.active_support `](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#cache-decrement-active-support) | |
|
117
|
+
| [`cache_delete.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-delete-active-support) | ✅ |
|
118
|
+
| [`cache_delete_multi.active_support`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#cache-delete-multi-active-support) | ✅ |
|
119
|
+
| [`cache_delete_matched.active_support`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#cache-delete-matched-active-support) | |
|
120
|
+
| [`cache_cleanup.active_support`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#cache-cleanup-active-support) | |
|
121
|
+
| [`cache_prune.active_support`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#cache-prune-active-support) | |
|
122
|
+
| [`cache_exist?.active_support`](https://guides.rubyonrails.org/active_support_instrumentation.html#cache-exist-questionmark-active-support) | ✅ |
|
123
|
+
|
124
|
+
### Active Support — Messages
|
125
|
+
|
126
|
+
| Event name | Supported |
|
127
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
|
128
|
+
| [`message_serializer_fallback.active_support`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#message-serializer-fallback-active-support) | |
|
116
129
|
|
117
130
|
### Active Job
|
118
131
|
|
@@ -154,6 +167,12 @@ These are Rails Instrumentation API hooks supported by this gem so far.
|
|
154
167
|
| [`transform.active_storage`](https://guides.rubyonrails.org/active_support_instrumentation.html#transform-active-storage) | ✅ |
|
155
168
|
| [`analyze.active_storage`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#analyze-active-storage) | ✅ |
|
156
169
|
|
170
|
+
### Action Mailbox
|
171
|
+
|
172
|
+
| Event name | Supported |
|
173
|
+
| ------------------------------------------------------------------------------------------------------------------------- | --------- |
|
174
|
+
| [`process.action_mailbox`](https://edgeguides.rubyonrails.org/active_support_instrumentation.html#process-action-mailbox) | |
|
175
|
+
|
157
176
|
### Railties
|
158
177
|
|
159
178
|
| Event name | Supported |
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RailsBand
|
4
|
+
module ActionController
|
5
|
+
module Event
|
6
|
+
# A wrapper for the event that is passed to `send_stream.action_controller`.
|
7
|
+
class SendStream < BaseEvent
|
8
|
+
def filename
|
9
|
+
return @filename if defined? @filename
|
10
|
+
|
11
|
+
@filename = @event.payload[:filename]
|
12
|
+
end
|
13
|
+
|
14
|
+
def type
|
15
|
+
return @type if defined? @type
|
16
|
+
|
17
|
+
@type = @event.payload[:type]
|
18
|
+
end
|
19
|
+
|
20
|
+
def disposition
|
21
|
+
return @disposition if defined? @disposition
|
22
|
+
|
23
|
+
@disposition = @event.payload[:disposition]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -7,6 +7,7 @@ require 'rails_band/action_controller/event/exist_fragment'
|
|
7
7
|
require 'rails_band/action_controller/event/start_processing'
|
8
8
|
require 'rails_band/action_controller/event/process_action'
|
9
9
|
require 'rails_band/action_controller/event/send_file'
|
10
|
+
require 'rails_band/action_controller/event/send_stream'
|
10
11
|
require 'rails_band/action_controller/event/send_data'
|
11
12
|
require 'rails_band/action_controller/event/redirect_to'
|
12
13
|
require 'rails_band/action_controller/event/halted_callback'
|
@@ -50,6 +51,10 @@ module RailsBand
|
|
50
51
|
consumer_of(__method__)&.call(Event::SendFile.new(event))
|
51
52
|
end
|
52
53
|
|
54
|
+
def send_stream(event)
|
55
|
+
consumer_of(__method__)&.call(Event::SendStream.new(event))
|
56
|
+
end
|
57
|
+
|
53
58
|
def send_data(event)
|
54
59
|
consumer_of(__method__)&.call(Event::SendData.new(event))
|
55
60
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RailsBand
|
4
|
+
module ActionDispatch
|
5
|
+
module Event
|
6
|
+
# A wrapper for the event that is passed to `redirect.action_dispatch`.
|
7
|
+
class Request < BaseEvent
|
8
|
+
def request
|
9
|
+
@request ||= @event.payload.fetch(:request)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'rails_band/action_dispatch/event/process_middleware'
|
4
4
|
require 'rails_band/action_dispatch/event/redirect'
|
5
|
+
require 'rails_band/action_dispatch/event/request'
|
5
6
|
|
6
7
|
module RailsBand
|
7
8
|
module ActionDispatch
|
@@ -17,6 +18,10 @@ module RailsBand
|
|
17
18
|
consumer_of(__method__)&.call(Event::Redirect.new(event))
|
18
19
|
end
|
19
20
|
|
21
|
+
def request(event)
|
22
|
+
consumer_of(__method__)&.call(Event::Request.new(event))
|
23
|
+
end
|
24
|
+
|
20
25
|
private
|
21
26
|
|
22
27
|
def consumer_of(sub_event)
|
data/lib/rails_band/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_band
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yutaka Kamei
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -55,12 +55,14 @@ files:
|
|
55
55
|
- lib/rails_band/action_controller/event/redirect_to.rb
|
56
56
|
- lib/rails_band/action_controller/event/send_data.rb
|
57
57
|
- lib/rails_band/action_controller/event/send_file.rb
|
58
|
+
- lib/rails_band/action_controller/event/send_stream.rb
|
58
59
|
- lib/rails_band/action_controller/event/start_processing.rb
|
59
60
|
- lib/rails_band/action_controller/event/unpermitted_parameters.rb
|
60
61
|
- lib/rails_band/action_controller/event/write_fragment.rb
|
61
62
|
- lib/rails_band/action_controller/log_subscriber.rb
|
62
63
|
- lib/rails_band/action_dispatch/event/process_middleware.rb
|
63
64
|
- lib/rails_band/action_dispatch/event/redirect.rb
|
65
|
+
- lib/rails_band/action_dispatch/event/request.rb
|
64
66
|
- lib/rails_band/action_dispatch/log_subscriber.rb
|
65
67
|
- lib/rails_band/action_mailer/event/deliver.rb
|
66
68
|
- lib/rails_band/action_mailer/event/process.rb
|
@@ -134,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
136
|
- !ruby/object:Gem::Version
|
135
137
|
version: '0'
|
136
138
|
requirements: []
|
137
|
-
rubygems_version: 3.5.
|
139
|
+
rubygems_version: 3.5.9
|
138
140
|
signing_key:
|
139
141
|
specification_version: 4
|
140
142
|
summary: Easy-to-use Rails Instrumentation API
|