diff options
-rw-r--r-- | railties/lib/generators/rails/plugin/plugin_generator.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/railties/lib/generators/rails/plugin/plugin_generator.rb b/railties/lib/generators/rails/plugin/plugin_generator.rb index 38afb3984e..12e67bd188 100644 --- a/railties/lib/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/generators/rails/plugin/plugin_generator.rb @@ -1,14 +1,20 @@ module Rails module Generators class PluginGenerator < NamedBase + class_option :with_tasks, :type => :boolean, :aliases => "-r", :default => false, + :desc => "When supplied creates tasks base files." + + class_option :with_generator, :type => :boolean, :aliases => "-g", :default => false, + :desc => "When supplied creates generator base files." + + # TODO Check class collision + def create_root self.root = File.expand_path("vendor/plugins/#{file_name}", root) empty_directory '.' FileUtils.cd(root) end - # TODO Check class collision - def create_root_files %w(README MIT-LICENSE Rakefile init.rb install.rb uninstall.rb).each do |file| template file @@ -21,12 +27,6 @@ module Rails add_test_framework_option! - class_option :with_tasks, :type => :boolean, :aliases => "-r", :default => false, - :desc => "When supplied creates tasks base files." - - class_option :with_generator, :type => :boolean, :aliases => "-g", :default => false, - :desc => "When supplied creates generator base files." - def create_tasks_files return unless options[:with_tasks] directory 'tasks' |