Module/class namespace vs "bundle gem"?

92 views
Skip to first unread message

Erik Terpstra

unread,
Oct 10, 2014, 8:52:28 AM10/10/14
to ruby-b...@googlegroups.com
Perhaps a silly question, but I am wondering how others deal with creating gems using "bundle gem".

Say I have a product called "Fooble", and I want different classes that deal with this product built as separate gems.
For example a class called "Configuration" that provides methods dealing with configuring the "Fooble" product.

In my opinion it would make sense to have a gem that makes a "Fooble::Configuration" class available.
When I do a "bundle gem fooble-configuration" however it results in a module "Fooble" containing a module "Configuration".

Does it make sense that Configuration is generated as a module by default? What other options do I have that would lead to the desired scaffold?

Cheers,

Erik.

André Arko

unread,
Oct 10, 2014, 12:11:57 PM10/10/14
to ruby-b...@googlegroups.com
I believe the general expectation is that:

1) If Fooble::Configuration is a class, it will be provided by the ‘fooble’ gem
2) If a gem is named ‘fooble-configuration’, it will be an extension that adds ‘configuration’ to ‘fooble’.

If that’s wrong, you can always just change the word “module” to the word “class” the two places that Bundler creates it. :)

--
You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-bundler...@googlegroups.com.
To post to this group, send email to ruby-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-bundler.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages