Permalink
Browse files

Add skip-gemspec option to 'plugin new' generator

  • Loading branch information...
drogus authored and josevalim committed Nov 15, 2010
1 parent d988fa8 commit 73443329de6817b32ea0fa65889056c146181bca
@@ -102,14 +102,17 @@ class PluginNewGenerator < AppBase
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 @@ def initialize(*args)
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]
@@ -146,6 +146,11 @@ def test_passing_dummy_path_as_a_parameter
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)

0 comments on commit 7344332

Please sign in to comment.