Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby bindings RFE: libdnf5 modules and classes should be namespaced. #1779

Open
jackorp opened this issue Oct 17, 2024 · 0 comments
Open

Ruby bindings RFE: libdnf5 modules and classes should be namespaced. #1779

jackorp opened this issue Oct 17, 2024 · 0 comments

Comments

@jackorp
Copy link

jackorp commented Oct 17, 2024

While not necessarily a problem, the current lack of namespacing in Ruby does not seem too great to me.

For example Common module is a global constant upon requiring libdnf5/common. I think having a prefix so that it becomes for example LibDNF5::Common (or Libdnf5::Common, or other variations of capitalization) would be better.

I'd apply this to all modules present, but names such as Logger, Common, or Base are IMO more probably to have a clash in other projects than for example Rpm.

There could be a small problem with compatibility, but if LibDNF5 is a module only used for namespacing (with no additional/new methods on it), then it can be included in the global namespace guilt-free:

require 'libdnf5/base'
include LibDNF5

base = Base::Base.new()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant