icu4x 0.6.1 → 0.7.0

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: 28ab1937c0157603296c359e3ee392c9daf61ab75b88814bd59c0e448558d288
4
- data.tar.gz: 6f867d51c15a78a9f8d52a1cc41fe6a85fe5195a78dc31f3d08168db77858e1b
3
+ metadata.gz: a6127d334332b2d38a6ef3518d9e7c076158d4eb21a282a982709dde0e8a9e70
4
+ data.tar.gz: 189fb0957980330e56c643bed174289039aa7f73f3d03d3ff91e8aab0211b6e4
5
5
  SHA512:
6
- metadata.gz: 4ab2852087c12adad3275197b50915e1d0c1b29111e3428c35c43d04864734e4d081b22700a6cf25408bfb74326964a6de38318f6bebddd2635b7978d516c449
7
- data.tar.gz: 4293277c12231a11a52e6686874238d994b5cb438e2e780a66c26f8cdc906ec54bf6af1f4982c24ac1eb27474e980e7420bf84676096a16e8497f3ff4b396216
6
+ metadata.gz: 660d2834ff4811ff545c95c44e0e1ddecdfeda53b48e1cfdafd6c7ca12387a00c48c2836ae2eab58ebaf9f654386231eac0c0c2674633b2ab702a1b3ef3cd1f3
7
+ data.tar.gz: 87014b1b98c519d06f97b43a6697d344f94cc1ed4b055f4d4de13b269efefdb55d0d83628be2828adcbadbaebb419d4446e852dfa30c597d0c3478edab2b6560
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.7.0] - 2026-01-09
4
+
5
+ ### Added
6
+
7
+ - `DateTimeFormat#format` now accepts any object responding to `#to_time` (e.g., `Date`, `DateTime`)
8
+
9
+ ## [0.6.2] - 2026-01-02
10
+
11
+ ### Fixed
12
+
13
+ - Fix incorrect `Segment#text` → `#segment` in README example
14
+ - Improve README Setup section (mention prebuilt binary gems, add Data Preparation heading)
15
+ - Replace YARD `+...+` syntax with markdown backticks for consistency
16
+
3
17
  ## [0.6.1] - 2026-01-02
4
18
 
5
19
  ### Changed
data/README.md CHANGED
@@ -25,7 +25,7 @@ No locale data is bundled with the gem. Users generate only the data they need,
25
25
  ## Requirements
26
26
 
27
27
  - Ruby 3.2+
28
- - Rust toolchain (for building the native extension)
28
+ - Rust toolchain (only required when building from source; prebuilt binary gems are available for major platforms)
29
29
 
30
30
  ## Setup
31
31
 
@@ -35,7 +35,11 @@ Add to your Gemfile:
35
35
  gem "icu4x"
36
36
  ```
37
37
 
38
- ### Option 1: Use Pre-built Data Gem (Quick Start)
38
+ Prebuilt binary gems are available for x86_64-linux, aarch64-linux, x86_64-darwin, arm64-darwin, and x64-mingw-ucrt. On these platforms, no Rust toolchain is required.
39
+
40
+ ### Data Preparation
41
+
42
+ #### Option 1: Use Pre-built Data Gem (Quick Start)
39
43
 
40
44
  Add a companion data gem for instant setup:
41
45
 
@@ -54,7 +58,7 @@ Available data gems:
54
58
  - `icu4x-data-recommended` - Recommended locales (164)
55
59
  - `icu4x-data-modern` - Modern coverage locales (103)
56
60
 
57
- ### Option 2: Generate Custom Data
61
+ #### Option 2: Generate Custom Data
58
62
 
59
63
  For fine-grained control, generate only the locales you need:
60
64
 
@@ -124,7 +128,7 @@ dn.of("en")
124
128
 
125
129
  # Text segmentation
126
130
  segmenter = ICU4X::Segmenter.new(granularity: :word, provider:)
127
- segmenter.segment("Hello, world!").map(&:text)
131
+ segmenter.segment("Hello, world!").map(&:segment)
128
132
  # => ["Hello", ",", " ", "world", "!"]
129
133
  ```
130
134
 
@@ -46,7 +46,18 @@ pub struct Collator {
46
46
  case_first: Option<CaseFirstOption>,
47
47
  }
48
48
 
49
- // SAFETY: Ruby's GVL protects access to this type.
49
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
50
+ //
51
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
52
+ // - All Ruby method calls are serialized by the GVL
53
+ // - Only one thread can execute Ruby code at a time
54
+ // - The underlying ICU4X types are only accessed through Ruby method calls
55
+ //
56
+ // WARNING: This safety guarantee does NOT hold if:
57
+ // - The GVL is released via `rb_thread_call_without_gvl`
58
+ // - Using threading libraries that bypass the GVL
59
+ //
60
+ // In such cases, concurrent access to this type would be unsafe.
50
61
  unsafe impl Send for Collator {}
51
62
 
52
63
  impl Collator {
@@ -25,8 +25,18 @@ pub struct DataProvider {
25
25
  pub(crate) inner: LocaleFallbackProvider<BlobDataProvider>,
26
26
  }
27
27
 
28
- // SAFETY: Ruby's GVL protects access to this type. The provider is only
29
- // accessed through Ruby method calls, which are serialized by the GVL.
28
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
29
+ //
30
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
31
+ // - All Ruby method calls are serialized by the GVL
32
+ // - Only one thread can execute Ruby code at a time
33
+ // - The underlying ICU4X types are only accessed through Ruby method calls
34
+ //
35
+ // WARNING: This safety guarantee does NOT hold if:
36
+ // - The GVL is released via `rb_thread_call_without_gvl`
37
+ // - Using threading libraries that bypass the GVL
38
+ //
39
+ // In such cases, concurrent access to this type would be unsafe.
30
40
  unsafe impl Send for DataProvider {}
31
41
 
32
42
  impl DataProvider {
@@ -106,7 +106,18 @@ pub struct DateTimeFormat {
106
106
  calendar: Calendar,
107
107
  }
108
108
 
109
- // SAFETY: Ruby's GVL protects access to this type.
109
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
110
+ //
111
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
112
+ // - All Ruby method calls are serialized by the GVL
113
+ // - Only one thread can execute Ruby code at a time
114
+ // - The underlying ICU4X types are only accessed through Ruby method calls
115
+ //
116
+ // WARNING: This safety guarantee does NOT hold if:
117
+ // - The GVL is released via `rb_thread_call_without_gvl`
118
+ // - Using threading libraries that bypass the GVL
119
+ //
120
+ // In such cases, concurrent access to this type would be unsafe.
110
121
  unsafe impl Send for DateTimeFormat {}
111
122
 
112
123
  impl DateTimeFormat {
@@ -264,27 +275,34 @@ impl DateTimeFormat {
264
275
  }
265
276
  }
266
277
 
267
- /// Format a Ruby Time object
278
+ /// Format a Ruby Time object or any object responding to #to_time
268
279
  ///
269
280
  /// # Arguments
270
- /// * `time` - A Ruby Time object
281
+ /// * `time` - A Ruby Time object or an object responding to #to_time (e.g., Date, DateTime)
271
282
  ///
272
283
  /// # Returns
273
284
  /// A formatted string
274
285
  fn format(&self, time: Value) -> Result<String, Error> {
275
286
  let ruby = Ruby::get().expect("Ruby runtime should be available");
276
287
 
277
- // Validate that time is a Time object
288
+ // Convert to Time if the object responds to #to_time
289
+ let time_value = if time.respond_to("to_time", false)? {
290
+ time.funcall::<_, _, Value>("to_time", ())?
291
+ } else {
292
+ time
293
+ };
294
+
295
+ // Validate that the result is a Time object
278
296
  let time_class: Value = ruby.eval("Time")?;
279
- if !time.is_kind_of(magnus::RClass::try_convert(time_class)?) {
297
+ if !time_value.is_kind_of(magnus::RClass::try_convert(time_class)?) {
280
298
  return Err(Error::new(
281
299
  ruby.exception_type_error(),
282
- "argument must be a Time object",
300
+ "argument must be a Time object or respond to #to_time",
283
301
  ));
284
302
  }
285
303
 
286
304
  // Convert Ruby Time to ICU4X DateTime, applying timezone if specified
287
- let datetime = self.convert_time_to_datetime(&ruby, time)?;
305
+ let datetime = self.convert_time_to_datetime(&ruby, time_value)?;
288
306
 
289
307
  // Format the datetime
290
308
  let formatted = self.inner.format(&datetime);
@@ -72,7 +72,18 @@ pub struct DisplayNames {
72
72
  fallback: DisplayNamesFallback,
73
73
  }
74
74
 
75
- // SAFETY: Ruby's GVL protects access to this type.
75
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
76
+ //
77
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
78
+ // - All Ruby method calls are serialized by the GVL
79
+ // - Only one thread can execute Ruby code at a time
80
+ // - The underlying ICU4X types are only accessed through Ruby method calls
81
+ //
82
+ // WARNING: This safety guarantee does NOT hold if:
83
+ // - The GVL is released via `rb_thread_call_without_gvl`
84
+ // - Using threading libraries that bypass the GVL
85
+ //
86
+ // In such cases, concurrent access to this type would be unsafe.
76
87
  unsafe impl Send for DisplayNames {}
77
88
 
78
89
  impl DisplayNames {
@@ -43,7 +43,18 @@ pub struct ListFormat {
43
43
  list_style: ListStyle,
44
44
  }
45
45
 
46
- // SAFETY: Ruby's GVL protects access to this type.
46
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
47
+ //
48
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
49
+ // - All Ruby method calls are serialized by the GVL
50
+ // - Only one thread can execute Ruby code at a time
51
+ // - The underlying ICU4X types are only accessed through Ruby method calls
52
+ //
53
+ // WARNING: This safety guarantee does NOT hold if:
54
+ // - The GVL is released via `rb_thread_call_without_gvl`
55
+ // - Using threading libraries that bypass the GVL
56
+ //
57
+ // In such cases, concurrent access to this type would be unsafe.
47
58
  unsafe impl Send for ListFormat {}
48
59
 
49
60
  impl ListFormat {
@@ -83,7 +83,18 @@ pub struct NumberFormat {
83
83
  rounding_mode: RoundingMode,
84
84
  }
85
85
 
86
- // SAFETY: Ruby's GVL protects access to this type.
86
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
87
+ //
88
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
89
+ // - All Ruby method calls are serialized by the GVL
90
+ // - Only one thread can execute Ruby code at a time
91
+ // - The underlying ICU4X types are only accessed through Ruby method calls
92
+ //
93
+ // WARNING: This safety guarantee does NOT hold if:
94
+ // - The GVL is released via `rb_thread_call_without_gvl`
95
+ // - Using threading libraries that bypass the GVL
96
+ //
97
+ // In such cases, concurrent access to this type would be unsafe.
87
98
  unsafe impl Send for NumberFormat {}
88
99
 
89
100
  impl NumberFormat {
@@ -17,7 +17,18 @@ pub struct PluralRules {
17
17
  rule_type: PluralRuleType,
18
18
  }
19
19
 
20
- // SAFETY: Ruby's GVL protects access to this type.
20
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
21
+ //
22
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
23
+ // - All Ruby method calls are serialized by the GVL
24
+ // - Only one thread can execute Ruby code at a time
25
+ // - The underlying ICU4X types are only accessed through Ruby method calls
26
+ //
27
+ // WARNING: This safety guarantee does NOT hold if:
28
+ // - The GVL is released via `rb_thread_call_without_gvl`
29
+ // - Using threading libraries that bypass the GVL
30
+ //
31
+ // In such cases, concurrent access to this type would be unsafe.
21
32
  unsafe impl Send for PluralRules {}
22
33
 
23
34
  impl PluralRules {
@@ -75,7 +75,18 @@ pub struct RelativeTimeFormat {
75
75
  numeric: NumericMode,
76
76
  }
77
77
 
78
- // SAFETY: Ruby's GVL protects access to this type.
78
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
79
+ //
80
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
81
+ // - All Ruby method calls are serialized by the GVL
82
+ // - Only one thread can execute Ruby code at a time
83
+ // - The underlying ICU4X types are only accessed through Ruby method calls
84
+ //
85
+ // WARNING: This safety guarantee does NOT hold if:
86
+ // - The GVL is released via `rb_thread_call_without_gvl`
87
+ // - Using threading libraries that bypass the GVL
88
+ //
89
+ // In such cases, concurrent access to this type would be unsafe.
79
90
  unsafe impl Send for RelativeTimeFormat {}
80
91
 
81
92
  impl RelativeTimeFormat {
@@ -38,7 +38,18 @@ pub struct Segmenter {
38
38
  granularity: Granularity,
39
39
  }
40
40
 
41
- // SAFETY: Ruby's GVL protects access to this type.
41
+ // SAFETY: This type is marked as Send to allow Ruby to move it between threads.
42
+ //
43
+ // Thread safety is guaranteed by Ruby's Global VM Lock (GVL):
44
+ // - All Ruby method calls are serialized by the GVL
45
+ // - Only one thread can execute Ruby code at a time
46
+ // - The underlying ICU4X types are only accessed through Ruby method calls
47
+ //
48
+ // WARNING: This safety guarantee does NOT hold if:
49
+ // - The GVL is released via `rb_thread_call_without_gvl`
50
+ // - Using threading libraries that bypass the GVL
51
+ //
52
+ // In such cases, concurrent access to this type would be unsafe.
42
53
  unsafe impl Send for Segmenter {}
43
54
 
44
55
  impl Segmenter {
@@ -17,11 +17,11 @@ module ICU4X
17
17
  # ICU4X::DataGemTask.new
18
18
  #
19
19
  # This creates the following tasks:
20
- # - +icu4x:data_gems:build+ - Build all data gems
21
- # - +icu4x:data_gems:build:full+ - Build icu4x-data-full gem
22
- # - +icu4x:data_gems:build:recommended+ - Build icu4x-data-recommended gem
23
- # - +icu4x:data_gems:build:modern+ - Build icu4x-data-modern gem
24
- # - +icu4x:data_gems:clean+ - Clean data gem build artifacts
20
+ # - `icu4x:data_gems:build` - Build all data gems
21
+ # - `icu4x:data_gems:build:full` - Build icu4x-data-full gem
22
+ # - `icu4x:data_gems:build:recommended` - Build icu4x-data-recommended gem
23
+ # - `icu4x:data_gems:build:modern` - Build icu4x-data-modern gem
24
+ # - `icu4x:data_gems:clean` - Clean data gem build artifacts
25
25
  class DataGemTask < ::Rake::TaskLib
26
26
  VARIANTS = {
27
27
  full: {locales: :full, description: "All CLDR locales (700+)"},
@@ -24,11 +24,11 @@ module ICU4X
24
24
  attr_reader :name
25
25
 
26
26
  # @return [Symbol, Array<String>] Locale specifier or array of locale strings
27
- # Defaults to +:recommended+
27
+ # Defaults to `:recommended`
28
28
  attr_accessor :locales
29
29
 
30
30
  # @return [Symbol, Array<String>] Data markers to include
31
- # Defaults to +:all+
31
+ # Defaults to `:all`
32
32
  attr_accessor :markers
33
33
 
34
34
  # @return [Pathname, String] Output path relative to Rakefile
data/lib/icu4x/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ICU4X
4
- VERSION = "0.6.1"
4
+ VERSION = "0.7.0"
5
5
  public_constant :VERSION
6
6
  end
@@ -27,7 +27,7 @@
27
27
  #
28
28
  # # Returns the default data provider, lazily loaded from configuration.
29
29
  # #
30
- # # The provider is created from +config.data_path+ or the +ICU4X_DATA_PATH+
30
+ # # The provider is created from `config.data_path` or the `ICU4X_DATA_PATH`
31
31
  # # environment variable. Once created, the provider is cached.
32
32
  # #
33
33
  # # @return [DataProvider, nil] the default provider, or nil if not configured
@@ -85,7 +85,7 @@
85
85
  # # Creates a DataProvider from a binary blob file.
86
86
  # #
87
87
  # # @param path [Pathname] path to the .postcard blob file
88
- # # @param priority [Symbol] collation fallback priority, either +:language+ or +:region+
88
+ # # @param priority [Symbol] collation fallback priority, either `:language` or `:region`
89
89
  # # @return [DataProvider] a new data provider instance
90
90
  # # @raise [DataError] if the file cannot be read or is invalid
91
91
  # #
@@ -112,21 +112,21 @@
112
112
  # class DataGenerator
113
113
  # # Exports locale data to a file.
114
114
  # #
115
- # # The +locales+ parameter accepts either a Symbol for predefined locale sets
115
+ # # The `locales` parameter accepts either a Symbol for predefined locale sets
116
116
  # # based on CLDR coverage levels, or an Array of locale identifier strings.
117
- # # When using +with_descendants+, ancestor locales (including +und+) are
117
+ # # When using `with_descendants`, ancestor locales (including `und`) are
118
118
  # # automatically included for fallback support.
119
119
  # #
120
120
  # # @param locales [Symbol, Array<String>] locale specification:
121
- # # - +:full+ - all CLDR locales (700+)
122
- # # - +:recommended+ - locales with basic, moderate, or modern coverage (164)
123
- # # - +:modern+ - locales with modern coverage only (103)
124
- # # - +:moderate+ - locales with moderate coverage only
125
- # # - +:basic+ - locales with basic coverage only
126
- # # - +Array<String>+ - explicit list of locale identifiers
121
+ # # - `:full` - all CLDR locales (700+)
122
+ # # - `:recommended` - locales with basic, moderate, or modern coverage (164)
123
+ # # - `:modern` - locales with modern coverage only (103)
124
+ # # - `:moderate` - locales with moderate coverage only
125
+ # # - `:basic` - locales with basic coverage only
126
+ # # - `Array<String>` - explicit list of locale identifiers
127
127
  # # @param markers [Symbol, Array<String>] data markers to include;
128
- # # use +:all+ for all markers, or specify individual marker names
129
- # # @param format [Symbol] output format, currently only +:blob+ is supported
128
+ # # use `:all` for all markers, or specify individual marker names
129
+ # # @param format [Symbol] output format, currently only `:blob` is supported
130
130
  # # @param output [Pathname] path to write the output file
131
131
  # # @return [void]
132
132
  # # @raise [DataGeneratorError] if export fails
@@ -233,9 +233,9 @@
233
233
  # # Returns the locale extensions.
234
234
  # #
235
235
  # # @return [Hash] a hash containing extension data with keys:
236
- # # - +:unicode+ [Hash<String, String>] Unicode extension key-value pairs
237
- # # - +:transform+ [String, nil] Transform extension string
238
- # # - +:private+ [Array<String>] Private use extensions
236
+ # # - `:unicode` [Hash<String, String>] Unicode extension key-value pairs
237
+ # # - `:transform` [String, nil] Transform extension string
238
+ # # - `:private` [Array<String>] Private use extensions
239
239
  # #
240
240
  # # @example
241
241
  # # locale = ICU4X::Locale.parse("ja-JP-u-ca-japanese")
@@ -299,7 +299,7 @@
299
299
  # #
300
300
  # # @param locale [Locale] the locale for plural rules
301
301
  # # @param provider [DataProvider, nil] data provider (uses default if nil)
302
- # # @param type [Symbol] plural rule type, either +:cardinal+ or +:ordinal+
302
+ # # @param type [Symbol] plural rule type, either `:cardinal` or `:ordinal`
303
303
  # # @return [PluralRules] a new instance
304
304
  # # @raise [DataError] if data for the locale is unavailable
305
305
  # #
@@ -312,7 +312,7 @@
312
312
  # # Selects the plural category for a number.
313
313
  # #
314
314
  # # @param number [Integer, Float] the number to categorize
315
- # # @return [Symbol] one of +:zero+, +:one+, +:two+, +:few+, +:many+, or +:other+
315
+ # # @return [Symbol] one of `:zero`, `:one`, `:two`, `:few`, `:many`, or `:other`
316
316
  # #
317
317
  # # @example
318
318
  # # rules.select(0) #=> :other (in English)
@@ -334,8 +334,8 @@
334
334
  # # Returns the resolved options for this instance.
335
335
  # #
336
336
  # # @return [Hash] options hash with keys:
337
- # # - +:locale+ [String] the resolved locale identifier
338
- # # - +:type+ [Symbol] the plural rule type (+:cardinal+ or +:ordinal+)
337
+ # # - `:locale` [String] the resolved locale identifier
338
+ # # - `:type` [Symbol] the plural rule type (`:cardinal` or `:ordinal`)
339
339
  # #
340
340
  # def resolved_options; end
341
341
  # end
@@ -362,8 +362,8 @@
362
362
  # #
363
363
  # # @param locale [Locale] the locale for formatting
364
364
  # # @param provider [DataProvider, nil] data provider (uses default if nil)
365
- # # @param style [Symbol] format style: +:decimal+, +:percent+, or +:currency+
366
- # # @param currency [String, nil] ISO 4217 currency code (required for +:currency+ style)
365
+ # # @param style [Symbol] format style: `:decimal`, `:percent`, or `:currency`
366
+ # # @param currency [String, nil] ISO 4217 currency code (required for `:currency` style)
367
367
  # # @param use_grouping [Boolean] whether to use grouping separators
368
368
  # # @param minimum_integer_digits [Integer, nil] minimum number of integer digits
369
369
  # # @param minimum_fraction_digits [Integer, nil] minimum number of fraction digits
@@ -393,14 +393,14 @@
393
393
  # # Returns the resolved options for this instance.
394
394
  # #
395
395
  # # @return [Hash] options hash with keys:
396
- # # - +:locale+ [String] the resolved locale identifier
397
- # # - +:style+ [Symbol] the format style
398
- # # - +:use_grouping+ [Boolean] whether grouping is enabled
399
- # # - +:currency+ [String] currency code (if applicable)
400
- # # - +:minimum_integer_digits+ [Integer] minimum integer digits
401
- # # - +:minimum_fraction_digits+ [Integer] minimum fraction digits
402
- # # - +:maximum_fraction_digits+ [Integer] maximum fraction digits
403
- # # - +:rounding_mode+ [Symbol] the rounding mode
396
+ # # - `:locale` [String] the resolved locale identifier
397
+ # # - `:style` [Symbol] the format style
398
+ # # - `:use_grouping` [Boolean] whether grouping is enabled
399
+ # # - `:currency` [String] currency code (if applicable)
400
+ # # - `:minimum_integer_digits` [Integer] minimum integer digits
401
+ # # - `:minimum_fraction_digits` [Integer] minimum fraction digits
402
+ # # - `:maximum_fraction_digits` [Integer] maximum fraction digits
403
+ # # - `:rounding_mode` [Symbol] the rounding mode
404
404
  # #
405
405
  # def resolved_options; end
406
406
  # end
@@ -426,8 +426,8 @@
426
426
  # #
427
427
  # # @param locale [Locale] the locale for formatting
428
428
  # # @param provider [DataProvider, nil] data provider (uses default if nil)
429
- # # @param date_style [Symbol, nil] date format style: +:full+, +:long+, +:medium+, or +:short+
430
- # # @param time_style [Symbol, nil] time format style: +:full+, +:long+, +:medium+, or +:short+
429
+ # # @param date_style [Symbol, nil] date format style: `:full`, `:long`, `:medium`, or `:short`
430
+ # # @param time_style [Symbol, nil] time format style: `:full`, `:long`, `:medium`, or `:short`
431
431
  # # @param time_zone [String, nil] IANA time zone identifier (e.g., "America/New_York")
432
432
  # # @param calendar [Symbol] calendar system to use
433
433
  # # @return [DateTimeFormat] a new instance
@@ -441,7 +441,7 @@
441
441
  #
442
442
  # # Formats a time value according to the configured options.
443
443
  # #
444
- # # @param time [Time] the time to format
444
+ # # @param time [Time, #to_time] the time to format (or any object responding to #to_time)
445
445
  # # @return [String] the formatted date/time string
446
446
  # #
447
447
  # def format(time); end
@@ -449,11 +449,11 @@
449
449
  # # Returns the resolved options for this instance.
450
450
  # #
451
451
  # # @return [Hash] options hash with keys:
452
- # # - +:locale+ [String] the resolved locale identifier
453
- # # - +:calendar+ [Symbol] the calendar system
454
- # # - +:date_style+ [Symbol] the date style (if set)
455
- # # - +:time_style+ [Symbol] the time style (if set)
456
- # # - +:time_zone+ [String] the time zone (if set)
452
+ # # - `:locale` [String] the resolved locale identifier
453
+ # # - `:calendar` [Symbol] the calendar system
454
+ # # - `:date_style` [Symbol] the date style (if set)
455
+ # # - `:time_style` [Symbol] the time style (if set)
456
+ # # - `:time_zone` [String] the time zone (if set)
457
457
  # #
458
458
  # def resolved_options; end
459
459
  # end
@@ -475,8 +475,8 @@
475
475
  # #
476
476
  # # @param locale [Locale] the locale for formatting
477
477
  # # @param provider [DataProvider, nil] data provider (uses default if nil)
478
- # # @param style [Symbol] format style: +:long+, +:short+, or +:narrow+
479
- # # @param numeric [Symbol] numeric display: +:always+ or +:auto+
478
+ # # @param style [Symbol] format style: `:long`, `:short`, or `:narrow`
479
+ # # @param numeric [Symbol] numeric display: `:always` or `:auto`
480
480
  # # @return [RelativeTimeFormat] a new instance
481
481
  # # @raise [DataError] if data for the locale is unavailable
482
482
  # #
@@ -485,8 +485,8 @@
485
485
  # # Formats a relative time value.
486
486
  # #
487
487
  # # @param value [Integer] the relative time value (negative for past, positive for future)
488
- # # @param unit [Symbol] time unit: +:second+, +:minute+, +:hour+, +:day+,
489
- # # +:week+, +:month+, +:quarter+, or +:year+
488
+ # # @param unit [Symbol] time unit: `:second`, `:minute`, `:hour`, `:day`,
489
+ # # `:week`, `:month`, `:quarter`, or `:year`
490
490
  # # @return [String] the formatted relative time string
491
491
  # #
492
492
  # # @example
@@ -498,9 +498,9 @@
498
498
  # # Returns the resolved options for this instance.
499
499
  # #
500
500
  # # @return [Hash] options hash with keys:
501
- # # - +:locale+ [String] the resolved locale identifier
502
- # # - +:style+ [Symbol] the format style
503
- # # - +:numeric+ [Symbol] the numeric display mode
501
+ # # - `:locale` [String] the resolved locale identifier
502
+ # # - `:style` [Symbol] the format style
503
+ # # - `:numeric` [Symbol] the numeric display mode
504
504
  # #
505
505
  # def resolved_options; end
506
506
  # end
@@ -524,8 +524,8 @@
524
524
  # #
525
525
  # # @param locale [Locale] the locale for formatting
526
526
  # # @param provider [DataProvider, nil] data provider (uses default if nil)
527
- # # @param type [Symbol] list type: +:conjunction+, +:disjunction+, or +:unit+
528
- # # @param style [Symbol] format style: +:long+, +:short+, or +:narrow+
527
+ # # @param type [Symbol] list type: `:conjunction`, `:disjunction`, or `:unit`
528
+ # # @param style [Symbol] format style: `:long`, `:short`, or `:narrow`
529
529
  # # @return [ListFormat] a new instance
530
530
  # # @raise [DataError] if data for the locale is unavailable
531
531
  # #
@@ -541,9 +541,9 @@
541
541
  # # Returns the resolved options for this instance.
542
542
  # #
543
543
  # # @return [Hash] options hash with keys:
544
- # # - +:locale+ [String] the resolved locale identifier
545
- # # - +:type+ [Symbol] the list type
546
- # # - +:style+ [Symbol] the format style
544
+ # # - `:locale` [String] the resolved locale identifier
545
+ # # - `:type` [Symbol] the list type
546
+ # # - `:style` [Symbol] the format style
547
547
  # #
548
548
  # def resolved_options; end
549
549
  # end
@@ -572,9 +572,9 @@
572
572
  # # @param locale [Locale] the locale for collation rules
573
573
  # # @param provider [DataProvider, nil] data provider (uses default if nil)
574
574
  # # @param sensitivity [Symbol] comparison sensitivity:
575
- # # +:base+, +:accent+, +:case+, or +:variant+
575
+ # # `:base`, `:accent`, `:case`, or `:variant`
576
576
  # # @param numeric [Boolean] whether to compare numeric strings as numbers
577
- # # @param case_first [Symbol, nil] which case to sort first: +:upper+ or +:lower+
577
+ # # @param case_first [Symbol, nil] which case to sort first: `:upper` or `:lower`
578
578
  # # @return [Collator] a new instance
579
579
  # # @raise [DataError] if data for the locale is unavailable
580
580
  # #
@@ -592,10 +592,10 @@
592
592
  # # Returns the resolved options for this instance.
593
593
  # #
594
594
  # # @return [Hash] options hash with keys:
595
- # # - +:locale+ [String] the resolved locale identifier
596
- # # - +:sensitivity+ [Symbol] the comparison sensitivity
597
- # # - +:numeric+ [Boolean] whether numeric sorting is enabled
598
- # # - +:case_first+ [Symbol] which case sorts first (if set)
595
+ # # - `:locale` [String] the resolved locale identifier
596
+ # # - `:sensitivity` [Symbol] the comparison sensitivity
597
+ # # - `:numeric` [Boolean] whether numeric sorting is enabled
598
+ # # - `:case_first` [Symbol] which case sorts first (if set)
599
599
  # #
600
600
  # def resolved_options; end
601
601
  # end
@@ -617,9 +617,9 @@
617
617
  # #
618
618
  # # @param locale [Locale] the locale for display names
619
619
  # # @param provider [DataProvider, nil] data provider (uses default if nil)
620
- # # @param type [Symbol] display name type: +:language+, +:region+, +:script+, or +:locale+
621
- # # @param style [Symbol] display style: +:long+, +:short+, or +:narrow+
622
- # # @param fallback [Symbol] fallback behavior: +:code+ or +:none+
620
+ # # @param type [Symbol] display name type: `:language`, `:region`, `:script`, or `:locale`
621
+ # # @param style [Symbol] display style: `:long`, `:short`, or `:narrow`
622
+ # # @param fallback [Symbol] fallback behavior: `:code` or `:none`
623
623
  # # @return [DisplayNames] a new instance
624
624
  # # @raise [DataError] if data for the locale is unavailable
625
625
  # #
@@ -629,7 +629,7 @@
629
629
  # #
630
630
  # # @param code [String] the code to look up (language, region, script, or locale)
631
631
  # # @return [String, nil] the localized display name, or nil if not found
632
- # # (when fallback is +:none+)
632
+ # # (when fallback is `:none`)
633
633
  # #
634
634
  # # @example
635
635
  # # names.of("ja") #=> "Japanese"
@@ -641,10 +641,10 @@
641
641
  # # Returns the resolved options for this instance.
642
642
  # #
643
643
  # # @return [Hash] options hash with keys:
644
- # # - +:locale+ [String] the resolved locale identifier
645
- # # - +:type+ [Symbol] the display name type
646
- # # - +:style+ [Symbol] the display style
647
- # # - +:fallback+ [Symbol] the fallback behavior
644
+ # # - `:locale` [String] the resolved locale identifier
645
+ # # - `:type` [Symbol] the display name type
646
+ # # - `:style` [Symbol] the display style
647
+ # # - `:fallback` [Symbol] the fallback behavior
648
648
  # #
649
649
  # def resolved_options; end
650
650
  # end
@@ -687,7 +687,7 @@
687
687
  # # Creates a new Segmenter instance.
688
688
  # #
689
689
  # # @param granularity [Symbol] segmentation granularity:
690
- # # +:grapheme+, +:word+, +:sentence+, or +:line+
690
+ # # `:grapheme`, `:word`, `:sentence`, or `:line`
691
691
  # # @param provider [DataProvider, nil] data provider (uses default if nil)
692
692
  # # @return [Segmenter] a new instance
693
693
  # # @raise [DataError] if data is unavailable
@@ -714,7 +714,7 @@
714
714
  # # Returns the resolved options for this instance.
715
715
  # #
716
716
  # # @return [Hash] options hash with keys:
717
- # # - +:granularity+ [Symbol] the segmentation granularity
717
+ # # - `:granularity` [Symbol] the segmentation granularity
718
718
  # #
719
719
  # def resolved_options; end
720
720
  # end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icu4x
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OZAWA Sakuro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-02 00:00:00.000000000 Z
11
+ date: 2026-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -38,7 +38,10 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.9'
41
- description: icu4x
41
+ description: |-
42
+ ICU4X provides Ruby bindings for the ICU4X library, offering Unicode
43
+ internationalization support including locale handling, number formatting,
44
+ date/time formatting, collation, segmentation, and more.
42
45
  email:
43
46
  - 10973+sakuro@users.noreply.github.com
44
47
  executables: []
@@ -100,5 +103,5 @@ requirements: []
100
103
  rubygems_version: 3.4.19
101
104
  signing_key:
102
105
  specification_version: 4
103
- summary: icu4x
106
+ summary: Ruby bindings for ICU4X Unicode internationalization library
104
107
  test_files: []