slim-embedded-minify 0.2.2 → 0.2.3

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: c8790fa5ff94a6dea3f1c2ae7918b4c4d4fdbba1f0701f669e3504436235d21a
4
- data.tar.gz: ff1238ac7c872c6c7eb01e9a5a337c7fe7755faab2324278fb847ad3cdc3e6a4
3
+ metadata.gz: ae5665cb9baa381cc6a7f9abef491e6bc9805c1d7a77af47428a16dd4cd1ce07
4
+ data.tar.gz: 7a38354fdb3dacb1ea4c034cce7129f3aa7c66e22d0c7326e685c9cc84d06f9a
5
5
  SHA512:
6
- metadata.gz: 6043fc78dce665411c16075931132e9d2674ce67b527ccb3d56bdb6f8d0d74bba8e8cfed4319ccba49aaa9cfd4d7bc5556dfab182422b8cfd225fd869bdc3118
7
- data.tar.gz: 6ca3fe0cebb59a549af68dfe0172d640ddac6006f123248e2bc7866f1adf2f3456635267fe1166f2fff2cb6e45511b57bb60ea15d37fe95282751008cb72643e
6
+ metadata.gz: a46495c0cf4e673ecf61693e04246d7bea875b2ff6dadddea29b68d94ed4e34a8417cc506243fdf81d9ce718e73b09fd12403edef342e2f4598c72306db93116
7
+ data.tar.gz: ea8111ae9eb161bfc10f5b5594cd1c207cc00b50a7c06f823b4b9ca6aabda4dd01ee6d3b68cad86d47fe11b02151a33b12942f55897a9ccacc29eb84d893aa80
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.2.3 - 2023-07-27
4
+
5
+ - Fix to not removing line when a block comment if it starts at the end of a line.
6
+
7
+ ## 0.2.2 - 2023-07-20
8
+
3
9
  - Fix an invalid remove comment.
4
10
 
5
11
  ## 0.2.1 - 2023-07-18
@@ -21,15 +21,16 @@ module Slim
21
21
  stripped_quotes = stripped_quotes(line)
22
22
  if stripped_quotes.match?(%r{/\*})
23
23
  multiline_comment = true
24
- next
24
+ line.last.gsub!(/\/\*.*$/, '')
25
25
  elsif multiline_comment
26
- multiline_comment = false if stripped_quotes.match?(%r{\*/})
27
- next
26
+ next unless stripped_quotes.match?(%r{\*/})
27
+
28
+ multiline_comment = false
29
+ line.last.gsub!(/.*\*\//, '')
28
30
  end
29
- line
30
- else
31
- line
31
+ next if empty_line?(line)
32
32
  end
33
+ line
33
34
  end.compact
34
35
  end
35
36
 
@@ -46,6 +47,10 @@ module Slim
46
47
  def stripped_quotes(line)
47
48
  line.last.gsub(/(['"]).*?\1/, '')
48
49
  end
50
+
51
+ def empty_line?(line)
52
+ line.last.gsub(/[\n\s]/, '').empty?
53
+ end
49
54
  end
50
55
  end
51
56
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SlimEmbeddedMinify
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slim-embedded-minify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-20 00:00:00.000000000 Z
11
+ date: 2023-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slim