better_html 1.0.11 → 1.0.12
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 +5 -5
- data/lib/better_html/better_erb.rb +6 -5
- data/lib/better_html/version.rb +1 -1
- metadata +44 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e9a13c27533e3023181c42a6d1d67eec983dd1f1c3dc045eb95c9868a65cc5ac
|
4
|
+
data.tar.gz: 6c78a69777c0a02a7409767c5fd746a4c496f99bdfea1cad4bd39c68063ed9bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad1164a2dc8b92d1b18687b40b2190dae8137036067288f7b138323db8a02712235324353baf44c0f70d3526b0f35cbba78a82c1897211e60f8f8eca744026fc
|
7
|
+
data.tar.gz: e229b74bb327bb4e6820c7c90fea5974c4302fe234e2909e2268d24dff8a79a8a236332c46ec4dc0ebe2a910a84de7f174d6fec7b0fa9cb3e8d7c90fa5b0142f
|
@@ -27,27 +27,28 @@ class BetterHtml::BetterErb
|
|
27
27
|
|
28
28
|
module ConditionalImplementation
|
29
29
|
|
30
|
-
def call(template)
|
31
|
-
generate(template)
|
30
|
+
def call(template, source = nil)
|
31
|
+
generate(template, source)
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
35
35
|
|
36
|
-
def generate(template)
|
36
|
+
def generate(template, source)
|
37
37
|
# First, convert to BINARY, so in case the encoding is
|
38
38
|
# wrong, we can still find an encoding tag
|
39
39
|
# (<%# encoding %>) inside the String using a regular
|
40
40
|
# expression
|
41
41
|
|
42
|
+
source ||= template.source
|
42
43
|
filename = template.identifier.split("/").last
|
43
44
|
exts = filename.split(".")
|
44
45
|
exts = exts[1..exts.length].join(".")
|
45
|
-
template_source =
|
46
|
+
template_source = source.dup.force_encoding(Encoding::ASCII_8BIT)
|
46
47
|
|
47
48
|
erb = template_source.gsub(ActionView::Template::Handlers::ERB::ENCODING_TAG, '')
|
48
49
|
encoding = $2
|
49
50
|
|
50
|
-
erb.force_encoding valid_encoding(
|
51
|
+
erb.force_encoding valid_encoding(source.dup, encoding)
|
51
52
|
|
52
53
|
# Always make sure we return a String in the default_internal
|
53
54
|
erb.encode!
|
data/lib/better_html/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: better_html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francois Chagnon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|
@@ -239,59 +239,59 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
239
|
version: '0'
|
240
240
|
requirements: []
|
241
241
|
rubyforge_project:
|
242
|
-
rubygems_version: 2.6
|
242
|
+
rubygems_version: 2.7.6
|
243
243
|
signing_key:
|
244
244
|
specification_version: 4
|
245
245
|
summary: Better HTML for Rails.
|
246
246
|
test_files:
|
247
|
-
- test/
|
248
|
-
- test/
|
249
|
-
- test/
|
250
|
-
- test/
|
251
|
-
- test/
|
252
|
-
- test/
|
253
|
-
- test/
|
247
|
+
- test/test_helper.rb
|
248
|
+
- test/better_html/helpers_test.rb
|
249
|
+
- test/better_html/better_erb/implementation_test.rb
|
250
|
+
- test/better_html/errors_test.rb
|
251
|
+
- test/better_html/parser_test.rb
|
252
|
+
- test/better_html/tokenizer/token_array_test.rb
|
253
|
+
- test/better_html/tokenizer/token_test.rb
|
254
|
+
- test/better_html/tokenizer/html_lodash_test.rb
|
255
|
+
- test/better_html/tokenizer/location_test.rb
|
256
|
+
- test/better_html/tokenizer/html_erb_test.rb
|
257
|
+
- test/better_html/test_helper/safe_erb/script_interpolation_test.rb
|
258
|
+
- test/better_html/test_helper/safe_erb/allowed_script_type_test.rb
|
259
|
+
- test/better_html/test_helper/safe_erb/no_javascript_tag_helper_test.rb
|
260
|
+
- test/better_html/test_helper/safe_erb/no_statements_test.rb
|
261
|
+
- test/better_html/test_helper/safe_erb/tag_interpolation_test.rb
|
262
|
+
- test/better_html/test_helper/ruby_node_test.rb
|
263
|
+
- test/better_html/test_helper/safe_lodash_tester_test.rb
|
264
|
+
- test/dummy/app/controllers/application_controller.rb
|
265
|
+
- test/dummy/app/helpers/application_helper.rb
|
266
|
+
- test/dummy/app/views/layouts/application.html.erb
|
267
|
+
- test/dummy/app/assets/stylesheets/application.css
|
268
|
+
- test/dummy/app/assets/javascripts/application.js
|
254
269
|
- test/dummy/bin/bundle
|
270
|
+
- test/dummy/bin/rake
|
255
271
|
- test/dummy/bin/rails
|
256
|
-
- test/dummy/
|
257
|
-
- test/dummy/config/database.yml
|
258
|
-
- test/dummy/config/secrets.yml
|
259
|
-
- test/dummy/config/environments/development.rb
|
260
|
-
- test/dummy/config/environments/production.rb
|
261
|
-
- test/dummy/config/environments/test.rb
|
262
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
272
|
+
- test/dummy/bin/setup
|
263
273
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
264
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
265
274
|
- test/dummy/config/initializers/wrap_parameters.rb
|
266
|
-
- test/dummy/config/initializers/
|
267
|
-
- test/dummy/config/initializers/
|
275
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
276
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
268
277
|
- test/dummy/config/initializers/session_store.rb
|
278
|
+
- test/dummy/config/initializers/assets.rb
|
269
279
|
- test/dummy/config/initializers/mime_types.rb
|
280
|
+
- test/dummy/config/initializers/inflections.rb
|
281
|
+
- test/dummy/config/secrets.yml
|
282
|
+
- test/dummy/config/application.rb
|
283
|
+
- test/dummy/config/database.yml
|
284
|
+
- test/dummy/config/environment.rb
|
270
285
|
- test/dummy/config/boot.rb
|
271
286
|
- test/dummy/config/locales/en.yml
|
272
|
-
- test/dummy/config/
|
273
|
-
- test/dummy/config/
|
287
|
+
- test/dummy/config/environments/development.rb
|
288
|
+
- test/dummy/config/environments/test.rb
|
289
|
+
- test/dummy/config/environments/production.rb
|
274
290
|
- test/dummy/config/routes.rb
|
275
|
-
- test/dummy/
|
276
|
-
- test/dummy/
|
277
|
-
- test/dummy/
|
278
|
-
- test/dummy/
|
279
|
-
- test/dummy/app/assets/javascripts/application.js
|
291
|
+
- test/dummy/public/500.html
|
292
|
+
- test/dummy/public/favicon.ico
|
293
|
+
- test/dummy/public/422.html
|
294
|
+
- test/dummy/public/404.html
|
280
295
|
- test/dummy/Rakefile
|
281
|
-
- test/
|
282
|
-
- test/
|
283
|
-
- test/better_html/errors_test.rb
|
284
|
-
- test/better_html/parser_test.rb
|
285
|
-
- test/better_html/better_erb/implementation_test.rb
|
286
|
-
- test/better_html/test_helper/safe_erb/script_interpolation_test.rb
|
287
|
-
- test/better_html/test_helper/safe_erb/no_javascript_tag_helper_test.rb
|
288
|
-
- test/better_html/test_helper/safe_erb/tag_interpolation_test.rb
|
289
|
-
- test/better_html/test_helper/safe_erb/no_statements_test.rb
|
290
|
-
- test/better_html/test_helper/safe_erb/allowed_script_type_test.rb
|
291
|
-
- test/better_html/test_helper/ruby_node_test.rb
|
292
|
-
- test/better_html/test_helper/safe_lodash_tester_test.rb
|
293
|
-
- test/better_html/tokenizer/location_test.rb
|
294
|
-
- test/better_html/tokenizer/html_lodash_test.rb
|
295
|
-
- test/better_html/tokenizer/html_erb_test.rb
|
296
|
-
- test/better_html/tokenizer/token_array_test.rb
|
297
|
-
- test/better_html/tokenizer/token_test.rb
|
296
|
+
- test/dummy/config.ru
|
297
|
+
- test/dummy/README.rdoc
|