damoiser / qr-bills

Ruby Gem to generate QR-Bills for Swiss payments
BSD 3-Clause "New" or "Revised" License
21 stars 15 forks source link

Namespace issues #24

Open danielpuglisi opened 2 years ago

danielpuglisi commented 2 years ago

Hey @damoiser during working on #23 I noticed two namespacing issues I would like to address:

  1. Classes are not namespaced currently. This could lead to name conflicts with base applications and other gems. Best practice would be to move classes into a QRBills module. E.g. QRGenerator becomes QRBills::QRGenerator and so forth.
  2. The css classes within the HTML layout are also not namespaced which could lead to css issues with applications that use the same class names. Best practice would be to prefix the css classes with a configurable name prefix. E.g. .subtitle becomes .qrbills__subtitle. qrbills__ could be changed to whatever the developer wishes.
damoiser commented 2 years ago

Thanks for the inputs, yes, the gem has room of improvement, will put this on the backlog and try to tackle these tasks when I will have some spare time

danielpuglisi commented 2 years ago

I can gladly put together a PR next week. Unless you want to tackle that one yourself?

damoiser commented 2 years ago

if you have time would be superb!

danielpuglisi commented 2 years ago

I do. Will tackle this after finishing #23.

The ruby class namespace changes will not be backwards compatible though. So this could be a good chance for a major release and to remove the png code that touches the filesystem. What do you think?

damoiser commented 2 years ago

good point, I would maybe wait a bit until we regroup some others breaking changes before releasing v2 of the gem

danielpuglisi commented 2 years ago

Agreed. I'll create a first PR just for the CSS namespacing as those can be backwards compatible.