ruby2html 1.5.4 → 1.5.5

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: a7e4ace849a6799ec0dd9c793678a6eefcf62c1b0ccf8ed2de53a4d3c18c352a
4
- data.tar.gz: cad377858ea7819014d67638191d1b22567584796e7372212c7a2dcd90046196
3
+ metadata.gz: 25986366d74cfc6ab633d56affe1237d3fe796af18942954ea76a3db524d4371
4
+ data.tar.gz: 590ebdf14101a46c9421770c1de0427c8db0aaa36e21e6a77a4349eee99d3a18
5
5
  SHA512:
6
- metadata.gz: 34aef0821511553c2ef86498f9adf10d42668cd3a04cadbde09adfc79eb4410220932d3ff99dc22261119a6efd7e20914b791c5ecca546564e3cb4a6b870b594
7
- data.tar.gz: a1afad1a03be0bd3cadcd901fb34193007eb490ec619717d1550e4d63f72718a630e656021ad8dc39ba52e03759a839203b93b7d271f249b4a0476dfa9eae7d4
6
+ metadata.gz: 2ca7d36a57c334b40e4244f06de1e037ed16d7ae3c70dbd0e6754decf8ff16e1277351d1514993cda2095e8013ffeb7283b87954ec415b29977e6ea9cf2f78e0
7
+ data.tar.gz: fde8daef7e52baf0bf51a7772121f1459287f7d1400b9f5984c1c8a331841cab5c74de90778dec5e0600f8a10df0d88fe4e223b3cd3f15afbb0c2c4db424be00
@@ -70,7 +70,7 @@ module Ruby2html
70
70
  end
71
71
 
72
72
  def authenticity_token_tag
73
- @render.input(type: 'hidden', name: 'authenticity_token', value: @context.session[:_csrf_token])
73
+ @render.input(type: 'hidden', name: 'authenticity_token', value: @context.form_authenticity_token)
74
74
  end
75
75
 
76
76
  def utf8_enforcer_tag
@@ -11,18 +11,22 @@ module Ruby2html
11
11
 
12
12
  def call(template, source)
13
13
  <<-RUBY
14
- begin
15
- previous_renderer = Thread.current[:__ruby2html_renderer__]
16
- renderer = Ruby2html::Render.new(self) do
17
- #{source}
18
- end
19
- Thread.current[:__ruby2html_renderer__] = renderer
20
- renderer.__render_from_rails(#{template.identifier.inspect})
21
- ensure
22
- Thread.current[:__ruby2html_renderer__] = previous_renderer
23
- end
14
+ begin
15
+ previous_renderer = Thread.current[:__ruby2html_renderer__]
16
+ renderer = Ruby2html::Render.new(self) do
17
+ #{source}
18
+ end
19
+ Thread.current[:__ruby2html_renderer__] = renderer
20
+ renderer.__render_from_rails(#{template.identifier.inspect})
21
+ ensure
22
+ Thread.current[:__ruby2html_renderer__] = previous_renderer
23
+ end
24
24
  RUBY
25
25
  end
26
+
27
+ def self.handles_encoding?
28
+ true
29
+ end
26
30
  end
27
31
 
28
32
  class Railtie < Rails::Railtie
@@ -41,9 +41,8 @@ module Ruby2html
41
41
  def render(*args, **options, &block)
42
42
  set_instance_variables
43
43
 
44
- if !args.empty? || !options.empty? || block_given?
45
- return plain @context.render(*args, **options, &block)
46
- end
44
+ return plain @context.render(*args, **options, &block) if !args.empty? || !options.empty? || block_given?
45
+
47
46
  instance_exec(&@root)
48
47
  result = @output.string
49
48
 
@@ -67,8 +66,7 @@ module Ruby2html
67
66
  attributes = options
68
67
 
69
68
  tag_content = StringIO.new
70
- tag_content << '<'
71
- tag_content << name
69
+ tag_content << "<#{name}"
72
70
  tag_content << attributes_to_s(attributes)
73
71
 
74
72
  if VOID_ELEMENTS.include?(name)
@@ -87,9 +85,7 @@ module Ruby2html
87
85
  tag_content << escape_html(content)
88
86
  end
89
87
 
90
- tag_content << '</'
91
- tag_content << name
92
- tag_content << '>'
88
+ tag_content << "</#{name}>"
93
89
  end
94
90
 
95
91
  @current_output << tag_content.string
@@ -132,11 +128,7 @@ module Ruby2html
132
128
 
133
129
  result = StringIO.new
134
130
  attributes.compact.each do |k, v|
135
- result << ' '
136
- result << k.to_s
137
- result << '="'
138
- result << escape_html(v)
139
- result << '"'
131
+ result << " #{k}=\"#{escape_html(v)}\""
140
132
  end
141
133
  result.string
142
134
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ruby2html
4
- VERSION = '1.5.4'
4
+ VERSION = '1.5.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2html
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sebi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-12 00:00:00.000000000 Z
11
+ date: 2024-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlbeautifier