insert_after 0.2.0 → 0.3.0
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 +5 -1
- data/lib/insert_after/version.rb +1 -1
- data/lib/insert_after.rb +2 -2
- 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: 3134f9519e4d025e12992e3d45aa3ecaf93d01e5e61043b39e3e8dd398a4e733
|
4
|
+
data.tar.gz: 91eebce8f84cd3aec1135d5b91a44d3e83855517516a1ffe1729705a7f9e6eb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbf47ab40beee36593a5aaa949a2472f3496e2ad17cb121e30aa7d7e51e9095120afa9c8c31be6c6640ed0ef3f6cea2fb64c1008f789f93edc3d55d0d1a0b269
|
7
|
+
data.tar.gz: b023d3e0a6b06ca66d20f849ba344700a823fe06ca036f5a2fc188d57114f00f66c165a00824c8078733553c3cf54121ddbcc4880c7fdfd66ce6236c6ebe686c
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.3.0
|
4
|
+
|
5
|
+
* Handles replacement strings containing escapes, like \n, \r and \t.
|
6
|
+
|
3
7
|
|
4
8
|
## 0.2.0
|
5
9
|
|
6
|
-
* Added ability to insert just one or multiple instances of the new line
|
10
|
+
* Added ability to insert just one or multiple instances of the new line.
|
7
11
|
|
8
12
|
|
9
13
|
## 0.1.0
|
data/lib/insert_after/version.rb
CHANGED
data/lib/insert_after.rb
CHANGED
@@ -80,9 +80,9 @@ module InsertAfter
|
|
80
80
|
InsertAfter.help 'No file name was provided' if argv.length == 2
|
81
81
|
InsertAfter.help 'Too many arguments' if argv.length > 3
|
82
82
|
regex = argv[0].downcase
|
83
|
-
new_line = argv[1]
|
83
|
+
new_line = argv[1].gsub('\n', "\n").gsub('\r', "\r").gsub('\t', "\t")
|
84
84
|
filename = argv[2]
|
85
|
-
InsertAfter.insert_after(regex, new_line, filename, all)
|
85
|
+
InsertAfter.insert_after(regex, new_line, filename, all: all)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|