diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2015-07-23 17:48:47 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2015-07-23 18:13:00 +0200 |
commit | 9a7f011da196f93cec285a6227ad9499434da4d1 (patch) | |
tree | baee22aadf9a90a66deba85db38528603b303538 /railties/lib/rails | |
parent | 2028b57bf3cd1f6384b8fbed12689f73283caf43 (diff) | |
download | rails-9a7f011da196f93cec285a6227ad9499434da4d1.tar.gz rails-9a7f011da196f93cec285a6227ad9499434da4d1.tar.bz2 rails-9a7f011da196f93cec285a6227ad9499434da4d1.zip |
Add the `--api` option for the plugin generator
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index 66111004aa..84f67069c6 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -176,6 +176,9 @@ task default: :test desc: "If creating plugin in application's directory " + "skip adding entry to Gemfile" + class_option :api, type: :boolean, default: false, + desc: "Generate a smaller stack for API application plugins" + def initialize(*args) @dummy_path = nil super @@ -305,6 +308,10 @@ task default: :test options[:skip_test].blank? || options[:dummy_path] != 'test/dummy' end + def api? + options[:api] + end + def self.banner "rails plugin new #{self.arguments.map(&:usage).join(' ')} [options]" end |