ssmd 0.7.4 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d09b748d209127855bbf790dc89eaa53891d978b3070773212203a6c1d460dc4
4
- data.tar.gz: 90495308c981fd7cd3b857c05461a478ed287878fe79832584b67625ed768351
3
+ metadata.gz: ecf3d2d52ae18bc5e1c7c996801388fa512866e3495ba546d6258124834c758d
4
+ data.tar.gz: 951665f3407e4af8b3bf7fd8d6a595fe5c0be4f157ddf7aabf8ce7a0f23d1b0f
5
5
  SHA512:
6
- metadata.gz: 80f139fc45586b23c2247275f7ffcca9c06d1664a123e25f7ff418ee15613cc0b59515d22b6de3aaca2b96eb61e9bb6921bec7a91b9ce5b001f19b49f18e16d1
7
- data.tar.gz: 236365024367acb03f85422e30c4b773e80c478ef5d8743b4f65b85abc434511bbaa440b6a656cf011b743a7146c6b7e535597e5884eb325c904465e85a57b66
6
+ metadata.gz: e95c06cdafd4d7f1db0b9ef48178113f16fc965230532e8881dbb156e8610595bd934dcc44688bb9cbf9c7681f24d2793e758563147efc9b90cf56b05628f647
7
+ data.tar.gz: 94066e29be12d5a3878de87a8718e7922eeda54865b46cd915eedd8d9891e5c4f3f23e34cdfc5a0aaa6065882245881d2bd39051cf864f81d6accb554b1cd85d
@@ -35,5 +35,18 @@ module SSMD::Processors
35
35
  ["strength", "x-strong"]
36
36
  end
37
37
  end
38
+
39
+ private
40
+
41
+ def join_parts(prefix, text, suffix)
42
+ leading_ws = /\A\s/
43
+ trailing_ws = /\s\z/
44
+
45
+ if prefix =~ trailing_ws && suffix =~ leading_ws && text == ""
46
+ prefix.sub(trailing_ws, "") + suffix
47
+ else
48
+ super
49
+ end
50
+ end
38
51
  end
39
52
  end
@@ -13,15 +13,11 @@ module SSMD::Processors
13
13
  end
14
14
 
15
15
  def substitute(input)
16
- if match
17
- [match.pre_match, result, match.post_match].join
18
- end
16
+ join_parts match.pre_match, result, match.post_match if match
19
17
  end
20
18
 
21
19
  def strip_ssmd(input)
22
- if match
23
- [match.pre_match, text, match.post_match].join
24
- end
20
+ join_parts match.pre_match, text, match.post_match if match
25
21
  end
26
22
 
27
23
  def text
@@ -39,5 +35,11 @@ module SSMD::Processors
39
35
  def warnings
40
36
  @warnings ||= []
41
37
  end
38
+
39
+ private
40
+
41
+ def join_parts(prefix, text, suffix)
42
+ [prefix, text, suffix].join
43
+ end
42
44
  end
43
45
  end
@@ -1,3 +1,3 @@
1
1
  module SSMD
2
- VERSION = "0.7.4"
2
+ VERSION = "0.7.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Kahl