ordinalize_full 3.1.0 → 4.0.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/.github/FUNDING.yml +3 -0
- data/.github/workflows/rubocop.yml +18 -9
- data/.github/workflows/tests.yml +22 -12
- data/.rubocop.yml +2 -2
- data/LICENSE.txt +1 -1
- data/lib/ordinalize_full.rb +3 -3
- data/ordinalize_full.gemspec +2 -2
- metadata +5 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1bda61add4fd3128ed94f20453da91e0f6eba3a6d059337fcea89f46c62da5ea
|
|
4
|
+
data.tar.gz: 6cdd96377f7bf331988ce2582df9f76edf3efb1dea9d30e28cac83e407df5737
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dafd8477c203a68bf52c7d2de4efc2b4214472a2481e41a6f03d038d3f744c5c219064ebb81aa1b81c16be7cce9b553c12e4efb41d4a916b801257e2927818f9
|
|
7
|
+
data.tar.gz: 9c266342468cd4978deaab0eb429e8551ba6d3707b13e0884b8eef872710e9c59fd03d680fab0cd9e1216366ed8dc0d5d53eaa6e8f72352914fb49d94a3a89b9
|
data/.github/FUNDING.yml
ADDED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
name: RuboCop
|
|
2
2
|
|
|
3
|
-
on:
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["master"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ["master"]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "0 0 1 * *" # first day of every month
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
4
13
|
|
|
5
14
|
jobs:
|
|
6
15
|
lint:
|
|
7
16
|
runs-on: ubuntu-latest
|
|
8
17
|
|
|
9
18
|
steps:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
|
+
- name: Set up Ruby
|
|
21
|
+
uses: ruby/setup-ruby@v1
|
|
22
|
+
with:
|
|
23
|
+
ruby-version: ruby # latest stable release
|
|
24
|
+
bundler-cache: true # 'bundle install' and cache
|
|
25
|
+
- name: Run RuboCop
|
|
26
|
+
run: bundle exec rubocop --parallel
|
data/.github/workflows/tests.yml
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
name: Tests
|
|
2
2
|
|
|
3
|
-
on:
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["master"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ["master"]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "0 0 1 * *" # first day of every month
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
4
13
|
|
|
5
14
|
jobs:
|
|
6
15
|
test:
|
|
@@ -11,16 +20,17 @@ jobs:
|
|
|
11
20
|
matrix:
|
|
12
21
|
ruby-version:
|
|
13
22
|
- head
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
23
|
+
- "4.0"
|
|
24
|
+
- "3.4"
|
|
25
|
+
- "3.3"
|
|
26
|
+
- "3.2"
|
|
17
27
|
|
|
18
28
|
steps:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
- uses: actions/checkout@v6
|
|
30
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
31
|
+
uses: ruby/setup-ruby@v1
|
|
32
|
+
with:
|
|
33
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
34
|
+
bundler-cache: true # 'bundle install' and cache
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: bundle exec rake
|
data/.rubocop.yml
CHANGED
data/LICENSE.txt
CHANGED
data/lib/ordinalize_full.rb
CHANGED
|
@@ -52,7 +52,7 @@ private
|
|
|
52
52
|
|
|
53
53
|
def ordinalize_in_short(gender: :masculine, plurality: :singular)
|
|
54
54
|
abs_number = to_i.abs
|
|
55
|
-
suffix =
|
|
55
|
+
suffix =
|
|
56
56
|
case I18n.locale
|
|
57
57
|
when :en
|
|
58
58
|
if (11..13).cover?(abs_number % 100)
|
|
@@ -117,7 +117,7 @@ private
|
|
|
117
117
|
meow /= 1000
|
|
118
118
|
i += 1
|
|
119
119
|
end
|
|
120
|
-
the_one_tenth = number % (
|
|
120
|
+
the_one_tenth = number % (10**(3 * i))
|
|
121
121
|
[
|
|
122
122
|
number_to_word(meow),
|
|
123
123
|
" ",
|
|
@@ -143,7 +143,7 @@ private
|
|
|
143
143
|
elsif number >= 100 && (number % 100).zero?
|
|
144
144
|
"#{number_to_word(number - (number % 100))}th"
|
|
145
145
|
else
|
|
146
|
-
"#{number_to_word(number - (number % 100))} and #{number_to_ordinal_word(
|
|
146
|
+
"#{number_to_word(number - (number % 100))} and #{number_to_ordinal_word(number % 100)}"
|
|
147
147
|
end
|
|
148
148
|
end
|
|
149
149
|
|
data/ordinalize_full.gemspec
CHANGED
|
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "ordinalize_full"
|
|
8
|
-
spec.version = "
|
|
8
|
+
spec.version = "4.0.0"
|
|
9
9
|
spec.authors = ["Cédric Félizard"]
|
|
10
10
|
spec.email = ["cedric@felizard.fr"]
|
|
11
11
|
spec.summary = "Turns a number into an ordinal string such as first, second, third or 1st, 2nd, 3rd."
|
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
18
|
spec.require_paths = ["lib"]
|
|
19
19
|
|
|
20
|
-
spec.required_ruby_version = ">= 3.
|
|
20
|
+
spec.required_ruby_version = ">= 3.2.0"
|
|
21
21
|
|
|
22
22
|
spec.add_dependency "i18n", "~> 1.8"
|
|
23
23
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ordinalize_full
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cédric Félizard
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: i18n
|
|
@@ -116,6 +115,7 @@ executables: []
|
|
|
116
115
|
extensions: []
|
|
117
116
|
extra_rdoc_files: []
|
|
118
117
|
files:
|
|
118
|
+
- ".github/FUNDING.yml"
|
|
119
119
|
- ".github/workflows/rubocop.yml"
|
|
120
120
|
- ".github/workflows/tests.yml"
|
|
121
121
|
- ".gitignore"
|
|
@@ -138,7 +138,6 @@ licenses:
|
|
|
138
138
|
- MIT
|
|
139
139
|
metadata:
|
|
140
140
|
rubygems_mfa_required: 'true'
|
|
141
|
-
post_install_message:
|
|
142
141
|
rdoc_options: []
|
|
143
142
|
require_paths:
|
|
144
143
|
- lib
|
|
@@ -146,15 +145,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
146
145
|
requirements:
|
|
147
146
|
- - ">="
|
|
148
147
|
- !ruby/object:Gem::Version
|
|
149
|
-
version: 3.
|
|
148
|
+
version: 3.2.0
|
|
150
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
150
|
requirements:
|
|
152
151
|
- - ">="
|
|
153
152
|
- !ruby/object:Gem::Version
|
|
154
153
|
version: '0'
|
|
155
154
|
requirements: []
|
|
156
|
-
rubygems_version:
|
|
157
|
-
signing_key:
|
|
155
|
+
rubygems_version: 4.0.17
|
|
158
156
|
specification_version: 4
|
|
159
157
|
summary: Turns a number into an ordinal string such as first, second, third or 1st,
|
|
160
158
|
2nd, 3rd.
|