strip_comments 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/strip_comments/version.rb +1 -1
- data/lib/strip_comments.rb +2 -4
- 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: 920c33ca0c4a842363383bed65166eab6cf46adda7b1ab1a711c3aa6ddb3c4e6
|
4
|
+
data.tar.gz: 72bfd7bcb770d381ef6b443f627b6685f3d265f5e06a900a17fd26fc4e022194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ff254735ef99f9320c76f8e4f4410b2be2b1a855821e6ac5c84acd2e5d41c3b3c61de806130dd39f5ae72a2fc68922e05b7fc5c8d8ac7199d262590e8f801a1
|
7
|
+
data.tar.gz: 3fb1ec51ea8917396b06724437f477a68042b5b25e7d7dc478d5d5d4939bd6ae603fb743c6e52e7060bd7cc70e85f5289f5ec0bb9f088f2c2b330d68a031c16f
|
data/lib/strip_comments.rb
CHANGED
@@ -25,17 +25,15 @@ module StripComments
|
|
25
25
|
def self.strip_yaml(str)
|
26
26
|
stripped_strings_to_not_be_uncommented = {}
|
27
27
|
|
28
|
-
str.gsub!(/
|
28
|
+
str.gsub!(/"([^\n"]+)"/) do |m|
|
29
29
|
strip_key = "__STRIPPED_KEY_#{stripped_strings_to_not_be_uncommented.size}__"
|
30
30
|
stripped_strings_to_not_be_uncommented[strip_key] = m
|
31
|
-
puts "replacing '#{m}' with '#{strip_key}'"
|
32
31
|
strip_key
|
33
32
|
end
|
34
33
|
|
35
|
-
str.gsub!(/
|
34
|
+
str.gsub!(/'([^\n']+)'/) do |m|
|
36
35
|
strip_key = "__STRIPPED_KEY_#{stripped_strings_to_not_be_uncommented.size}__"
|
37
36
|
stripped_strings_to_not_be_uncommented[strip_key] = m
|
38
|
-
puts "replacing '#{m}' with '#{strip_key}'"
|
39
37
|
strip_key
|
40
38
|
end
|
41
39
|
|