haml_lint 0.23.0 → 0.23.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/haml_lint/linter/repeated_id.rb +6 -4
- 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: e58b8dc5ec0023cca7778fb8b23f4427d652dc34
|
4
|
+
data.tar.gz: 7a8856c5bb83a40e5e3b0533d23d4c7fcbe47405
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f73d54e14c88415a11459229b6b3e5400e6fd7ffe166c24c74baabfbad4219016117bc675b98cb351a46b46d996f6976892c867f0352c25b80e332f6dad9240
|
7
|
+
data.tar.gz: ad18b07001c9a25283777c3f6048d991cbe9604b7dc034e1ad57e323c3c9f1a56828e6a279a9b810374fed4440b301b6e7c7eb249a794c40a99b2ff41b36d417
|
@@ -5,6 +5,10 @@ module HamlLint
|
|
5
5
|
|
6
6
|
MESSAGE_FORMAT = %{Do not repeat id "#%s" on the page}.freeze
|
7
7
|
|
8
|
+
def visit_root(_node)
|
9
|
+
@id_map = Hash.new { |hash, key| hash[key] = [] }
|
10
|
+
end
|
11
|
+
|
8
12
|
def visit_tag(node)
|
9
13
|
id = node.tag_id
|
10
14
|
return unless id && !id.empty?
|
@@ -19,6 +23,8 @@ module HamlLint
|
|
19
23
|
|
20
24
|
private
|
21
25
|
|
26
|
+
attr_reader :id_map
|
27
|
+
|
22
28
|
def add_lint(node, id)
|
23
29
|
record_lint(node, MESSAGE_FORMAT % id)
|
24
30
|
end
|
@@ -26,9 +32,5 @@ module HamlLint
|
|
26
32
|
def add_lints_for_first_duplications(nodes)
|
27
33
|
nodes.each { |node| add_lint(node, node.tag_id) }
|
28
34
|
end
|
29
|
-
|
30
|
-
def id_map
|
31
|
-
@id_map ||= Hash.new { |hash, key| hash[key] = [] }
|
32
|
-
end
|
33
35
|
end
|
34
36
|
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.23.
|
4
|
+
version: 0.23.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: 2017-03-
|
12
|
+
date: 2017-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml
|