lib/sorbet-schema.rb in sorbet-schema-0.4.2 vs lib/sorbet-schema.rb in sorbet-schema-0.5.1
- old
+ new
@@ -8,19 +8,25 @@
# We can't use `Loader.for_gem` here as we've unconventionally named the root file.
require "zeitwerk"
loader = Zeitwerk::Loader.new
loader.push_dir(__dir__.to_s)
loader.ignore(__FILE__)
-loader.ignore("#{__dir__}/sorbet-schema/*.rb")
+loader.ignore("#{__dir__}/sorbet-schema/**/*.rb")
loader.inflector.inflect(
"json_serializer" => "JSONSerializer"
)
loader.setup
# We don't want to place this in the `Typed` module.
# `sorbet-schema` is a directory that is not autoloaded
# but contains extensions, so we need to manually require it.
require_relative "sorbet-schema/hash_transformer"
+
+# We want to add a default `schema` method to structs
+# that will guarentee a schema can be created for use
+# with serialization. This can (and should) be overridden
+# in child struct classes.
+require_relative "sorbet-schema/t/struct"
# Sorbet-aware namespace to super-charge your projects
module Typed
Value = T.type_alias { T.untyped }
end