Added Controller Generator and tests to go along with it.

This commit is contained in:
Matthew Burket
2011-05-30 23:07:20 -05:00
parent 97659a1193
commit 4f446241a4
3 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
require 'tmpdir'
module Devise
module Generators
class ControllersGenerator < Rails::Generators::Base
source_root File.expand_path("../../../../app/controllers", __FILE__)
desc "Copies all Devise controllers to your application."
argument :scope, :required => false, :default => nil,
:desc => "The scope to copy controllers to"
def copy_controllers
directory "devise", "app/controllers/#{scope || :devise}"
end
end
end
end