rails_band 0.8.3 → 0.9.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
  SHA256:
3
- metadata.gz: 701f0145b497d440d86c0d184c83369e3be51930e83d83924b2b906c0656f9ed
4
- data.tar.gz: a8622e602a198d831f9e7b5c8621e6853b3ed1b65ecd396a7f4d352693823c5c
3
+ metadata.gz: 34881b30e4915c22757b49f247fcc759cdffded452f6f7ac2951fed5500d95b9
4
+ data.tar.gz: 53e59f258f2cbbffc68d461a28490a39164915115902be3fbb4bec12a03383bb
5
5
  SHA512:
6
- metadata.gz: e305b382c73f079434911ea4c379ba9137b47dface3e89e6670df649e4165210328a0d0855de33ad9b5b8db0d76b4670383159f4df7ed58ec2131b82649880a7
7
- data.tar.gz: 7b68379f4452d9057f1bfda12c16efd85ff151de8a1d6a170610f8ba0b303769455c24a70695ca3759a9f91d5e61262d3dd90dc83071da40f1f49be35f54cda4
6
+ metadata.gz: 3780f2f7fd5fcdfeb98fc45ffb37578c53c0fb88bdb9bfd9ca6acd88241e6d9597a41fdac2bc7f7e47852a0c5f8e6d11db8db132478d99d3609d3d6b401cf49a
7
+ data.tar.gz: 056bbf55db47f21019af355e89dc7de001d71a45c67a219e4836ed37014e43b45b142ee73b3ee0fc44366e84865490e37447e90f572ca99a59ef89e210e357b4
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) | ✅ |
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsBand
4
- VERSION = '0.8.3'
4
+ VERSION = '0.9.0'
5
5
  end
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.8.3
4
+ version: 0.9.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: 2023-11-12 00:00:00.000000000 Z
11
+ date: 2024-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -55,6 +55,7 @@ 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
@@ -134,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
135
  - !ruby/object:Gem::Version
135
136
  version: '0'
136
137
  requirements: []
137
- rubygems_version: 3.4.10
138
+ rubygems_version: 3.5.3
138
139
  signing_key:
139
140
  specification_version: 4
140
141
  summary: Easy-to-use Rails Instrumentation API