sterile 1.0.24 → 1.0.26

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: 6609d623434f38f1a8c5fc7955679b834150bfc370855be55bcc74767bed32a6
4
- data.tar.gz: eb41eeb0a06250a0113eb92f8b49568db1a52c57e9f125a0105b279d3c50ccb6
3
+ metadata.gz: 80dc35ba4862f316494b3de4c438279931d258e93c8bb82d8efe61e69706855c
4
+ data.tar.gz: f3a78cdfd802b5dae8ffb91a838eb931b02328f154dfb4aed6fde64bc0ced030
5
5
  SHA512:
6
- metadata.gz: 8002656ad9b4b7006ee57fe64e69c0cd71995dfe764f7ac6a12ae2f1d5d0a8f3244245b6ec80d46307d5f007e1aa8cf5269102433490fb326271b11d566da4a2
7
- data.tar.gz: 4b0748aaa375dc18f7150818feb90d81b591ed93cc13b93df05cc3bcdf4074683df240d4ef35de3963bf3a1b7908c5242517519b920ee5311e681c45ac6abd03
6
+ metadata.gz: b426ba9b0c9281bd9fac1e8fb568470eed98ef9aabab6965c61ca16848f67a8252e0f28350ee46ae0dfafef6fe4ebcbd51f9bb7e485b602235c5db2c19a48e67
7
+ data.tar.gz: 4270732de1d8ae39317f94fc374848021e14806205c183e52787f2a243507a55de4d8b211adefd8c0cb1e1b4a1c380172fec3eda6e889d11c2ee0c88ba75bc68
@@ -14,13 +14,13 @@ jobs:
14
14
  strategy:
15
15
  max-parallel: 3
16
16
  matrix:
17
- os: [ubuntu, macos]
18
- ruby-version: [head, 3.0, 2.7, 2.5]
17
+ os: [ubuntu-latest, macos-latest]
18
+ ruby-version: [head, 3.2, 3.1, 3.0, 2.7, 2.5]
19
19
  runs-on: ${{ matrix.os }}-latest
20
20
  steps:
21
- - uses: actions/checkout@v2
21
+ - uses: actions/checkout@v3
22
22
  - uses: ruby/setup-ruby@v1
23
23
  with:
24
24
  ruby-version: ${{ matrix.ruby-version }}
25
- - run: bundle install
25
+ bundler-cache: true
26
26
  - run: bundle exec rake test
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="RubyLiteralArrayInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
5
+ </profile>
6
+ </component>
data/.idea/sterile.iml CHANGED
@@ -11,5 +11,6 @@
11
11
  </content>
12
12
  <orderEntry type="inheritedJdk" />
13
13
  <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, RVM: ruby-2.5.9) [gem]" level="application" />
14
15
  </component>
15
16
  </module>
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sterile (1.0.24)
4
+ sterile (1.0.26)
5
5
  nokogiri (>= 1.11.7)
6
6
 
7
7
  GEM
@@ -26,6 +26,10 @@ module Sterile
26
26
  ["(c)", "©"],
27
27
  ["(r)", "®"],
28
28
  ["(R)", "®"],
29
+ ['"/"', "”/“"],
30
+ ["'/'", "’/‘"],
31
+ [/([iI][nN]\s+)\'(\d\d\D)/, "\\1’\\2"],
32
+ [/([iI][nN]\s+)\'(\d\d)$/, "\\1’\\2"],
29
33
  [/\'(\d\d)(?!’|\'|[^’\'\s]+[’\'][\p{P}\p{Z}])([\p{P}\p{Z}])/, "’\\1\\2"],
30
34
  # [/<p>"/, "<p>\\1″"],
31
35
  [/s\'([^a-zA-Z0-9])/, "s’\\1"],
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module Sterile
4
- VERSION = "1.0.24"
4
+ VERSION = "1.0.26"
5
5
  end
6
6
 
data/test/test_sterile.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "test_helper"
2
2
 
3
3
  class TestSterile < Minitest::Test
4
+
4
5
  def test_decode_entities
5
6
  assert_equal "“Hey” you", Sterile.decode_entities("&ldquo;Hey&rdquo; you")
6
7
 
@@ -79,5 +80,19 @@ class TestSterile < Minitest::Test
79
80
  def test_trim_whitespace
80
81
  assert_equal "Hello world!", Sterile.trim_whitespace(" Hello world! ")
81
82
  end
83
+
84
+ def test_quote_slash_quote
85
+ assert_equal "“one”/“two”", Sterile.smart_format('"one"/"two"')
86
+ assert_equal "‘one’/‘two’", Sterile.smart_format("'one'/'two'")
87
+ end
88
+
89
+ def test_number_single_quote
90
+ assert_equal "War in ’24", Sterile.smart_format("War in '24")
91
+ end
92
+
93
+ def test_number_single_quote_in_double_quotes
94
+ assert_equal "“War in ’24”", Sterile.smart_format("\"War in '24\"")
95
+ end
96
+
82
97
  end
83
98
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sterile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.24
4
+ version: 1.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Hogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-17 00:00:00.000000000 Z
11
+ date: 2024-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -35,6 +35,7 @@ files:
35
35
  - ".github/workflows/test.yml"
36
36
  - ".gitignore"
37
37
  - ".idea/.gitignore"
38
+ - ".idea/inspectionProfiles/Project_Default.xml"
38
39
  - ".idea/misc.xml"
39
40
  - ".idea/modules.xml"
40
41
  - ".idea/sterile.iml"
@@ -81,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
82
  - !ruby/object:Gem::Version
82
83
  version: '0'
83
84
  requirements: []
84
- rubygems_version: 3.4.6
85
+ rubygems_version: 3.5.3
85
86
  signing_key:
86
87
  specification_version: 4
87
88
  summary: Sterilize your strings! Transliterate, generate slugs, smart format, strip