better_html 1.0.7 → 1.0.8

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
  SHA1:
3
- metadata.gz: dc67cce938ef29fb5f95f18d17e4c5be3f94013a
4
- data.tar.gz: 01b068c022c1ecb3057cdced0f4a4841e50e341e
3
+ metadata.gz: 247eb33c5dd68488e53da6088442dd4d6904f1e1
4
+ data.tar.gz: 0b452286e583718d4641f081b0d9642bca8a4dfa
5
5
  SHA512:
6
- metadata.gz: 222276cb0ffab3e5cd1dbaf9d05bf342f2e43ce2f39fd603bbbe7af93a7786780466eeb4c1f0568432a99399cc739b4a66e9d1b8a2603025f1cfac2cc2ac4789
7
- data.tar.gz: ab87770d24442d8b175efdf07d1d2856053fcd1107a3ee2104037212c5b2833d6855d7ea86d2f9d14797894d4fafed0b12cd8da85f3d3dc7c683f3d7fced52d3
6
+ metadata.gz: 5846ff495668756c493233172086c6fad5101425024356b9fe88a1cd601f0571df844b855b080f97c8b157b20ce01005262988759f066fa590cc54ce89d83ad9
7
+ data.tar.gz: 6b8d254ab7fea38d8621b7b59a7b7d36b118cc36836a7d5ec80c1fb13cef1103c882d1b8aac34cc293b56409299b0176403e6470ba7b16d2b19b3d96fc62ab20
@@ -17,7 +17,12 @@ module BetterHtml
17
17
  next if indicator == '#'
18
18
  source = code_node.loc.source
19
19
 
20
- next unless (ruby_node = RubyNode.parse(source))
20
+ ruby_node = begin
21
+ RubyNode.parse(source)
22
+ rescue Parser::SyntaxError
23
+ nil
24
+ end
25
+ next unless ruby_node
21
26
  ruby_node.descendants(:send, :csend).each do |send_node|
22
27
  next unless send_node.method_name?(:javascript_tag)
23
28
 
@@ -28,7 +28,12 @@ module BetterHtml
28
28
  next if indicator == '#'
29
29
  source = code_node.loc.source
30
30
 
31
- next unless (ruby_node = RubyNode.parse(source))
31
+ ruby_node = begin
32
+ RubyNode.parse(source)
33
+ rescue Parser::SyntaxError
34
+ nil
35
+ end
36
+ next unless ruby_node
32
37
  validate_script_interpolation(erb_node, ruby_node)
33
38
  end
34
39
  end
@@ -44,7 +44,12 @@ module BetterHtml
44
44
  source = code_node.loc.source
45
45
 
46
46
  if indicator == '='
47
- if (ruby_node = RubyNode.parse(source))
47
+ ruby_node = begin
48
+ RubyNode.parse(source)
49
+ rescue Parser::SyntaxError
50
+ nil
51
+ end
52
+ if ruby_node
48
53
  no_unsafe_calls(code_node, ruby_node)
49
54
  unless ruby_node.static_return_value?
50
55
  handle_missing_safe_wrapper(code_node, ruby_node, attribute.name)
@@ -65,7 +70,12 @@ module BetterHtml
65
70
  next if indicator == '#'
66
71
  source = code_node.loc.source
67
72
 
68
- next unless (ruby_node = RubyNode.parse(source))
73
+ ruby_node = begin
74
+ RubyNode.parse(source)
75
+ rescue Parser::SyntaxError
76
+ nil
77
+ end
78
+ next unless ruby_node
69
79
  no_unsafe_calls(code_node, ruby_node)
70
80
  validate_ruby_helper(code_node, ruby_node)
71
81
  end
@@ -1,3 +1,3 @@
1
1
  module BetterHtml
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
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.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francois Chagnon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-02 00:00:00.000000000 Z
11
+ date: 2018-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast