haml_lint 0.40.0 → 0.40.1
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 +4 -4
- data/lib/haml_lint/tree/script_node.rb +7 -1
- data/lib/haml_lint/tree/silent_script_node.rb +16 -1
- data/lib/haml_lint/version.rb +1 -1
- 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: 1655e5263c92bb0a391c1e56aea103792409f17a72deafb16818844fd5f6d7c8
|
4
|
+
data.tar.gz: 65d4539637d4caf656940041040ad33227a0d89eb923207fb5fedafcf357f0bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f08f1952a5a9ab8adc6b5c6730ec0a441ccdc10ac1a59922f77bc54c74fc95db3b49e732400aef960c4bae7581950fb21874e78d3b516e22d5cc61dc914da72
|
7
|
+
data.tar.gz: 91af5862db990bc021c1088b0de462f5f3a84ad7509cc62498ee4ac70a11f05b423d7778deead53da353253f38d76d5c84cde5417d1da3ac43bccc23f16a4753
|
@@ -9,7 +9,13 @@ module HamlLint::Tree
|
|
9
9
|
#
|
10
10
|
# @return [ParsedRuby] syntax tree in the form returned by Parser gem
|
11
11
|
def parsed_script
|
12
|
-
|
12
|
+
statement =
|
13
|
+
if children.empty?
|
14
|
+
script
|
15
|
+
else
|
16
|
+
"#{script}#{@value[:keyword] == 'case' ? ';when 0;end' : ';end'}"
|
17
|
+
end
|
18
|
+
HamlLint::ParsedRuby.new(HamlLint::RubyParser.new.parse(statement))
|
13
19
|
end
|
14
20
|
|
15
21
|
# Returns the source for the script following the `-` marker.
|
@@ -8,7 +8,22 @@ module HamlLint::Tree
|
|
8
8
|
#
|
9
9
|
# @return [ParsedRuby] syntax tree in the form returned by Parser gem
|
10
10
|
def parsed_script
|
11
|
-
|
11
|
+
statement =
|
12
|
+
case keyword = @value[:keyword]
|
13
|
+
when 'else', 'elsif'
|
14
|
+
'if 0;' + script + ';end'
|
15
|
+
when 'when'
|
16
|
+
'case;' + script + ';end'
|
17
|
+
when 'rescue', 'ensure'
|
18
|
+
'begin;' + script + ';end'
|
19
|
+
else
|
20
|
+
if children.empty?
|
21
|
+
script
|
22
|
+
else
|
23
|
+
"#{script}#{keyword == 'case' ? ';when 0;end' : ';end'}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
HamlLint::ParsedRuby.new(HamlLint::RubyParser.new.parse(statement))
|
12
27
|
end
|
13
28
|
|
14
29
|
# Returns the source for the script following the `-` marker.
|
data/lib/haml_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.40.
|
4
|
+
version: 0.40.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|