strip_comments 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/strip_comments/version.rb +1 -1
- data/lib/strip_comments.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: 24843c0b9b7dd3bdf82bd0e951cb3ce0c981f294d7a6324577e84bccffb7362e
|
4
|
+
data.tar.gz: 2d6e82506144c68b5ad333c21cd41dad14df6f6eb988e77f8e280df538dba88b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d675f04fef958452d383dbde97048cd46e074b7678508d24bf060e2f88a6d73d3fa3b39a33959b0bdd05f0cd536d46d8ade823162fac3750600e88e652aa181
|
7
|
+
data.tar.gz: '099ca0984bebe01c6eef730d5877272642acbcdb0c6a4e5337b7c18c1d092dfae8fc2f488fa5e829270fe9f492364d62e82d3db672bcb2bff330b8a8189ebf14'
|
data/README.md
CHANGED
@@ -29,7 +29,15 @@ stripped = StripComments::strip_yaml(input)
|
|
29
29
|
You can use this to, for example, rewrite all source files in a folder:
|
30
30
|
|
31
31
|
```rb
|
32
|
-
|
32
|
+
require "strip_comments"
|
33
|
+
|
34
|
+
Dir.glob(File.join(File.dirname(__FILE__), "..", "**", "*.{css,html,yml,properties,glsl}")).each do |filename|
|
35
|
+
extension = filename.split(".").last
|
36
|
+
input = File.open(filename).read
|
37
|
+
output = StripComments::strip(extension, input)
|
38
|
+
|
39
|
+
File.write(filename, output)
|
40
|
+
end
|
33
41
|
```
|
34
42
|
|
35
43
|
## Development
|
data/lib/strip_comments.rb
CHANGED