dry-inflector 1.0.0 → 1.1.0
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 +4 -4
- data/CHANGELOG.md +14 -0
- data/LICENSE +1 -1
- data/README.md +4 -12
- data/dry-inflector.gemspec +2 -2
- data/lib/dry/inflector/inflections/defaults.rb +12 -3
- data/lib/dry/inflector/version.rb +1 -1
- data/lib/dry/inflector.rb +3 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1392cfaa8284e7014f1c22ce07c413a3ce6789164fceabdd0654cf58b4149e85
|
4
|
+
data.tar.gz: db2dbba0b25cbb788f5b252ea879cccd8b0a3fec460766ac85ff44aaa3fa4dd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aec1c63a80251c78be05c751d8534dd0f1a4e076dc65073833ea1daab8a4f67045fe07322e283b01ef3753501ce0962d149252aa0d2e9cf1d690b9ea7b70bc0
|
7
|
+
data.tar.gz: 4d6ed796f9fe3e99ce77b93e7ee15e12230cf859912c199d8d5dcef1f3727d42d9f7f187e96399dd9825197da0a0e8329f6566ad748066a7ec7ab7f6ebb6bc5a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 1.1.0 2024-07-02
|
4
|
+
|
5
|
+
|
6
|
+
### Added
|
7
|
+
|
8
|
+
- Added "DB" as a default acronym (#49) (@timriley)
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
- Fix incorrect inflections on words separated by spaces, underscores or hyphens (#47) (@parndt)
|
13
|
+
|
14
|
+
|
15
|
+
[Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-inflector/compare/v1.0.0...v1.1.0)
|
16
|
+
|
3
17
|
## 1.0.0 2022-11-04
|
4
18
|
|
5
19
|
|
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 [][gem]
|
11
|
-
[][actions]
|
12
|
-
[][codacy]
|
13
|
-
[][codacy]
|
14
|
-
[][inchpages]
|
5
|
+
# dry-inflector [][gem] [][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
@@ -22,11 +22,11 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
25
|
-
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-inflector/blob/
|
25
|
+
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-inflector/blob/main/CHANGELOG.md"
|
26
26
|
spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-inflector"
|
27
27
|
spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-inflector/issues"
|
28
28
|
|
29
|
-
spec.required_ruby_version = ">= 2.7
|
29
|
+
spec.required_ruby_version = ">= 2.7"
|
30
30
|
|
31
31
|
# to update dependencies edit project.yml
|
32
32
|
|
@@ -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.rb
CHANGED
@@ -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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-inflector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-07-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -79,7 +79,7 @@ licenses:
|
|
79
79
|
- MIT
|
80
80
|
metadata:
|
81
81
|
allowed_push_host: https://rubygems.org
|
82
|
-
changelog_uri: https://github.com/dry-rb/dry-inflector/blob/
|
82
|
+
changelog_uri: https://github.com/dry-rb/dry-inflector/blob/main/CHANGELOG.md
|
83
83
|
source_code_uri: https://github.com/dry-rb/dry-inflector
|
84
84
|
bug_tracker_uri: https://github.com/dry-rb/dry-inflector/issues
|
85
85
|
post_install_message:
|
@@ -90,14 +90,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 2.7
|
93
|
+
version: '2.7'
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
rubygems_version: 3.
|
100
|
+
rubygems_version: 3.3.27
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: String inflections for dry-rb
|