bjeanes / ghost

Create, list, delete, and modify /etc/hosts entries with ease...
MIT License
732 stars 44 forks source link

"Host" is a collision-prone class name #11

Closed skade closed 12 years ago

skade commented 13 years ago

The toplevel constant Host is a collision-prone class name. For example, one collision happens when trying to use Ghost together with vagrant.

Would it be possible to change this to Ghost::Host or something similar?

leehambley commented 13 years ago

+1 I've noticed this, shouldn't hurt too much to change this as Ghost doesn't really have a public code API to speak of.

skade commented 13 years ago

Well, considering that the README says that Ghost can be used as a library, i'd assume it had some public API :). If the project maintainers don't mind, I would invest some work into making Ghost a better library. I found some other issues as well (for example, raising of RuntimeExceptions).

bjeanes commented 13 years ago

@skade, I have no problem renaming that class at all. Perhaps Ghost::Host is a little safer. This library has a lot of issues as it was written a while ago :). If I was properly motivated I'd do it in a very different way this time.

Feel free to send a pull request to change the host and I'll happily release a new gem version. I won't get to changing this host soon which means I'll likely forget.

skade commented 13 years ago

@bjeanes Thank you, I am already hacking a bit on my train rides.

You can expect something proper over the weekend.

bjeanes commented 13 years ago

I had a quick look over your better_lib branch – it's looking pretty awesome. If I'm at my computer tonight, I'll pull it down and see if it's complete and working and then merge it in.

skade commented 13 years ago

Thanks for looking :). It should be 'pretty stable', but I had to drop it for a few days due to a lot of work coming in. Also, I will be on holiday for the next 1 1/2 week, so I wont be able to respond to questions - ask them anyways :).

bjeanes commented 13 years ago

Any update with that fork? I just remembered about this now...