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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad4cf83138cb39fd6e8136580212148ae6762be6
4
- data.tar.gz: 02ac063f7fd5376e2a049f98180e07b27e4a1cf7
3
+ metadata.gz: e58b8dc5ec0023cca7778fb8b23f4427d652dc34
4
+ data.tar.gz: 7a8856c5bb83a40e5e3b0533d23d4c7fcbe47405
5
5
  SHA512:
6
- metadata.gz: da18d9343dfe0ac6a1dc67bc9e2a4036deed16062f01418b12b806a8988e63075c0fd3ba7b57ad6e63bdfdedfa9125032ea1da948ce2432daee26d0310229923
7
- data.tar.gz: 2bd7c7492d574d9ad0fc68a9fdad882af6ef78d34ad7a9d9673806792bd8eb9081d48c4b19f31283c4e2f2b9db9a5c28efafd6ba49d1a6e9396212081f7a3d47
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module HamlLint
5
- VERSION = '0.23.0'.freeze
5
+ VERSION = '0.23.1'.freeze
6
6
  end
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.0
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-09 00:00:00.000000000 Z
12
+ date: 2017-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml