Ruby on Rails generators with new gemified plugin?

191 views Asked by At

I'm attempting to create a new Rails 3 plugin gem which wraps around devise/devise_ldap_authenticatable for reusable drop in internal LDAP support.

I create the new plugin gem with:

rails plugin new <gem_name>

I then add the devise/devise_ldap_authenticatable gems to the .gemspec file and run bundle

In the devise instructions it says to generate the required files using its generators:

rails generate devise:install 
rails generate devise MODEL

However, in the directory where the plugin is generated I don't seem to be able to run rails generate. Most gem plugin tutorials instruct you to just create the files manually. Am I better off starting a new rails project, following the instructions in the temp project, then copying the files over to the plugin manually? Is there something that I'm missing? Can I run the generator script from the dummy instance? What is the standard practice in this use case?

1

There are 1 answers

0
azurewraith On BEST ANSWER

In the end, I opted to forgo wrapping devise_ldap_authenticatable due to its relative simplicity.

The answer that I would go with in the future is to just to move files from a throwaway project.