Skip to content

Gem migration

Kenichi Kamiya edited this page Aug 5, 2022 · 7 revisions

How to migrate from other gems

As far as I know, major prior arts are below

It is just providing basic String generator only. So you can replace the code as below

-ULID.generate
+ULID.encode

NOTE: In version before 1.3.0, timestamps might not be correct value.

  1. Sort order does not respect millisecond ordering
  2. Fixed in this PR
  3. Released in 1.3.0

NOTE: PR for decoder exists

It is providing basic generator(except monotonic generator) and parser. Major methods can be replaced as below.

-ULID.generate
+ULID.encode
-ULID.at(time)
+ULID.encode(moment: time)
-ULID.time(string)
+ULID.decode_time(string)
-ULID.min_ulid_at(time)
+ULID.min(time).encode
-ULID.max_ulid_at(time)
+ULID.max(time).encode

NOTE: In version before 1.0.2, timestamps might not be correct value.

  1. Parsed time object has more than milliseconds
  2. Fix to handle timestamp precision in parser
  3. Fix to handle timestamp precision in generator
  4. Released in 1.0.2

See also Benchmark for comparing speeds.

Clone this wiki locally