dry-inflector 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/LICENSE +1 -1
- data/README.md +4 -12
- data/dry-inflector.gemspec +8 -12
- data/lib/dry/inflector/inflections/defaults.rb +12 -3
- data/lib/dry/inflector/rules.rb +2 -2
- data/lib/dry/inflector/version.rb +1 -1
- data/lib/dry/inflector.rb +5 -3
- metadata +10 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a29169ed905c202d9bb082e009642b814ad1b19e32c8915d94f16725e291e93f
|
4
|
+
data.tar.gz: 4ed346b04b6f0330eb5cec81dca8e8ba3e77a80ddfe6ce3c29662be0413a7119
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f224fb42751e9df20caf821987c1595af1c3952090aad3163fb4357cd67b9376e1791ba6837551cf7d35f30aa3398fc7c4e69f8df7a3d36f6c801b9cf65479c
|
7
|
+
data.tar.gz: 07b107dd66fee8bcb856139969223e35229997b934005a3e6a0b63d965326f90fc9f61e1585a0609e00b938987693dee009996358776328c107ce12b75f257ea
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 1.2.0 2025-01-04
|
4
|
+
|
5
|
+
|
6
|
+
### Changed
|
7
|
+
|
8
|
+
- Bumped required Ruby version to 3.1 (@flash-gordon)
|
9
|
+
|
10
|
+
[Compare v1.1.0...v1.2.0](https://github.com/dry-rb/dry-inflector/compare/v1.1.0...v1.2.0)
|
11
|
+
|
12
|
+
## 1.1.0 2024-07-02
|
13
|
+
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
- Added "DB" as a default acronym (#49) (@timriley)
|
18
|
+
|
19
|
+
### Fixed
|
20
|
+
|
21
|
+
- Fix incorrect inflections on words separated by spaces, underscores or hyphens (#47) (@parndt)
|
22
|
+
|
23
|
+
|
24
|
+
[Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-inflector/compare/v1.0.0...v1.1.0)
|
25
|
+
|
3
26
|
## 1.0.0 2022-11-04
|
4
27
|
|
5
28
|
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,29 +1,21 @@
|
|
1
1
|
<!--- this file is synced from dry-rb/template-gem project -->
|
2
2
|
[gem]: https://rubygems.org/gems/dry-inflector
|
3
3
|
[actions]: https://github.com/dry-rb/dry-inflector/actions
|
4
|
-
[codacy]: https://www.codacy.com/gh/dry-rb/dry-inflector
|
5
|
-
[chat]: https://dry-rb.zulipchat.com
|
6
|
-
[inchpages]: http://inch-ci.org/github/dry-rb/dry-inflector
|
7
4
|
|
8
|
-
# dry-inflector [![
|
9
|
-
|
10
|
-
[![Gem Version](https://badge.fury.io/rb/dry-inflector.svg)][gem]
|
11
|
-
[![CI Status](https://github.com/dry-rb/dry-inflector/workflows/ci/badge.svg)][actions]
|
12
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/00339f2fb77840149f999cac6110c8a8)][codacy]
|
13
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/00339f2fb77840149f999cac6110c8a8)][codacy]
|
14
|
-
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-inflector.svg?branch=main)][inchpages]
|
5
|
+
# dry-inflector [![Gem Version](https://badge.fury.io/rb/dry-inflector.svg)][gem] [![CI Status](https://github.com/dry-rb/dry-inflector/workflows/ci/badge.svg)][actions]
|
15
6
|
|
16
7
|
## Links
|
17
8
|
|
18
9
|
* [User documentation](https://dry-rb.org/gems/dry-inflector)
|
19
10
|
* [API documentation](http://rubydoc.info/gems/dry-inflector)
|
11
|
+
* [Forum](https://discourse.dry-rb.org)
|
20
12
|
|
21
13
|
## Supported Ruby versions
|
22
14
|
|
23
15
|
This library officially supports the following Ruby versions:
|
24
16
|
|
25
|
-
* MRI `>=
|
26
|
-
* jruby `>= 9.
|
17
|
+
* MRI `>= 3.0.0`
|
18
|
+
* jruby `>= 9.4` (not tested on CI)
|
27
19
|
|
28
20
|
## License
|
29
21
|
|
data/dry-inflector.gemspec
CHANGED
@@ -16,21 +16,17 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.summary = "String inflections for dry-rb"
|
17
17
|
spec.description = spec.summary
|
18
18
|
spec.homepage = "https://dry-rb.org/gems/dry-inflector"
|
19
|
-
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-inflector.gemspec",
|
19
|
+
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-inflector.gemspec",
|
20
|
+
"lib/**/*"]
|
20
21
|
spec.bindir = "bin"
|
21
22
|
spec.executables = []
|
22
23
|
spec.require_paths = ["lib"]
|
23
24
|
|
24
|
-
spec.metadata["allowed_push_host"]
|
25
|
-
spec.metadata["changelog_uri"]
|
26
|
-
spec.metadata["source_code_uri"]
|
27
|
-
spec.metadata["bug_tracker_uri"]
|
25
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
26
|
+
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-inflector/blob/main/CHANGELOG.md"
|
27
|
+
spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-inflector"
|
28
|
+
spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-inflector/issues"
|
29
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
28
30
|
|
29
|
-
spec.required_ruby_version = ">=
|
30
|
-
|
31
|
-
# to update dependencies edit project.yml
|
32
|
-
|
33
|
-
spec.add_development_dependency "bundler"
|
34
|
-
spec.add_development_dependency "rake"
|
35
|
-
spec.add_development_dependency "rspec"
|
31
|
+
spec.required_ruby_version = ">= 3.1"
|
36
32
|
end
|
@@ -56,7 +56,7 @@ module Dry
|
|
56
56
|
inflect.singular(/s\z/i, "")
|
57
57
|
inflect.singular(/(n)ews\z/i, '\1ews')
|
58
58
|
inflect.singular(/([ti])a\z/i, '\1um')
|
59
|
-
inflect.singular(/(
|
59
|
+
inflect.singular(/(analy|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)\z/i,
|
60
60
|
'\1\2sis')
|
61
61
|
inflect.singular(/(^analy)(sis|ses)\z/i, '\1sis')
|
62
62
|
inflect.singular(/([^f])ves\z/i, '\1fe')
|
@@ -75,7 +75,7 @@ module Dry
|
|
75
75
|
inflect.singular(/(cris|ax|test)(is|es)\z/i, '\1is')
|
76
76
|
inflect.singular(/(octop|vir)(us|i)\z/i, '\1us')
|
77
77
|
inflect.singular(/(alias|status)(es)?\z/i, '\1')
|
78
|
-
inflect.singular(
|
78
|
+
inflect.singular(/(ox)en/i, '\1')
|
79
79
|
inflect.singular(/(vert|ind)ices\z/i, '\1ex')
|
80
80
|
inflect.singular(/(matr)ices\z/i, '\1ix')
|
81
81
|
inflect.singular(/(quiz)zes\z/i, '\1')
|
@@ -110,7 +110,16 @@ module Dry
|
|
110
110
|
# @since 0.1.2
|
111
111
|
# @api private
|
112
112
|
def self.acronyms(inflect)
|
113
|
-
inflect.acronym(*%w[
|
113
|
+
inflect.acronym(*%w[
|
114
|
+
API
|
115
|
+
CSRF
|
116
|
+
CSV
|
117
|
+
DB
|
118
|
+
HMAC
|
119
|
+
HTTP
|
120
|
+
JSON
|
121
|
+
OpenSSL
|
122
|
+
])
|
114
123
|
end
|
115
124
|
|
116
125
|
private_class_method :plural, :singular, :irregular, :uncountable, :acronyms
|
data/lib/dry/inflector/rules.rb
CHANGED
data/lib/dry/inflector.rb
CHANGED
@@ -30,8 +30,8 @@ module Dry
|
|
30
30
|
# inflections.singular "thieves", "thief" # specify a rule for #singularize
|
31
31
|
# inflections.uncountable "dry-inflector" # add an exception for an uncountable word
|
32
32
|
# end
|
33
|
-
def initialize(&
|
34
|
-
@inflections = Inflections.build(&
|
33
|
+
def initialize(&)
|
34
|
+
@inflections = Inflections.build(&)
|
35
35
|
end
|
36
36
|
|
37
37
|
# Lower camelize a string
|
@@ -298,7 +298,9 @@ module Dry
|
|
298
298
|
# @since 0.1.0
|
299
299
|
# @api private
|
300
300
|
def uncountable?(input)
|
301
|
-
input.match?(/\A[[:space:]]*\z/) ||
|
301
|
+
input.match?(/\A[[:space:]]*\z/) ||
|
302
|
+
inflections.uncountables.include?(input.downcase) ||
|
303
|
+
inflections.uncountables.include?(input.split(/_|\b/).last.downcase)
|
302
304
|
end
|
303
305
|
|
304
306
|
# @return [String]
|
metadata
CHANGED
@@ -1,59 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-inflector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
- Andrii Savchenko
|
9
9
|
- Abinoam P. Marques Jr.
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: bundler
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - ">="
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: '0'
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: rake
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - ">="
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '0'
|
36
|
-
type: :development
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '0'
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: rspec
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '0'
|
50
|
-
type: :development
|
51
|
-
prerelease: false
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '0'
|
13
|
+
date: 2025-01-04 00:00:00.000000000 Z
|
14
|
+
dependencies: []
|
57
15
|
description: String inflections for dry-rb
|
58
16
|
email:
|
59
17
|
- me@lucaguidi.com
|
@@ -79,10 +37,11 @@ licenses:
|
|
79
37
|
- MIT
|
80
38
|
metadata:
|
81
39
|
allowed_push_host: https://rubygems.org
|
82
|
-
changelog_uri: https://github.com/dry-rb/dry-inflector/blob/
|
40
|
+
changelog_uri: https://github.com/dry-rb/dry-inflector/blob/main/CHANGELOG.md
|
83
41
|
source_code_uri: https://github.com/dry-rb/dry-inflector
|
84
42
|
bug_tracker_uri: https://github.com/dry-rb/dry-inflector/issues
|
85
|
-
|
43
|
+
rubygems_mfa_required: 'true'
|
44
|
+
post_install_message:
|
86
45
|
rdoc_options: []
|
87
46
|
require_paths:
|
88
47
|
- lib
|
@@ -90,15 +49,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
49
|
requirements:
|
91
50
|
- - ">="
|
92
51
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
52
|
+
version: '3.1'
|
94
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
54
|
requirements:
|
96
55
|
- - ">="
|
97
56
|
- !ruby/object:Gem::Version
|
98
57
|
version: '0'
|
99
58
|
requirements: []
|
100
|
-
rubygems_version: 3.
|
101
|
-
signing_key:
|
59
|
+
rubygems_version: 3.3.27
|
60
|
+
signing_key:
|
102
61
|
specification_version: 4
|
103
62
|
summary: String inflections for dry-rb
|
104
63
|
test_files: []
|