How do I make my generator discoverable by Rails?
When I'm creating a gem, how do I make the generator discoverable by Rails?
I have a generators directory with my generator inside. I symlinked it from ~/.rails/generators and it worked fine, but when I install the gem, even though the generators directory is installed, Rails doe开发者_运维技巧sn't find it.
There's nothing special to be done. Just having generators/blah/blah_generator.rb with a BlahGenerator class inside was enough. I was missing the "_generator" in the filename.
精彩评论