teptris 0.2.48-aarch64-linux → 0.2.50-aarch64-linux

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: 4c13286a4805125edcdc92b50cb8b8f5779ac095224b2a5ff29e6f94b44ce816
4
- data.tar.gz: d999f6a95f89cd4cf39741fe21053427142846d38c5b7c9110aaf5f60cabc5f4
3
+ metadata.gz: 0e5ebd0a7b78b005d11e3a251e712f1ec6be374dd8b6209d43df2adbefb44a63
4
+ data.tar.gz: f34d335e1ec8bf60fa129e213aa37cd112182b10b97fb31d5a5bf000892e863a
5
5
  SHA512:
6
- metadata.gz: bd6bcb5b21b6603984e3efd2bd63f05e668aa233594682a71b19c2fca3782b373509559c103bb3ed8052501f24f5c5c3c250ec19669f051f1b18d3f0e804a79d
7
- data.tar.gz: c9fba8a71b3cd33a9a05d1efe1edb336cb470346b527d3c5c3a2bc92d33021dbc30d1d16a550dc09dd81ec286271b4cb2adc6e711a8d0db74b5cc5fce42afec1
6
+ metadata.gz: 7dfbf42859c3b22b5da613ad6a297501615b01666c2281aab6745f11b05ee2b222212eddd015e27c8575cfdf0688236822270d4a15897c980fffbd8a01bc36a2
7
+ data.tar.gz: 6efb9201f3197c37fc9361a7323c296f26df8d10eafcb362b49578e28ca0cbc3f4f604ce8420f2aee2afb744c1dedce99e1554b20a2c3729da1789887e68ffd0
@@ -41,11 +41,16 @@ static VALUE time_from_dt(const teptris_datetime *d, bool has_offset) {
41
41
  }
42
42
  return rb_time_num_new(num, INT2FIX(d->offset_seconds));
43
43
  }
44
+ /* whole seconds skip the Rational: Time.local normalizes
45
+ * Rational(s * 1e9, 1e9) to exactly s, so an Integer is the same
46
+ * result without the allocation or the rational path */
47
+ VALUE sec = (d->nanosecond != 0)
48
+ ? rb_Rational(LL2NUM((int64_t)d->second * 1000000000 +
49
+ d->nanosecond),
50
+ LL2NUM(1000000000))
51
+ : INT2FIX(d->second);
44
52
  VALUE args[6] = {INT2FIX(d->year), INT2FIX(d->month), INT2FIX(d->day),
45
- INT2FIX(d->hour), INT2FIX(d->minute),
46
- rb_Rational(LL2NUM((int64_t)d->second * 1000000000 +
47
- d->nanosecond),
48
- LL2NUM(1000000000))};
53
+ INT2FIX(d->hour), INT2FIX(d->minute), sec};
49
54
  return rb_funcallv(rb_cTime, rb_intern("local"), 6, args);
50
55
  }
51
56
 
@@ -173,7 +178,12 @@ static VALUE obj_from_node(const teptris_node *n, unsigned flags,
173
178
  switch (teptris_node_kind(n)) {
174
179
  case TEPTRIS_TABLE: {
175
180
  size_t len = teptris_node_table_length(n);
181
+ #if RUBY_API_VERSION_MAJOR > 3 || \
182
+ (RUBY_API_VERSION_MAJOR == 3 && RUBY_API_VERSION_MINOR >= 2)
183
+ VALUE h = rb_hash_new_capa((long)len);
184
+ #else
176
185
  VALUE h = rb_hash_new();
186
+ #endif
177
187
  for (size_t i = 0; i < len; i++) {
178
188
  teptris_view key;
179
189
  const teptris_node *v = teptris_node_table_at(n, i, &key);
Binary file
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  module Teptris
2
- VERSION = "0.2.48"
2
+ VERSION = "0.2.50"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.48
4
+ version: 0.2.50
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - teptris contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-26 00:00:00.000000000 Z
11
+ date: 2026-09-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A native C extension over libteptris, a C99 TOML 1.1 parser/emitter.
14
14
  API shape mirrors the tomlib gem.