node_mutation 1.15.0 → 1.15.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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/node_mutation/version.rb +1 -1
- data/lib/node_mutation.rb +9 -3
- data/sig/node_mutation.rbs +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: 382d91776358172b2310f5281edc413bf6066da9e333e150fa14a068219058bf
|
4
|
+
data.tar.gz: 5bdeef13cc69a5f4e6b9abef45ed95eeab57b13e95bed01a8fb0f25b02788140
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b35c57db840700ed2a53ea3f0b1713185da7c36b4759537709ce726cf1094f862dcdd9cc2e5a19cdb99b0ef34ebe1436414e17c35915f6694b3c7ee66bf4a163
|
7
|
+
data.tar.gz: 2ad6b1ec1f27bad428cc299ffb95f3fce4bd57338365a60707736ae9936aaf15f445d89d8cf339224f4994391907a9df6d3e7ee2dfb2cc394782c2b83261645f
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/node_mutation.rb
CHANGED
@@ -205,9 +205,15 @@ class NodeMutation
|
|
205
205
|
# end
|
206
206
|
# end
|
207
207
|
def wrap(node, prefix:, suffix:, newline: false)
|
208
|
-
|
209
|
-
|
210
|
-
|
208
|
+
if newline
|
209
|
+
indentation = NodeMutation.adapter.get_start_loc(node).column
|
210
|
+
@actions << InsertAction.new(node, prefix + "\n" + ' ' * indentation, at: 'beginning').process
|
211
|
+
@actions << InsertAction.new(node, "\n" + ' ' * indentation + suffix, at: 'end').process
|
212
|
+
@actions << IndentAction.new(node).process
|
213
|
+
else
|
214
|
+
@actions << InsertAction.new(node, prefix, at: 'beginning').process
|
215
|
+
@actions << InsertAction.new(node, suffix, at: 'end').process
|
216
|
+
end
|
211
217
|
end
|
212
218
|
|
213
219
|
# No operation.
|
data/sig/node_mutation.rbs
CHANGED