diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-11-14 19:04:17 -0600 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-16 00:04:34 +0100 |
commit | 73443329de6817b32ea0fa65889056c146181bca (patch) | |
tree | 8844b5fcd87dff50e5572d7d129c62c7714554d6 | |
parent | d988fa820a0131b7ca44f503b60581ab8df080e1 (diff) | |
download | rails-73443329de6817b32ea0fa65889056c146181bca.tar.gz rails-73443329de6817b32ea0fa65889056c146181bca.tar.bz2 rails-73443329de6817b32ea0fa65889056c146181bca.zip |
Add skip-gemspec option to 'plugin new' generator
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb | 17 | ||||
-rw-r--r-- | railties/test/generators/plugin_new_generator_test.rb | 5 |
2 files changed, 15 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb index 8fac6fc70a..9c54b98238 100644 --- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb @@ -102,14 +102,17 @@ task :default => :test alias_method :plugin_path, :app_path - class_option :dummy_path, :type => :string, :default => "test/dummy", - :desc => "Create dummy application at given path" + class_option :dummy_path, :type => :string, :default => "test/dummy", + :desc => "Create dummy application at given path" - class_option :full, :type => :boolean, :default => false, - :desc => "Generate rails engine with integration tests" + class_option :full, :type => :boolean, :default => false, + :desc => "Generate rails engine with integration tests" - class_option :mountable, :type => :boolean, :default => false, - :desc => "Generate mountable isolated application" + class_option :mountable, :type => :boolean, :default => false, + :desc => "Generate mountable isolated application" + + class_option :skip_gemspec, :type => :boolean, :default => false, + :desc => "Skip gemspec file" def initialize(*args) raise Error, "Options should be given after the plugin name. For details run: rails plugin --help" if args[0].blank? @@ -122,7 +125,7 @@ task :default => :test def create_root_files build(:readme) build(:rakefile) - build(:gemspec) + build(:gemspec) unless options[:skip_gemspec] build(:license) build(:gitignore) unless options[:skip_git] build(:gemfile) unless options[:skip_gemfile] diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index 12cae7cfdf..43d7523a4c 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -146,6 +146,11 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_no_file "test/dummy" end + def test_skipping_gemspec + run_generator [destination_root, "--skip-gemspec"] + assert_no_file "bukkits.gemspec" + end + protected def action(*args, &block) |