Warn when generator cannot load #7606

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@schneems
Ruby on Rails member

[close #6217] If a generator has an error we should display that error rather than swallowing it while allowing other generator sot be listed. This is useful while developing a generator.

ATP Railties

@schneems schneems [close #6217] Warn when generator cannot load
If a generator has an error we should display that error rather than swallowing it while allowing other generator sot be listed. This is useful while developing a generator.
b1393a7
@steveklabnik
Ruby on Rails member

"Fixes #6217" will make it close the issue... maybe that syntax will too?

@schneems
Ruby on Rails member

both should be valid https://github.com/blog/831-issues-2-0-the-next-generation the square brackets shouldn't get in the way, though I don't have contrib so the linked issue still needs to be closed manually (i think).

@steveklabnik
Ruby on Rails member

TIL.

It will get closed if and when this merges, your status is irrelevant. :)

@josevalim
Ruby on Rails member

I think we were used to have a warning there but people are used to put non-rails generator stuff inside generators directory and then a bunch of irrelevant warnings appeared. That said, I am not sure if we should merge this. After all, we will be iterating the lib/generators directory of all gems and there is nothing forbidding them to put random stuff in there. I am aware of the trade-off, but at least you can get the proper exception by trying to run it.

@schneems
Ruby on Rails member

I ran this before submitting on a few production projects with ~50 gems in them, and didn't have any with exceptions listing generators. That being said I'm not familiar with prior issues regarding exceptions and generators, and you seem to have written a majority of the code around this feature. If we removed the backtrace from the warning, it would reduce the noise of accidental errors in generators, either that or we should close both issues. What do you think?

@schneems
Ruby on Rails member

ping. Close or take out the backtrace?

@schneems
Ruby on Rails member

Let's close this issue and close #7606 as not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment