html_terminator 6.0.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html_terminator/version.rb +1 -1
- data/lib/html_terminator.rb +17 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98d8ed2ca96a3b39e0ad1cc1c9b04741fca98dd5dc49b47aae6bc35dbcaaf9e2
|
4
|
+
data.tar.gz: 508007abd9d186b41757bcdd71f74fdaedbc39f67a00f73dabbdf79313540fa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18714e4936b0341dae0154715c1996c49d5a5a09c02a6ae54a2ed1e985f6df50a86871683e9fb0f73c588f529e44ad73e8bf325bec4db83423d024a3cd431f23
|
7
|
+
data.tar.gz: d210292b465e5528a2c5f7d529e92defdb6ae4d1adae88ba53d043be3a29e246e9c0fdbebad022c4266225c27506dd15247f126bde51b295b7d5edc8bb6a79f5
|
data/lib/html_terminator.rb
CHANGED
@@ -29,37 +29,30 @@ module HtmlTerminator
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def terminate_html(*args)
|
32
|
-
#
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
self.html_terminator_fields = {}
|
38
|
-
end
|
39
|
-
|
40
|
-
options = args.extract_options!
|
41
|
-
options = SANITIZE_OPTIONS.clone.merge(options)
|
32
|
+
# object key/value of field => options
|
33
|
+
unless method_defined?(:html_terminator_fields)
|
34
|
+
class_attribute :html_terminator_fields
|
35
|
+
self.html_terminator_fields = {}
|
36
|
+
end
|
42
37
|
|
43
|
-
|
38
|
+
options = args.extract_options!
|
39
|
+
options = SANITIZE_OPTIONS.clone.merge(options)
|
44
40
|
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
args.each do |field|
|
42
|
+
self.html_terminator_fields[field] = options.deep_dup
|
43
|
+
end
|
48
44
|
|
49
|
-
|
50
|
-
|
45
|
+
unless self.html_terminator_fields.empty?
|
46
|
+
before_validation :terminate_html
|
51
47
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
48
|
+
# sanitize reads
|
49
|
+
args.each do |attr|
|
50
|
+
define_method(attr) do |*rargs|
|
51
|
+
# sanitize it
|
52
|
+
HtmlTerminator.sanitize super(*rargs), options
|
58
53
|
end
|
59
54
|
end
|
60
55
|
end
|
61
|
-
rescue ActiveRecord::ConnectionNotEstablished
|
62
|
-
# Treat as if the table doesn't exist
|
63
56
|
end
|
64
57
|
end
|
65
58
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html_terminator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steel Fu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|