strip_comments 0.2.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24843c0b9b7dd3bdf82bd0e951cb3ce0c981f294d7a6324577e84bccffb7362e
4
- data.tar.gz: 2d6e82506144c68b5ad333c21cd41dad14df6f6eb988e77f8e280df538dba88b
3
+ metadata.gz: 46ea98f5caa2081ffeb5b62bfd612e5f94023819a3a5a0fa6662f6b3f0d15310
4
+ data.tar.gz: da02f50a97533622e76d7b529fec24807104d2901496674db91df0a03b075364
5
5
  SHA512:
6
- metadata.gz: 0d675f04fef958452d383dbde97048cd46e074b7678508d24bf060e2f88a6d73d3fa3b39a33959b0bdd05f0cd536d46d8ade823162fac3750600e88e652aa181
7
- data.tar.gz: '099ca0984bebe01c6eef730d5877272642acbcdb0c6a4e5337b7c18c1d092dfae8fc2f488fa5e829270fe9f492364d62e82d3db672bcb2bff330b8a8189ebf14'
6
+ metadata.gz: 0167b2d78768aee2e61eb9abd622d356067ab8de5d0db5a3ba0633ab6eefc48a83fb95c447509a6ac229dc34cb2d238f1c5d3777f6896f618bf54663c77580e0
7
+ data.tar.gz: f24b7801231367769e3b3a7514a33fe7028efa151cbbb4dbf60acc63fb6ccfb8d57985672f2543d1f64208ec3e3996915027327337e2d1a9003f1093387388c2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2022-10-20
3
+ ## [0.4.0] - 2026-05-18
4
4
 
5
- - Initial release
5
+ - Support `.po`, `.pot` comments
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:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StripComments
4
- VERSION = "0.2.0"
4
+ VERSION = "0.4.1"
5
5
  end
@@ -17,6 +17,8 @@ module StripComments
17
17
  strip_properties(str)
18
18
  when "html"
19
19
  strip_html(str)
20
+ when "po", "pot"
21
+ strip_properties(str)
20
22
  else
21
23
  raise Error.new("unknown language '#{language}'")
22
24
  end
@@ -47,7 +49,7 @@ module StripComments
47
49
  end
48
50
 
49
51
  def self.strip_properties(str)
50
- str.gsub(/(\n)[\t ]*#[^\n]+/, '\\1')
52
+ str.gsub(/(\n)[\t ]*#[^\n]+/, '\\1').gsub(/^#[^\n]+/, '\\1')
51
53
  end
52
54
 
53
55
  def self.strip_glsl(str)
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.2.0
4
+ version: 0.4.1
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-19 00:00:00.000000000 Z
11
+ date: 2026-05-18 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