name_tamer 0.6.1 → 1.0.2

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: cc005aab6cf23f19cf21ee423d7e3c0b61e820e1dd115eaee6e058c93bfb29ca
4
- data.tar.gz: e1a792e62234a8a2fc49f3bde8596627d895a3dc035763b42f4c31c174adab2c
3
+ metadata.gz: 6297841f503f7afdd7c53dba7fd5393818a476a430f5af73e655553f4258f9da
4
+ data.tar.gz: cd6a297d247f13eb4c9c7d547c3d7001f4b2d8edf4d92943fa9e33405cb59ba8
5
5
  SHA512:
6
- metadata.gz: eeb9dba6eb6b560a1d58b54211db386d79d1dee64f761a78230f64847f53dea2786052daf7ec2ea33d5792f7148dbaadd97d074ca7e9a479e8bd8239a842e8eb
7
- data.tar.gz: a2776328194cc8ff76d9d201b0ca8f0d9e8b902a718223bf449afd5e298ef8006a2b8a1f9ed0ac32aefa8e27db38e2eae4e46689b11fa54e9f2cf993325621b9
6
+ metadata.gz: b3957fa8569fc8e85c0bacc26ae310d3b6f5a9b9ee1ac935bc1d2325d9a6197f94bd53ed4ecd61ccc59ad084785b3deb85b6dc333bb87ce4d3248ff9ad614ac1
7
+ data.tar.gz: 66b26c34e7e3da845a37256f32eb000b7142ab6ca5fb8728fd3169cc2136ec80513de0cf10ddb59a413578ce7c0c9441cd383769776fd14ee4b0777d7a8f1de3
data/CHANGELOG.md ADDED
@@ -0,0 +1,76 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.2] - 2026-07-22
9
+
10
+ ### Added
11
+
12
+ - Contributor documentation covering setup, testing, linting, adfix
13
+ maintenance, releases and changelog conventions.
14
+ - SonarQube Cloud project binding for SonarLint connected mode.
15
+
16
+ ### Changed
17
+
18
+ - The repository's maintenance tasks and prefix/suffix data files moved from
19
+ `doc/` to `docs/`.
20
+ - SonarQube analysis now imports SimpleCov 1.0 coverage reports after they are
21
+ normalised to absolute paths.
22
+ - GitHub Actions release, test and analysis workflows now use updated Ruby,
23
+ checkout, artifact upload, Ruby setup and SonarQube scan actions.
24
+ - The release workflow uses Ruby 4.0.6, while the test matrix continues to
25
+ cover Ruby 3.3, 3.4 and 4.0.
26
+ - Gem metadata and the lockfile now identify the released library as version
27
+ `1.0.1`.
28
+ - Generated planning documents under `docs/plans` are excluded from version
29
+ control.
30
+
31
+ ## [1.0.1] - 2026-07-20
32
+
33
+ ### Fixed
34
+
35
+ - The mangled-Á entry in the bad-encoding table is written with an escape
36
+ sequence, so source scanners no longer flag the file as corrupted.
37
+
38
+ ### Changed
39
+
40
+ - The `NameTamer::Strings` modules use `extend self` instead of
41
+ `module_function`; no public API change.
42
+
43
+ ## [1.0.0] - 2026-07-18
44
+
45
+ ### Changed
46
+
47
+ - **Breaking:** Ruby 3.3 or newer is required; Ruby 2.7–3.2 are no longer
48
+ supported.
49
+ - **Breaking:** `name_tamer` no longer defines methods on core classes. The
50
+ `String` helpers (`whitespace_to!`, `approximate_latin_chars!` and friends)
51
+ are now pure functions on `NameTamer::Strings`, and `Array#neighbours` has
52
+ become an internal helper of `NameTamer::Text`. The public API —
53
+ `NameTamer[]`, `NameTamer::Name`, `NameTamer.parameterize` — is unchanged.
54
+ - **Breaking:** the terminal-colour `String` methods (`"text".yellow` etc.)
55
+ have been removed; they were unrelated to name taming.
56
+
57
+ ### Fixed
58
+
59
+ - Multi-word prefixes and suffixes (for example `Chartered F.C.S.I.`,
60
+ `Private Limited`) are stripped correctly again, restoring the behaviour
61
+ of the released 0.6.1 gem after a regression when the adfix lists moved
62
+ into data files.
63
+ - The test suite runs on Ruby 3.4+ again (`yaml` is now required explicitly
64
+ and fixtures load under Psych 4's safe defaults).
65
+
66
+ ### Added
67
+
68
+ - Continuous integration on GitHub Actions: RuboCop plus RSpec on Ruby 3.3,
69
+ 3.4 and 4.0, with 100% line and branch coverage enforced.
70
+ - SonarQube Cloud analysis with imported coverage and RuboCop reports.
71
+ - Releases are published to RubyGems via trusted publishing (OIDC) from a
72
+ gated GitHub Actions environment.
73
+
74
+ ## [0.6.1] and earlier
75
+
76
+ See the [commit history](https://github.com/dominicsayers/name_tamer/commits/main).
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Dominic Sayers
3
+ Copyright (c) 2017-2026 Dominic Sayers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,27 +1,31 @@
1
- ## NameTamer
1
+ # NameTamer
2
2
 
3
3
  [![Gem version](https://badge.fury.io/rb/name_tamer.svg)](https://rubygems.org/gems/name_tamer)
4
4
  [![Gem downloads](https://img.shields.io/gem/dt/name_tamer.svg)](https://rubygems.org/gems/name_tamer)
5
- [![Build Status](https://travis-ci.org/dominicsayers/name_tamer.svg?branch=master)](https://travis-ci.org/dominicsayers/name_tamer)
6
- [![Code Climate](https://codeclimate.com/github/dominicsayers/name_tamer/badges/gpa.svg)](https://codeclimate.com/github/dominicsayers/name_tamer)
7
- [![Test Coverage](https://codeclimate.com/github/dominicsayers/name_tamer/badges/coverage.svg)](https://codeclimate.com/github/dominicsayers/name_tamer/coverage)
8
- [![Security](https://hakiri.io/github/dominicsayers/name_tamer/master.svg)](https://hakiri.io/github/dominicsayers/name_tamer/master)
5
+ [![Test](https://github.com/dominicsayers/name_tamer/actions/workflows/test.yml/badge.svg)](https://github.com/dominicsayers/name_tamer/actions/workflows/test.yml)
6
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dominicsayers_name_tamer&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dominicsayers_name_tamer)
9
7
 
10
8
  NameTamer: making sense of names
11
9
 
12
10
  ## Installation
13
11
 
14
- Add this line to your application's Gemfile:
12
+ Add the gem to your application:
15
13
 
16
- gem 'name_tamer'
14
+ ```console
15
+ bundle add name_tamer
16
+ ```
17
17
 
18
- And then execute:
18
+ Or install it yourself:
19
19
 
20
- $ bundle
20
+ ```console
21
+ gem install name_tamer
22
+ ```
21
23
 
22
- Or install it yourself as:
24
+ ## Supported Ruby versions
23
25
 
24
- $ gem install name_tamer
26
+ `name_tamer` supports the Ruby versions in [normal or security maintenance
27
+ upstream](https://www.ruby-lang.org/en/downloads/branches/) — currently
28
+ Ruby 3.3, 3.4 and 4.0. The test suite runs against all of them.
25
29
 
26
30
  ## Usage
27
31
 
@@ -41,41 +45,64 @@ name_tamer.nice_name # => John Q. Smith
41
45
  name_tamer.contact_type # => :person
42
46
  ```
43
47
 
44
- NameTamer will make an intelligent guess at the type of the name but it's not infallible. NameTamer likes it if you tell it whether the name is a person or an organization:
48
+ NameTamer will make an intelligent guess at the type of the name but it's
49
+ not infallible. NameTamer likes it if you tell it whether the name is a
50
+ person or an organization:
45
51
 
46
52
  ```ruby
47
- name_tamer = NameTamer::Name.new 'Di Doo Doo d.o.o.', contact_type: :organization
48
- name_tamer.simple_name # => Di Doo Doo
53
+ name_tamer = NameTamer::Name.new 'Acme Group Private Limited', contact_type: :organization
54
+ name_tamer.simple_name # => Acme Group
49
55
  ```
50
56
 
57
+ ## Upgrading from 0.x
58
+
59
+ Version 1.0.0 makes three breaking changes:
60
+
61
+ - Ruby 3.3 or newer is required.
62
+ - The gem no longer defines methods on `String` or `Array`. The helpers are
63
+ pure functions on `NameTamer::Strings` (e.g.
64
+ `NameTamer::Strings.approximate_latin_chars('Reñé')`), and each returns a
65
+ new string instead of mutating the receiver.
66
+ - The terminal-colour `String` methods (`'text'.yellow` and friends) are
67
+ gone; use a dedicated gem such as `rainbow` if you need them.
68
+
69
+ The documented API — `NameTamer[]`, `NameTamer::Name`,
70
+ `NameTamer.parameterize` — is unchanged.
71
+
51
72
  ## Contributing
52
73
 
53
- There must be lots of name suffixes and prefixes that I haven't catered for, so please get in touch if `name_tamer` doesn't recognise one that you've found.
74
+ There must be lots of name suffixes and prefixes that I haven't catered
75
+ for, so please get in touch if `name_tamer` doesn't recognise one that
76
+ you've found.
54
77
 
55
- If there are any other common two-word family names that I've missed then please let me know. `name_tamer` tries to make sure Helena Bonham Carter gets slugified to `helena-bonham-carter` and not `helena-carter`, but I'm sure there are loads of two-word family names I don't know about.
78
+ If there are any other common two-word family names that I've missed then
79
+ please let me know. `name_tamer` tries to make sure Helena Bonham Carter
80
+ gets slugified to `helena-bonham-carter` and not `helena-carter`, but I'm
81
+ sure there are loads of two-word family names I don't know about.
56
82
 
57
83
  Please read all the following articles before contributing:
58
84
 
59
- * [Personal names around the world](https://www.w3.org/International/questions/qa-personal-names)
60
- * [Falsehoods Programmers Believe About Names](https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/)
61
- * [Last Name First](http://www.solidether.net/article/last-name-first/)
62
- * [Namae (名前)](https://github.com/berkmancenter/namae)
63
- * [Matts Name Parser](https://github.com/mericson/people)
64
- * [Types of business entity](http://en.wikipedia.org/wiki/Types_of_business_entity)
65
- * [List of professional designations in the United States](http://en.wikipedia.org/wiki/List_of_post-nominal_letters_(USA))
66
- * [List of post-nominal letters (United Kingdom)](http://en.wikipedia.org/wiki/List_of_post-nominal_letters_(United_Kingdom))
67
- * [Nobiliary particle](http://en.wikipedia.org/wiki/Nobiliary_particle)
68
- * [Spanish naming customs](http://en.wikipedia.org/wiki/Spanish_naming_customs)
69
- * [Unified style sheet for linguistics](http://linguistlist.org/pubs/tocs/JournalUnifiedStyleSheet2007.pdf) [PDF]
85
+ - [Personal names around the world](https://www.w3.org/International/questions/qa-personal-names)
86
+ - [Falsehoods Programmers Believe About Names](https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/)
87
+ - [Last Name First](http://www.solidether.net/article/last-name-first/)
88
+ - [Namae (名前)](https://github.com/berkmancenter/namae)
89
+ - [Matts Name Parser](https://github.com/mericson/people)
90
+ - [Types of business entity](http://en.wikipedia.org/wiki/Types_of_business_entity)
91
+ - [List of professional designations in the United States](http://en.wikipedia.org/wiki/List_of_post-nominal_letters_(USA))
92
+ - [List of post-nominal letters (United Kingdom)](http://en.wikipedia.org/wiki/List_of_post-nominal_letters_(United_Kingdom))
93
+ - [Nobiliary particle](http://en.wikipedia.org/wiki/Nobiliary_particle)
94
+ - [Spanish naming customs](http://en.wikipedia.org/wiki/Spanish_naming_customs)
95
+ - [Unified style sheet for linguistics](http://linguistlist.org/pubs/tocs/JournalUnifiedStyleSheet2007.pdf) [PDF]
70
96
 
71
97
  ### How to contribute
72
98
 
73
- 1. Fork it
74
- 1. Create your feature branch (`git checkout -b my-new-feature`)
75
- 1. Commit your changes (`git commit -am 'Add some feature'`)
76
- 1. Push to the branch (`git push origin my-new-feature`)
77
- 1. Create new Pull Request
99
+ 1. Fork it
100
+ 1. Create your feature branch (`git checkout -b my-new-feature`)
101
+ 1. Commit your changes (`git commit -am 'Add some feature'`)
102
+ 1. Push to the branch (`git push origin my-new-feature`)
103
+ 1. Create new Pull Request
78
104
 
79
105
  ## Acknowledgements
80
106
 
81
- 1. Thanks to Ryan Bigg for the guide to making your first gem https://github.com/radar/guides/blob/master/gem-development.md
107
+ 1. Thanks to Ryan Bigg for the
108
+ [guide to making your first gem](https://github.com/radar/guides/blob/master/gem-development.md)
@@ -0,0 +1,44 @@
1
+ Baroness
2
+ Capt.
3
+ Captain
4
+ Col.
5
+ Colonel
6
+ Dame
7
+ Doctor
8
+ Doktor
9
+ Dr.
10
+ Frau
11
+ Herr
12
+ Judge
13
+ Justice
14
+ Lady
15
+ Lieut.
16
+ Lieutenant
17
+ Lord
18
+ Madame
19
+ Major
20
+ Master
21
+ Matron
22
+ Messrs.
23
+ Mgr.
24
+ Miss
25
+ Mister
26
+ Mlle.
27
+ Mme.
28
+ Mons.
29
+ Mr. & Mrs.
30
+ Mr. and Mrs.
31
+ Mr.
32
+ Mrs.
33
+ Ms.
34
+ Msgr.
35
+ Prof.
36
+ Professor
37
+ Rev.
38
+ Reverend
39
+ Sir
40
+ Sister
41
+ The Hon.
42
+ The Lady.
43
+ The Lord
44
+ The Rt. Hon.
@@ -0,0 +1,213 @@
1
+ S. de R.L. de C.V.
2
+ S.A.P.I. de C.V.
3
+ y. Cía. S. en C.
4
+ Private Limited
5
+ S.M. Pte. Ltd.
6
+ Cía. S. C. A.
7
+ y. Cía. S. C.
8
+ S.A. de C.V.
9
+ spol. s.r.o.
10
+ (Pty.) Ltd.
11
+ (Pvt.) Ltd.
12
+ A.D.S.I.Tz.
13
+ S.p. z.o.o.
14
+ (Pvt.)Ltd.
15
+ akc. spol.
16
+ Cía. Ltda.
17
+ E.B.V.B.A.
18
+ P. Limited
19
+ S. de R.L.
20
+ S.I.C.A.V.
21
+ S.P.R.L.U.
22
+ А.Д.С.И.Ц.
23
+ (P.) Ltd.
24
+ C. por A.
25
+ Comm.V.A.
26
+ Ltd. Şti.
27
+ Plc. Ltd.
28
+ Pte. Ltd.
29
+ Pty. Ltd.
30
+ Pvt. Ltd.
31
+ Soc. Col.
32
+ A.M.B.A.
33
+ A.S.B.L.
34
+ A.V.E.E.
35
+ B.V.B.A.
36
+ B.V.I.O.
37
+ C.V.B.A.
38
+ C.V.O.A.
39
+ E.E.I.G.
40
+ E.I.R.L.
41
+ E.O.O.D.
42
+ E.U.R.L.
43
+ F.M.B.A.
44
+ G.m.b.H.
45
+ Ges.b.R.
46
+ K.G.a.A.
47
+ L.L.L.P.
48
+ Ltd. Co.
49
+ Ltd. Co.
50
+ M.E.P.E.
51
+ n.y.r.t.
52
+ O.V.E.E.
53
+ P.E.E.C.
54
+ P.L.L.C.
55
+ P.L.L.C.
56
+ S. en C.
57
+ S.a.p.a.
58
+ S.A.R.L.
59
+ S.à.R.L.
60
+ S.A.S.U.
61
+ S.C.e.I.
62
+ S.C.O.P.
63
+ S.C.p.A.
64
+ S.C.R.I.
65
+ S.C.R.L.
66
+ S.M.B.A.
67
+ S.P.R.L.
68
+ Е.О.О.Д.
69
+ &. Cie.
70
+ and Co.
71
+ Comm.V.
72
+ Limited
73
+ P. Ltd.
74
+ Part.G.
75
+ Sh.p.k.
76
+ &. Co.
77
+ C.X.A.
78
+ d.n.o.
79
+ d.o.o.
80
+ E.A.D.
81
+ e.h.f.
82
+ E.P.E.
83
+ E.S.V.
84
+ F.C.P.
85
+ F.I.E.
86
+ G.b.R.
87
+ G.I.E.
88
+ G.M.K.
89
+ G.S.K.
90
+ H.U.F.
91
+ K.D.A.
92
+ k.f.t.
93
+ k.h.t.
94
+ k.k.t.
95
+ L.L.C.
96
+ L.L.P.
97
+ o.h.f.
98
+ O.H.G.
99
+ O.O.D.
100
+ O.y.j.
101
+ p.l.c.
102
+ P.S.U.
103
+ S.A.E.
104
+ S.A.S.
105
+ S.C.A.
106
+ S.C.E.
107
+ S.C.S.
108
+ S.E.M.
109
+ S.E.P.
110
+ s.e.s.
111
+ S.G.R.
112
+ S.N.C.
113
+ S.p.A.
114
+ S.P.E.
115
+ S.R.L.
116
+ s.r.o.
117
+ Unltd.
118
+ V.O.F.
119
+ V.o.G.
120
+ v.o.s.
121
+ V.Z.W.
122
+ z.r.t.
123
+ А.А.Т.
124
+ Е.А.Д.
125
+ З.А.Т.
126
+ К.Д.А.
127
+ О.О.Д.
128
+ Т.А.А.
129
+ 股份有限公司
130
+ Ap.S.
131
+ Corp.
132
+ ltda.
133
+ Sh.A.
134
+ st.G.
135
+ Ultd.
136
+ a.b.
137
+ A.D.
138
+ A.E.
139
+ A.G.
140
+ A.S.
141
+ A.Ş.
142
+ A.y.
143
+ B.M.
144
+ b.t.
145
+ B.V.
146
+ C.A.
147
+ C.V.
148
+ d.d.
149
+ e.c.
150
+ E.E.
151
+ e.G.
152
+ E.I.
153
+ E.P.
154
+ E.T.
155
+ E.U.
156
+ e.v.
157
+ G.K.
158
+ G.P.
159
+ h.f.
160
+ Inc.
161
+ K.D.
162
+ K.G.
163
+ K.K.
164
+ k.s.
165
+ k.v.
166
+ K.y.
167
+ L.C.
168
+ L.P.
169
+ Ltd.
170
+ N.K.
171
+ N.L.
172
+ N.V.
173
+ O.E.
174
+ O.G.
175
+ O.Ü.
176
+ O.y.
177
+ P.C.
178
+ p.l.
179
+ Pty.
180
+ PUP.
181
+ Pvt.
182
+ r.t.
183
+ S.A.
184
+ S.D.
185
+ S.E.
186
+ s.f.
187
+ S.L.
188
+ S.P.
189
+ S.s.
190
+ T.K.
191
+ T.Ü.
192
+ U.Ü.
193
+ Y.K.
194
+ А.Д.
195
+ І.П.
196
+ К.Д.
197
+ ПУП.
198
+ С.Д.
199
+ בע"מ
200
+ 任意組合
201
+ 匿名組合
202
+ 合同会社
203
+ 合名会社
204
+ 合資会社
205
+ 有限会社
206
+ 有限公司
207
+ 株式会社
208
+ A/S
209
+ G/S
210
+ I/S
211
+ K/S
212
+ P/S
213
+ S/A
@@ -0,0 +1,131 @@
1
+ A.A.M.S.
2
+ A.C.A.
3
+ A.C.C.
4
+ A.C.C.A.
5
+ A.C.M.A.
6
+ A.E.P.
7
+ A.I.F.
8
+ A.I.F.A.
9
+ A.S.A.
10
+ A.W.M.A.
11
+ B.A.
12
+ B.Ed.
13
+ B.Eng.
14
+ B.Sc.
15
+ B.Tech.
16
+ C.A.
17
+ C.A.I.A.
18
+ C.A.P.M.
19
+ C.B.V.
20
+ C.C.I.M.
21
+ C.D.F.A.
22
+ C.E.M.
23
+ C.E.P.P.
24
+ C.Eng.
25
+ C.F.A.
26
+ C.F.B.S.
27
+ C.F.F.
28
+ C.F.P.
29
+ C.F.S.
30
+ C.G.A.
31
+ C.G.B.
32
+ C.G.M.A.
33
+ C.G.P.
34
+ C.I.M.
35
+ C.I.S.S.P.
36
+ C.I.T.P.
37
+ C.L.P.
38
+ C.L.T.C.
39
+ C.L.U.
40
+ C.M.A.
41
+ C.M.T.
42
+ C.P.A.
43
+ C.P.C.C.
44
+ C.R.P.C.
45
+ C.R.P.S.
46
+ C.S.O.X.
47
+ C.S.S.D.
48
+ C.T.A.
49
+ C.W.S.
50
+ Cantab.
51
+ Ch.F.C.
52
+ Chartered F.C.S.I.
53
+ Chartered M.C.S.I.
54
+ D.B.E.
55
+ D.D.S.
56
+ D.Phil.
57
+ D.V.M.
58
+ Dip. D.M.
59
+ E.A.
60
+ E.R.P.
61
+ Ed.D.
62
+ Ed.M.
63
+ Eng.D.
64
+ Esq.
65
+ F.B.C.S.
66
+ F.C.A.
67
+ F.C.C.A.
68
+ F.C.I.P.S.
69
+ F.C.M.I.
70
+ F.C.S.I.
71
+ F.I.E.T.
72
+ F.I.R.P.
73
+ F.Inst.L.M.
74
+ F.P.C.
75
+ F.R.M.
76
+ F.R.M.
77
+ G.S.P.
78
+ Hons.
79
+ I.F.R.S. Certified
80
+ I.T.I.L. v3
81
+ II
82
+ III
83
+ IV
84
+ J.D.
85
+ Jr.
86
+ K.C.
87
+ L.P.S.
88
+ LL.B.
89
+ LL.D.
90
+ LL.M.
91
+ M.A.
92
+ M.B.A.
93
+ M.B.E.
94
+ M.D.
95
+ M.E.P.
96
+ M.Ed.
97
+ M.Eng.
98
+ M.I.E.T.
99
+ M.Io.D.
100
+ M.Jur.
101
+ M.P.
102
+ M.P.A.
103
+ M.R.I.C.S.
104
+ M.S.
105
+ M.S.F.
106
+ M.S.F.S.
107
+ M.S.P.
108
+ M.Sc. D.
109
+ M.Sc.
110
+ O.B.E.
111
+ O.K.
112
+ O.R.S.C.
113
+ Oxon.
114
+ P.A.
115
+ P.C.C.
116
+ P.F.S.
117
+ P.H.R.
118
+ P.M.C.
119
+ P.M.P.
120
+ P.M.P.
121
+ P.S.P.
122
+ Ph.D.
123
+ Q.C.
124
+ R.D.
125
+ R.F.C.
126
+ R.I.C.P.
127
+ S.C.M.P
128
+ Sr.
129
+ T.M.I.E.T.
130
+ V
131
+ V.M.D.