diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-23 21:07:12 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-25 10:39:43 +0200 |
commit | ccd26575d12301816b11bdb22847e10173bd3ea2 (patch) | |
tree | d3788cabc281280f96461229004caa4c18242071 | |
parent | b72d9667070521f2b40a3b307d7e5c7c66f83385 (diff) | |
download | rails-ccd26575d12301816b11bdb22847e10173bd3ea2.tar.gz rails-ccd26575d12301816b11bdb22847e10173bd3ea2.tar.bz2 rails-ccd26575d12301816b11bdb22847e10173bd3ea2.zip |
Clean up plugin generator.
-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' |