actiontext 6.0.4.7 → 6.0.5.1

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: 5b77160fe2c6cd4f56f7974a7bd19e4121e2d161d85feae75a8011b76b8e9f3a
4
- data.tar.gz: 0c390b181065ef476d0f5753fb78acd8c3e3f4aff31884c068dbbb3aca0648b7
3
+ metadata.gz: 6791bd84b8baa3e269b4aca66489a6692f50244821685e8622e5edc56506f698
4
+ data.tar.gz: 69d0f14f83ef82b937dac0e3254a4e61a2cf73a0d0b8abc0d5bc8bd59b0a5af0
5
5
  SHA512:
6
- metadata.gz: 32e4b779d2988ebd70dd2d50f10dd2b470e45dd92495a13570431a92e85b24c9d111806f601187bdcc67a645c76482e950781ffa7f56cc412fae8d2c181c5b12
7
- data.tar.gz: 820e9ea5d1b17cf1eeb75c14d77034f5fe099a4efb9e3fdc81119e25534735d36913acc63cad30a320964d52ab53e4401fa9f441336ec9d6de4243c20391a64f
6
+ metadata.gz: 89be14985618d343e8894e1077214bc3c2ec73dfeb28e997f0da0a2531f6bbb07a76d2ba515d577c1d98f2d3c4964fd06ab574de912893e055b135cae5d164b4
7
+ data.tar.gz: 66355ac968eea08bce46c1c91e5ab86f2b6db65c929c60320ebc4af8e726dc2c532c36626979df3cc1c3bd97b6e4bb0a3b6e9c0008b4b6db2c89d839d579166d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## Rails 6.0.5.1 (July 12, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.0.5 (May 09, 2022) ##
7
+
8
+ * Disentangle Action Text from ApplicationController
9
+
10
+ Allow Action Text to be used without having an ApplicationController
11
+ defined.
12
+ This makes sure:
13
+ * Action Text attachments render the correct URL host in mailers.
14
+ * an ActionController::Renderer isn't allocated per request.
15
+ * Sidekiq doesn't hang with the "classic" autoloader.
16
+
17
+ *Jonathan Hefner*
18
+
19
+ ## Rails 6.0.4.8 (April 26, 2022) ##
20
+
21
+ * No changes.
22
+
23
+
1
24
  ## Rails 6.0.4.7 (March 08, 2022) ##
2
25
 
3
26
  * No changes.
@@ -10,6 +10,7 @@ module ActionText
10
10
  mattr_accessor(:scrubber)
11
11
 
12
12
  def render_action_text_content(content)
13
+ self.prefix_partial_path_with_controller_namespace = false
13
14
  sanitize_action_text_content(render_action_text_attachments(content))
14
15
  end
15
16
 
@@ -26,7 +26,7 @@ module ActionText
26
26
  private
27
27
  def trix_attachment_content
28
28
  if partial_path = attachable.try(:to_trix_content_attachment_partial_path)
29
- ActionText::Content.renderer.render(partial: partial_path, object: self, as: model_name.element)
29
+ ActionText::Content.render(partial: partial_path, object: self, as: model_name.element)
30
30
  end
31
31
  end
32
32
  end
@@ -1,12 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_support/core_ext/module/attribute_accessors_per_thread"
4
-
5
3
  module ActionText
6
4
  class Content
7
- include Serialization
8
-
9
- thread_cattr_accessor :renderer
5
+ include Rendering, Serialization
10
6
 
11
7
  attr_reader :fragment
12
8
 
@@ -88,7 +84,7 @@ module ActionText
88
84
  end
89
85
 
90
86
  def to_rendered_html_with_layout
91
- renderer.render(partial: "action_text/content/layout", locals: { content: self })
87
+ render partial: "action_text/content/layout", locals: { content: self }
92
88
  end
93
89
 
94
90
  def to_s
@@ -37,21 +37,24 @@ module ActionText
37
37
  end
38
38
 
39
39
  initializer "action_text.helper" do
40
- ActiveSupport.on_load(:action_controller_base) do
41
- helper ActionText::Engine.helpers
40
+ %i[action_controller_base action_mailer].each do |abstract_controller|
41
+ ActiveSupport.on_load(abstract_controller) do
42
+ helper ActionText::Engine.helpers
43
+ end
42
44
  end
43
45
  end
44
46
 
45
- initializer "action_text.renderer" do |app|
46
- app.executor.to_run { ActionText::Content.renderer = ApplicationController.renderer }
47
- app.executor.to_complete { ActionText::Content.renderer = ApplicationController.renderer }
48
-
47
+ initializer "action_text.renderer" do
49
48
  ActiveSupport.on_load(:action_text_content) do
50
- self.renderer = ApplicationController.renderer
49
+ self.renderer = Class.new(ActionController::Base).renderer
51
50
  end
52
51
 
53
- ActiveSupport.on_load(:action_controller_base) do
54
- before_action { ActionText::Content.renderer = ApplicationController.renderer.new(request.env) }
52
+ %i[action_controller_base action_mailer].each do |abstract_controller|
53
+ ActiveSupport.on_load(abstract_controller) do
54
+ around_action do |controller, action|
55
+ ActionText::Content.with_renderer(controller, &action)
56
+ end
57
+ end
55
58
  end
56
59
  end
57
60
  end
@@ -9,8 +9,8 @@ module ActionText
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 0
12
- TINY = 4
13
- PRE = "7"
12
+ TINY = 5
13
+ PRE = "1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/concern"
4
+ require "active_support/core_ext/module/attribute_accessors_per_thread"
5
+
6
+ module ActionText
7
+ module Rendering #:nodoc:
8
+ extend ActiveSupport::Concern
9
+
10
+ included do
11
+ thread_cattr_accessor :renderer, instance_accessor: false
12
+ delegate :render, to: :class
13
+ end
14
+
15
+ class_methods do
16
+ def with_renderer(renderer)
17
+ previous_renderer = self.renderer
18
+ self.renderer = renderer
19
+ yield
20
+ ensure
21
+ self.renderer = previous_renderer
22
+ end
23
+
24
+ def render(*args, &block)
25
+ renderer.render_to_string(*args, &block)
26
+ end
27
+ end
28
+ end
29
+ end
data/lib/action_text.rb CHANGED
@@ -16,6 +16,7 @@ module ActionText
16
16
  autoload :Fragment
17
17
  autoload :HtmlConversion
18
18
  autoload :PlainTextConversion
19
+ autoload :Rendering
19
20
  autoload :Serialization
20
21
  autoload :TrixAttachment
21
22
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/actiontext",
3
- "version": "6.0.4-7",
3
+ "version": "6.0.5-1",
4
4
  "description": "Edit and display rich text in Rails applications",
5
5
  "main": "app/javascript/actiontext/index.js",
6
6
  "files": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actiontext
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.4.7
4
+ version: 6.0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javan Makhmali
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-03-08 00:00:00.000000000 Z
13
+ date: 2022-07-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -18,56 +18,56 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 6.0.4.7
21
+ version: 6.0.5.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 6.0.4.7
28
+ version: 6.0.5.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: activerecord
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 6.0.4.7
35
+ version: 6.0.5.1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 6.0.4.7
42
+ version: 6.0.5.1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: activestorage
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 6.0.4.7
49
+ version: 6.0.5.1
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 6.0.4.7
56
+ version: 6.0.5.1
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: actionpack
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 6.0.4.7
63
+ version: 6.0.5.1
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 6.0.4.7
70
+ version: 6.0.5.1
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: nokogiri
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,7 @@ files:
122
122
  - lib/action_text/gem_version.rb
123
123
  - lib/action_text/html_conversion.rb
124
124
  - lib/action_text/plain_text_conversion.rb
125
+ - lib/action_text/rendering.rb
125
126
  - lib/action_text/serialization.rb
126
127
  - lib/action_text/trix_attachment.rb
127
128
  - lib/action_text/version.rb
@@ -135,10 +136,11 @@ licenses:
135
136
  - MIT
136
137
  metadata:
137
138
  bug_tracker_uri: https://github.com/rails/rails/issues
138
- changelog_uri: https://github.com/rails/rails/blob/v6.0.4.7/actiontext/CHANGELOG.md
139
- documentation_uri: https://api.rubyonrails.org/v6.0.4.7/
139
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.5.1/actiontext/CHANGELOG.md
140
+ documentation_uri: https://api.rubyonrails.org/v6.0.5.1/
140
141
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
141
- source_code_uri: https://github.com/rails/rails/tree/v6.0.4.7/actiontext
142
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.5.1/actiontext
143
+ rubygems_mfa_required: 'true'
142
144
  post_install_message:
143
145
  rdoc_options: []
144
146
  require_paths:
@@ -154,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
156
  - !ruby/object:Gem::Version
155
157
  version: '0'
156
158
  requirements: []
157
- rubygems_version: 3.1.6
159
+ rubygems_version: 3.3.3
158
160
  signing_key:
159
161
  specification_version: 4
160
162
  summary: Rich text framework.