message_format 0.0.6 → 0.0.7

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
- SHA1:
3
- metadata.gz: 3c24690ef4aac0b1f8083561a169dccf7dcb857a
4
- data.tar.gz: 9fb3a8de021dde0501b06ddb5d1c89433b7a9847
2
+ SHA256:
3
+ metadata.gz: d658a9e2c2873f4d79b82d4e8d52c16ce8c5847813ea74a5fda309e79a506570
4
+ data.tar.gz: f6f08d3b64ff10dfb697803abdf68c02311fa90456a378d3134cfeee4915b2e7
5
5
  SHA512:
6
- metadata.gz: bc2fa3a073db8deb76f6fa8b86119d54af2aaef8578c45aa5660d80840766a4bda5d1ec2ae9c8014352fad2f9a91f17728499a44f99a085930f9cf34ad78143c
7
- data.tar.gz: 30fdb2580ba4dba2b02178b391bb24bdf3bbff3e4683fabb7ba7111e01de93ec441daae37380463f5ad9ee97947c377c6e2d9cccc76fe314bc24b8c95d218063
6
+ metadata.gz: 451d356902caee5c79b4f694bb8547216ef74270ba71716bce06600dee1df3b88f3ed526c5a3b82069aa98e069c8a76516c95dfde19c73cddb72995e25165d3a
7
+ data.tar.gz: 5ef6bc98d8fdbf84224d7587f7754b472f2e70a6abeaa1c3b527ae63972908915440dc7ac99ca94a23a795805ae4ef06c0e2e28ab42fdd4ce90a259ed1436d28
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.7
4
+
5
+ * Fix integer number formatter
6
+
3
7
  ## 0.0.6
4
8
 
5
9
  * Update twitter_cldr dependency
@@ -84,7 +84,7 @@ module MessageFormat
84
84
  lambda do |args|
85
85
  number = TwitterCldr::Localized::LocalizedNumber.new(args[id] - offset, locale)
86
86
  if style == 'integer'
87
- number.to_decimal(:precision => 0).to_s
87
+ number.to_decimal.to_s(:precision => 0)
88
88
  elsif style == 'percent'
89
89
  number.to_percent.to_s
90
90
  elsif style == 'currency'
@@ -1,3 +1,3 @@
1
1
  module MessageFormat
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -47,6 +47,13 @@ describe MessageFormat do
47
47
  expect(message).to match(/^0 \: \d\d?\/\d\d?\/\d{2,4} \d\d?\:\d\d [AP]M$/)
48
48
  end
49
49
 
50
+ it 'formats integer number' do
51
+ pattern = '{ n, number, integer }'
52
+ message = MessageFormat.new(pattern, 'en-US').format({ n: 1234 })
53
+
54
+ expect(message).to match('1,234')
55
+ end
56
+
50
57
  it 'handles plurals' do
51
58
  pattern =
52
59
  'On {takenDate, date, short} {name} {numPeople, plural, offset:1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message_format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy VanWagoner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twitter_cldr
@@ -95,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubyforge_project:
99
- rubygems_version: 2.4.6
98
+ rubygems_version: 3.0.3
100
99
  signing_key:
101
100
  specification_version: 4
102
101
  summary: Parse and format i18n messages using ICU MessageFormat patterns