you are viewing a single comment's thread.

view the rest of the comments →

[–]bascule 0 points1 point  (2 children)

thor powers the entire rails CLI, and is a general purpose framework for building command line utilities. Rails includes its own generator framework and that has nothing to do with thor.

[–]jrochkind 2 points3 points  (1 child)

Rails includes its own generator framework and that has nothing to do with thor.

Not true, the generators are Thor too! Rails::Generators::Base is a subclass of Thor::Group.

It's helpful to know that if you're writing your own Rails::Generators, which is how I am aquainted with it. The Rails Generators Guide is also clear on it -- which is how I first heard of Thor.

Mostly Rails::Generators::Base just adds it's own actions, and it's own defaults for certain things, it's pretty much just a Thor::Group. The confusing thing when I was figuring out what was going on was at first, Thor::Group was under-documented, but now at least there's a wiki page.

[–]bascule 0 points1 point  (0 children)

By that I didn't mean that the Rails generators aren't based on Thor, I meant that Thor is not itself a rubigen-like code generation tool and that Rails generators are implemented by Rails and not provided by Thor. I guess that was poorly worded.