insert_after 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: cc5fc1c4ee18a625fc45c1a704f7a33d5d0180e809f630efa0b329b2145f57cd
4
- data.tar.gz: 6b02196f89f4f81054cf0222f262027a50aafabbda7f0a29f7ada19b499675ea
3
+ metadata.gz: 3134f9519e4d025e12992e3d45aa3ecaf93d01e5e61043b39e3e8dd398a4e733
4
+ data.tar.gz: 91eebce8f84cd3aec1135d5b91a44d3e83855517516a1ffe1729705a7f9e6eb6
5
5
  SHA512:
6
- metadata.gz: cb5ecb5fa902acb4ad62ac326258ac7e5aa3604cc8ce82969507bdf2cb161b1f7136fa09af754856eba09ae8984b3c63693a269f02560cb79bfb23c49a7831a3
7
- data.tar.gz: 3b3010274b680e0fd468a74ac142f5a07f42733154f597638924287801aa06ff95999bb4f3054157bcbe9cb686cb26b237a3e89e0a8c55904c542465db787c93
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
@@ -1,3 +1,3 @@
1
1
  module InsertAfter
2
- VERSION = '0.2.0'.freeze unless defined? VERSION
2
+ VERSION = '0.3.0'.freeze unless defined? VERSION
3
3
  end
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insert_after
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn