haml_lint 0.14.0 → 0.14.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/linter/unnecessary_string_output.rb +4 -3
- data/lib/haml_lint/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 350f098b45d24d55363ac279caf35694dfbdcfda
|
4
|
+
data.tar.gz: 76c0227e9aeb398ac1397003f9c1bc943c99cf02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c9fd9c3c414411cd8a40d0334ca2f716259874a765f3c3ebf0ba3b8513c1993fb3147706986a1b6f234713a1e22be660e6d16081514cea582e68a4aade5dda9
|
7
|
+
data.tar.gz: 32549d3f2c75d75451637be9dcd46b27ceb76db5e0255365ff9cc0a2ffc89e6dccfd2f424501fc6fb07bcb1277bc14fb35fecc5011c3d907ffde3e3bee7cabf9
|
@@ -32,15 +32,16 @@ module HamlLint
|
|
32
32
|
def outputs_string_literal?(script_node)
|
33
33
|
tree = parse_ruby(script_node.script)
|
34
34
|
[:str, :dstr].include?(tree.type) &&
|
35
|
-
starts_with_reserved_character?(tree.children.first)
|
35
|
+
!starts_with_reserved_character?(tree.children.first)
|
36
36
|
rescue ::Parser::SyntaxError # rubocop:disable Lint/HandleExceptions
|
37
37
|
# Gracefully ignore syntax errors, as that's managed by a different linter
|
38
38
|
end
|
39
39
|
|
40
40
|
# Returns whether a string starts with a character that would otherwise be
|
41
41
|
# given special treatment, thus making enclosing it in a string necessary.
|
42
|
-
def starts_with_reserved_character?(
|
43
|
-
string
|
42
|
+
def starts_with_reserved_character?(stringish)
|
43
|
+
string = stringish.respond_to?(:children) ? stringish.children.first : stringish
|
44
|
+
string =~ %r{\A\s*[/#-=%~]}
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
data/lib/haml_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brigade Engineering
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-06-
|
12
|
+
date: 2015-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml
|