strip_comments 0.1.5 → 0.3.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 +11 -1
- data/lib/strip_comments/version.rb +1 -1
- data/lib/strip_comments.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 467eeea86bc98782dcb2e27b5da9433d5e2a9f828179ddee79a1109d213b4240
|
4
|
+
data.tar.gz: d0a33c9f55e6dda57f77e6d769cec5641880acd8130352664d08b1d6f193a0b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb1e184ae7e6136f6cf2830a3f7b7a207b0bdc957e5d233be1fef64a103d50c1fd9994c8f88666631f7a806a11b10748edf0c722ea9a2da40e482c30d4f64a1c
|
7
|
+
data.tar.gz: 661358114b7747313b2d1ddab3f8b73eda96a4d656985467acb39029691ff95a64d2d914d21dd7fbb3a21faabfdf0a60ddcfe6c90dea77fe8dbf2296732989e7
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Uses regular expressions to strip things that look like comments from strings.
|
4
4
|
|
5
|
+
**Supported extensions:** css, glsl, html, properties, yml
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
@@ -29,7 +31,15 @@ stripped = StripComments::strip_yaml(input)
|
|
29
31
|
You can use this to, for example, rewrite all source files in a folder:
|
30
32
|
|
31
33
|
```rb
|
32
|
-
|
34
|
+
require "strip_comments"
|
35
|
+
|
36
|
+
Dir.glob(File.join(File.dirname(__FILE__), "..", "**", "*.{css,html,yml,properties,glsl}")).each do |filename|
|
37
|
+
extension = filename.split(".").last
|
38
|
+
input = File.open(filename).read
|
39
|
+
output = StripComments::strip(extension, input)
|
40
|
+
|
41
|
+
File.write(filename, output)
|
42
|
+
end
|
33
43
|
```
|
34
44
|
|
35
45
|
## Development
|
data/lib/strip_comments.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strip_comments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jevon Wright
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Uses regular expressions to strip things that look like comments from
|
14
14
|
strings
|