human_number 0.1.5 → 0.1.7

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: 2dd3c82fa866e72f3077c07772ab73d4eff84d48507e763a0d83708d8204803e
4
- data.tar.gz: 164c8b2890482b306b2bd0054eedb4aad378bbfa57b0653931535b06ff7b95e6
3
+ metadata.gz: 3bc432b4b82fa70b18804f6db6080c10cf33c95e410c7ee9bb2335c99b053f8d
4
+ data.tar.gz: e2aa145ec5319d06c8ff98748ee8a696f6a0a999a571440931fc55e34681f78d
5
5
  SHA512:
6
- metadata.gz: 2629ec3485c1e040a704447dce110df8327a0b27111e688340601b6bffdfcd34efc17c24f2bbe549fe7b3c238542636f0fca775ce6569bae21b31a7c84d31f51
7
- data.tar.gz: 825db4efc41b062f7dc8604bc74eb91496e172b2d18acd463a9c3c33895328b5d550163d4166b65b938186bd77788b5297ed77e84922f5fa766ae57cb59a4239
6
+ metadata.gz: 123d58896c01e0297e7dde721df49e8036e4ced81185b508aa34750cf6b869487449b454fa9149d6816a05284f058bdf8ec6bf674ae52fbee6487ac880b8af42
7
+ data.tar.gz: e58469487228d201d424006a2d9a75aec5e8c73dedc3a7580c3e0ed716b20600d07f1055ec2993668aa38f422237b353e6f24091ba4a789c36ee4924e1546d35
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
1
+ --format progress
2
+ --require spec_helper
@@ -40,7 +40,7 @@ module HumanNumber
40
40
  }.freeze
41
41
 
42
42
  # Keys supported for native currency formatting
43
- SUPPORTED_NATIVE_CURRENCY_KEYS = %i[unit format native_format].freeze
43
+ SUPPORTED_NATIVE_CURRENCY_KEYS = %i[unit format].freeze
44
44
 
45
45
  module_function
46
46
 
@@ -113,13 +113,17 @@ module HumanNumber
113
113
  # Return nil for unknown currencies so formatters can fall back appropriately
114
114
  return nil if native_locales_for_currency(currency_code).empty?
115
115
 
116
- if SUPPORTED_NATIVE_CURRENCY_KEYS.include?(key) && native_locale?(currency_code, locale)
116
+ # For native locales and supported keys, try native formatting first
117
+ if native_locale?(currency_code, locale) && SUPPORTED_NATIVE_CURRENCY_KEYS.include?(key)
117
118
  native_key = native_currency_key(key)
118
-
119
119
  return I18n.t(native_key, locale:) if I18n.exists?(native_key, locale)
120
120
  end
121
121
 
122
- I18n.t(currency_key(key), locale: primary_locale_for_currency(currency_code, locale))
122
+ # Fallback to standard currency formatting using currency's primary locale
123
+ currency_locale = primary_locale_for_currency(currency_code, locale)
124
+ standard_key = currency_key(key)
125
+
126
+ I18n.t(standard_key, locale: currency_locale)
123
127
  end
124
128
  end
125
129
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HumanNumber
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: human_number
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ether Moon