trailblazer / representable

Maps representation documents from and to Ruby objects. Includes JSON, XML and YAML support, plain properties and compositions.
http://trailblazer.to/2.1/docs/representable.html
MIT License
689 stars 108 forks source link

fix definition of dry-types gem #249

Closed and0x000 closed 3 years ago

and0x000 commented 3 years ago

as it is used in this gem, it should not be a development dependency

yogeshjain999 commented 3 years ago

@and0x000 This is an optional dependency and needed only when particular module is used.

See https://github.com/trailblazer/representable#dependencies

and0x000 commented 3 years ago

I disagree. If you don't want to install it with this gem, the code section relying on it should be moved to a separate gem. If you want to keep the code in this gem, the gem should ensure the installation of all dependencies (no matter if the code is optional to use).

Otherwise you force your gems user to handle dependencies, which I think is bad practice.

yogeshjain999 commented 3 years ago

@and0x000 sorry for the late reply.

Apparently optional dependencies are the real things and isn't supported by rubygems yet. Sometimes it's better to use them instead of creating a separate gem just for it and involving maintenance overhead (representer would need around 4-5 optional gems).

Checkout this nice blog and popular example.