ordinalize_full 1.5.0 → 1.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f246dedcd2a2e81868d204bf2238dc963fd088e60d6e8155b4f0efa9def7623f
4
- data.tar.gz: 06ea0ae5dc5d0078775677983ade7a5ae8e5658bd8d587b04f53e306214b7ff6
3
+ metadata.gz: af2369654eef3567467eea82fbdf6ef6f27d4cd2fb751d69d909dab0d047d2a9
4
+ data.tar.gz: 6e991c16ef687c7382c5fdcbe948cf6a539c48af9c3e7b1dc02f9a3adf5a7cc3
5
5
  SHA512:
6
- metadata.gz: d7b1f7b65a07e3e4373f0b4ad889260b358dfa171deeada261bd52584a355df3132ad8edc2375d898656ea399489c758b3803e9a2e6a147b9921d88ef9b845d6
7
- data.tar.gz: 0fdfaaf3afec98332a12d8d0fc26e45b1163f529aa13d1c4b125557e532bdd3252519c4d1af4b2c5dda85c5dc5acb423abb9c5dd380ed0860aeb0d1064343180
6
+ metadata.gz: 9cb46422080c99bab1666eba0ec07c0941461220af3204febd83bb9f25162734f0fef1271118977ea3e797dcbdbe76aa47c7d769568187f81f2ee449a5a46e8d
7
+ data.tar.gz: 79340703b14bfeedca1edc0b422d57a751b0416a53168ea3abf784a48b8a7dd35526c4d80d4408b9885ac62fe3197f206920f780bb4c5d2b592ef12cfb5102f0
data/.rubocop.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.4
2
+ TargetRubyVersion: 2.6
3
+ NewCops: enable
3
4
 
4
5
  Metrics:
5
6
  Enabled: false
@@ -7,9 +8,6 @@ Metrics:
7
8
  Layout/AccessModifierIndentation:
8
9
  EnforcedStyle: outdent
9
10
 
10
- Layout/AlignParameters:
11
- Enabled: false
12
-
13
11
  Layout/CaseIndentation:
14
12
  Enabled: false
15
13
 
@@ -19,6 +17,9 @@ Layout/EndAlignment:
19
17
  Layout/EmptyLinesAroundArguments:
20
18
  Enabled: false
21
19
 
20
+ Layout/LineLength:
21
+ Enabled: false
22
+
22
23
  Style/Alias:
23
24
  EnforcedStyle: prefer_alias_method
24
25
 
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.5.3
4
- - 2.4.5
3
+ - 3.0.0
4
+ - 2.7.2
5
+ - 2.6.6
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2017 Cédric Félizard
1
+ Copyright (c) 2014-2021 Cédric Félizard
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # OrdinalizeFull [![Build Status](https://travis-ci.org/infertux/ordinalize_full.svg?branch=master)](https://travis-ci.org/infertux/ordinalize_full) [![Dependency Status](https://gemnasium.com/infertux/ordinalize_full.svg)](https://gemnasium.com/infertux/ordinalize_full) [![Code Climate](https://codeclimate.com/github/infertux/ordinalize_full.png)](https://codeclimate.com/github/infertux/ordinalize_full)
1
+ # OrdinalizeFull
2
+
3
+ [![Build Status](https://travis-ci.org/infertux/ordinalize_full.svg?branch=master)](https://travis-ci.org/infertux/ordinalize_full)
4
+ [![Gem Version](https://badge.fury.io/rb/ordinalize_full.svg)](https://badge.fury.io/rb/ordinalize_full)
2
5
 
3
6
  Like Rails' [ordinalize](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-ordinalize) method but with the ability to return the ordinal string spelled out in full words such as _"first"_, _"second"_, _"third"_.
4
7
 
@@ -13,9 +13,12 @@ module OrdinalizeFull
13
13
  end
14
14
  end
15
15
 
16
- alias_method :ordinalize_full, \
17
16
  def ordinalize_in_full(gender: :masculine, plurality: :singular)
18
17
  case I18n.locale
18
+ when :fr
19
+ value = I18n.t("ordinalize_full.n_#{self}_#{gender}", throw: false, default: "")
20
+ value = I18n.t("ordinalize_full.n_#{self}", throw: true) if value.empty?
21
+ value
19
22
  when :es
20
23
  value = I18n.t("ordinalize_full.n_#{self}", throw: false, default: "")
21
24
 
@@ -38,6 +41,8 @@ module OrdinalizeFull
38
41
  raise NotImplementedError, "Unknown locale #{I18n.locale}"
39
42
  end
40
43
 
44
+ alias_method :ordinalize_full, :ordinalize_in_full
45
+
41
46
  private
42
47
 
43
48
  def ordinalize_in_short(gender: :masculine, plurality: :singular)
@@ -1,6 +1,7 @@
1
1
  fr:
2
2
  ordinalize_full:
3
3
  n_1: premier
4
+ n_1_feminine: première
4
5
  n_2: deuxième
5
6
  n_3: troisième
6
7
  n_4: quatrième
@@ -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 = "1.5.0"
8
+ spec.version = "1.6.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."
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.required_ruby_version = ">= 2.6.6"
22
+
21
23
  spec.add_dependency "i18n", "~> 0.8"
22
24
 
23
25
  spec.add_development_dependency "bundler", ">= 1.5"
@@ -19,6 +19,7 @@ describe OrdinalizeFull do
19
19
  before { I18n.locale = :fr }
20
20
 
21
21
  specify { expect(1.ordinalize_in_full).to eq("premier") }
22
+ specify { expect(1.ordinalize_in_full(gender: :feminine)).to eq("première") }
22
23
  specify { expect(42.ordinalize_in_full).to eq("quarante-deuxième") }
23
24
  end
24
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ordinalize_full
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cédric Félizard
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-28 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -122,7 +122,7 @@ homepage: https://github.com/infertux/ordinalize_full
122
122
  licenses:
123
123
  - MIT
124
124
  metadata: {}
125
- post_install_message:
125
+ post_install_message:
126
126
  rdoc_options: []
127
127
  require_paths:
128
128
  - lib
@@ -130,16 +130,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - ">="
132
132
  - !ruby/object:Gem::Version
133
- version: '0'
133
+ version: 2.6.6
134
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  requirements: []
140
- rubyforge_project:
141
- rubygems_version: 2.7.7
142
- signing_key:
140
+ rubygems_version: 3.1.4
141
+ signing_key:
143
142
  specification_version: 4
144
143
  summary: Turns a number into an ordinal string such as first, second, third or 1st,
145
144
  2nd, 3rd.