yalphabetize 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yalphabetize/sequence_indenter.rb +5 -5
- data/lib/yalphabetize/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86d76847f2e23ff6fe3cd5a5e58304236f308cd0541a19bd3ab96f7db10bb601
|
4
|
+
data.tar.gz: 8c00fcc4c33db1396aeae8384d1fc62d12bb27dd5db2ef0e7115c6a1f4ccce09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e83b56bf3dafb17675575d038cb07fd69c66d7732846eb5ade8379a84d6ac2994471784b2ba6bbdfa306bcbecddcc5d7f175f31c95fd7eaf1b5b509a4d0ba91
|
7
|
+
data.tar.gz: 37c7d42a08c8a1ac39bfc7bdfb4ce65ec9a658884bbc433df5504f636a9797ad1695bffca1847d7a651331b9929f72bf3a2253f258be03383319e67857af0039
|
@@ -27,10 +27,8 @@ module Yalphabetize
|
|
27
27
|
def find_lines_to_indent
|
28
28
|
@nodes_to_indent = []
|
29
29
|
|
30
|
-
stream_node.each do |
|
31
|
-
|
32
|
-
|
33
|
-
block_sequence_nodes(node)&.each do |sequence_node|
|
30
|
+
stream_node.select(&:mapping?).each do |mapping_node|
|
31
|
+
block_sequence_nodes(mapping_node)&.each do |sequence_node|
|
34
32
|
@nodes_to_indent.push(*sequence_node.children)
|
35
33
|
end
|
36
34
|
end
|
@@ -46,7 +44,9 @@ module Yalphabetize
|
|
46
44
|
|
47
45
|
def indent!
|
48
46
|
@nodes_to_indent.each do |node|
|
49
|
-
|
47
|
+
node_end_line = node.start_line == node.end_line ? node.end_line : node.end_line - 1
|
48
|
+
|
49
|
+
file_lines[node.start_line..node_end_line].each do |line|
|
50
50
|
line.gsub!(line, " #{line}")
|
51
51
|
end
|
52
52
|
end
|
data/lib/yalphabetize/version.rb
CHANGED