tater 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/tater.rb +1 -1
- data/test/tater_test.rb +6 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6106cd4e2b4936a681033a8d27c663cde05b412c014d155d79363b36370a07b7
|
4
|
+
data.tar.gz: cc2ad7ed82fce6f3718a3f56d5475d750b006708c16882b82197c2f54c9dec32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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://
|
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.
|
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:
|
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.
|
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
|