lib/grumlin.rb in grumlin-1.0.0.rc1 vs lib/grumlin.rb in grumlin-1.0.0.rc2

- old
+ new

@@ -182,9 +182,22 @@ end def definitions @definitions ||= YAML.safe_load(File.read(File.join(__dir__, "definitions.yml")), symbolize_names: true) end + + def fake_uuid(*parts, separator: "->") + uuid = Digest::MD5.hexdigest(parts.join(separator)) + + segments = [8, 4, 4, 4, 12] + parts = segments.map do |n| + uuid[0...n].tap do + uuid = uuid[n..] + end + end + + parts.join("-") + end end end loader.setup loader.eager_load