tater 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/tater.rb +1 -1
  4. data/test/tater_test.rb +6 -0
  5. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16fddfa1cedd9af51e3d2e04422a083a16ee055e1102ad4482bfb28beee3be78
4
- data.tar.gz: 73273faf3a6bb5842d6adc2854ca98e81363efd0c45835de07fc2e4d807effa2
3
+ metadata.gz: 6106cd4e2b4936a681033a8d27c663cde05b412c014d155d79363b36370a07b7
4
+ data.tar.gz: cc2ad7ed82fce6f3718a3f56d5475d750b006708c16882b82197c2f54c9dec32
5
5
  SHA512:
6
- metadata.gz: a9da7fc7081b2043891c83f6ef46c1facdff44f85175ce5052af04a0e6f22bb82ffb0505a29d24a7d2a91ba00e81c5b8fccdb1c6b7118de48680639e474a7f13
7
- data.tar.gz: 0ccb2a820ea03144b96319c61eb0b645ca86002cf88c657b906669b39702dbdefb83e009a3b34fb5adda4a9fd47deaa30fbd0c0580ff34b80c9e9c5d4051a204
6
+ metadata.gz: 4cbf5271ab90d0b5d941dc3a338363c61f0a82916df5da691f2be08cf31ca8b77afa3099f9eb83e8b28c08b13d36e46eb3bb2d63129d44f5e4d3e267dea9da43
7
+ data.tar.gz: f5c6d9b1d95f94bb9780d351d5d6ecfb30e9d66706559854cfa77dfa303cee9ab9b67fb325ea78a7b9a0092a6a439d0163221e8e06ae650da163391fb88c361e
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Tater
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/tater.svg)](https://badge.fury.io/rb/tater)
4
- [![Build Status](https://secure.travis-ci.org/evanleck/tater.svg)](https://travis-ci.org/evanleck/tater)
4
+ [![Build Status](https://travis-ci.com/evanleck/tater.svg?branch=main)](https://travis-ci.com/evanleck/tater)
5
5
 
6
6
  Tater is an internationalization (i18n) and localization (l10n) library designed
7
7
  for simplicity. It doesn't do everything that other libraries do, but that's by
data/lib/tater.rb CHANGED
@@ -223,7 +223,7 @@ class Tater
223
223
  if precision.zero?
224
224
  integer
225
225
  else
226
- [integer, fraction&.ljust(precision, '0')].compact.join(separator)
226
+ [integer, fraction&.ljust(precision, '0')&.slice(0, precision)].compact.join(separator)
227
227
  end
228
228
  when Date, Time, DateTime
229
229
  format = lookup("#{ object.class.to_s.downcase }.formats.#{ options[:format] || DEFAULT }", locale: options[:locale]) || options[:format] || DEFAULT
data/test/tater_test.rb CHANGED
@@ -265,6 +265,12 @@ describe Tater do
265
265
  assert_equal '1NAH12', i18n.localize(BigDecimal('1.12'))
266
266
  end
267
267
 
268
+ it 'accomodates precision' do
269
+ assert_equal '10NAH00', i18n.localize(BigDecimal('10'))
270
+ assert_equal '10', i18n.localize(BigDecimal('10'), precision: 0)
271
+ assert_equal '10NAH00', i18n.localize(BigDecimal('10.00234'))
272
+ end
273
+
268
274
  it 'allows overriding the delimiter and separator' do
269
275
  assert_equal '10WOO000NAH12', i18n.localize(10_000.12, delimiter: 'WOO')
270
276
  assert_equal '10TURKEYS000YA12', i18n.localize(10_000.12, separator: 'YA')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tater
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Lecklider
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-29 00:00:00.000000000 Z
11
+ date: 2021-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -102,13 +102,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '2.0'
104
104
  requirements: []
105
- rubygems_version: 3.1.4
105
+ rubygems_version: 3.2.15
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Minimal internationalization and localization library.
109
109
  test_files:
110
- - test/fixtures/ruby.rb
111
110
  - test/fixtures/another.yml
112
111
  - test/fixtures/fixtures.yml
113
112
  - test/fixtures/messages/more.yml
113
+ - test/fixtures/ruby.rb
114
114
  - test/tater_test.rb