dry-inflector 1.0.0 → 1.1.0

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: 3a76b37b2022509e4cfedeec51993ceb9b86a6f1958cdd2e622c96c3e58bde25
4
- data.tar.gz: c84af6c67bd4719d933c7e6eb7844fe8730486368a6202a2999e0d526bc71837
3
+ metadata.gz: 1392cfaa8284e7014f1c22ce07c413a3ce6789164fceabdd0654cf58b4149e85
4
+ data.tar.gz: db2dbba0b25cbb788f5b252ea879cccd8b0a3fec460766ac85ff44aaa3fa4dd9
5
5
  SHA512:
6
- metadata.gz: 1ed59c92bee7388db944360a6df90d0de35996fb197d74fbf7127ccf34adef3415c4dfc4ede88a43c433fdec8a4aee88a2d419682a608dcc45101411cbb7f3d9
7
- data.tar.gz: b0c27e24e5e5b23d4a075b33682079ea441121e9c5514f3e98fa7e875162873e1b3c3478ae0809e33d6e84ae7d0017c208355172ca4a84de0d06c657f45a0e70
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
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2021 dry-rb team
3
+ Copyright (c) 2015-2023 dry-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
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 [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
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 `>= 2.7.0`
26
- * jruby `>= 9.3` (postponed until 2.7 is supported)
17
+ * MRI `>= 3.0.0`
18
+ * jruby `>= 9.4` (not tested on CI)
27
19
 
28
20
  ## License
29
21
 
@@ -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/master/CHANGELOG.md"
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.0"
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(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)\z/i,
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(/^(ox)en/i, '\1')
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[JSON HTTP OpenSSL HMAC CSRF API CSV])
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
@@ -3,6 +3,6 @@
3
3
  module Dry
4
4
  class Inflector
5
5
  # @since 0.1.0
6
- VERSION = "1.0.0"
6
+ VERSION = "1.1.0"
7
7
  end
8
8
  end
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/) || inflections.uncountables.include?(input.downcase)
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.0.0
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: 2022-11-04 00:00:00.000000000 Z
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/master/CHANGELOG.md
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.0
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.1.6
100
+ rubygems_version: 3.3.27
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: String inflections for dry-rb