plurimath 0.8.7 → 0.8.8

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
2
  SHA256:
3
- metadata.gz: '0648b7ffe98de3f19067203ce8f5fc58cfed078c3c78a1b6bde359b9ad7948f0'
4
- data.tar.gz: bffd63b86cc6c8316dbe47bb6e3eb5fcac26f73b6ffc4622ecd31b1f0229b0d7
3
+ metadata.gz: 455b8c76b3f3b81de7fb64404dd70294107831a5af4fdde9b2acf2505895ec73
4
+ data.tar.gz: b1f196c6c295a5eae38e537e5a2ca9bc495895ea9eafa0784e2085116e71e36e
5
5
  SHA512:
6
- metadata.gz: d0402ad97a49a4374ce6491a6c9a8130645affae8d7f3b15efca9f20f59d476a97609169dac38483f8575806cfb569876aba14fc3ce3edbe881332f53bc8551d
7
- data.tar.gz: a6729ce0456b3b5d277799cb0315bc5611b428ee7dc62284500783b9fb1d0c401c36f38c4e07403577cb8b3f330114930b774eb0e13b4be70f8f03e9595e36a8
6
+ metadata.gz: 2b1d2f6056126c677dda6cd5003c7d530009aab799e86b2a382736d8019b6f68652a3b0a050b61d8fb5e751b62c23db3fd0daa5e82dd8c499b4bf8eee140718a
7
+ data.tar.gz: 45a364fbf46f1c78e6e5c7507891b3c9a2b47cac2460e775f8c01487e6fce33d993d6282f19002b76605f42b0894f8fff8dcb6da9076632747d8d03c4bfd1389
@@ -8,7 +8,7 @@ require_relative "localized_number"
8
8
  module Plurimath
9
9
  module Formatter
10
10
  class NumericFormatter
11
- attr_accessor :locale, :localize_number, :localizer_symbols
11
+ attr_accessor :locale, :localize_number, :localizer_symbols, :twitter_cldr_reader
12
12
 
13
13
  LOCALIZE_NUMBER_REGEX = %r{(?<group>[^#])?(?<groupdigits>#+0)(?<decimal>.)(?<fractdigits>#+)(?<fractgroup>[^#])?}
14
14
  SUPPORTED_NOTATIONS = %i[e scientific engineering].freeze
@@ -17,7 +17,7 @@ module Plurimath
17
17
  @locale = locale
18
18
  @localize_number = localize_number
19
19
  @localizer_symbols = localizer_symbols
20
- @twitter_cldr_reader = twitter_cldr_reader
20
+ @twitter_cldr_reader = twitter_cldr_reader_lookup
21
21
  end
22
22
 
23
23
  def localized_number(number_string, locale:, precision:, format:)
@@ -30,7 +30,7 @@ module Plurimath
30
30
 
31
31
  private
32
32
 
33
- def twitter_cldr_reader
33
+ def twitter_cldr_reader_lookup
34
34
  num = TwitterCldr::DataReaders::NumberDataReader.new(locale)
35
35
  num.symbols
36
36
  .merge!(@localizer_symbols)
@@ -23,6 +23,14 @@ module Plurimath
23
23
  )
24
24
  end
25
25
 
26
+ def twitter_cldr_reader(locale: @locale)
27
+ Formatter::NumericFormatter.new(
28
+ supported_locale(locale),
29
+ localize_number: localize_number,
30
+ localizer_symbols: localizer_symbols,
31
+ ).twitter_cldr_reader
32
+ end
33
+
26
34
  private
27
35
 
28
36
  def supported_locale(locale)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plurimath
4
- VERSION = "0.8.7"
4
+ VERSION = "0.8.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plurimath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-07 00:00:00.000000000 Z
11
+ date: 2024-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twitter_cldr