DEV: adds --help --no-help options to plugin generator (#6338)

help will add helpful comments in the various generated files
This commit is contained in:
Joffrey JAFFEUX
2018-08-30 12:16:37 +02:00
committed by GitHub
parent acc96abe1a
commit d40d241e72
3 changed files with 9 additions and 0 deletions

View File

@ -1,6 +1,10 @@
import { withPluginApi } from "discourse/lib/plugin-api";
function initialize<%= classified_name %>(api) {
<% if @options['help'] %>
// see app/assets/javascripts/discourse/lib/plugin-api
// for the functions available via the api object
<% end %>
}
export default {

View File

@ -13,6 +13,10 @@ enabled_site_setting :<%= underscored_name %>_enabled
PLUGIN_NAME ||= "<%= name %>".freeze
after_initialize do
<% if @options['help'] %>
# see lib/plugin/instance.rb for the methods available in this context
<% end %>
module ::<%= classified_name %>
class Engine < ::Rails::Engine
engine_name PLUGIN_NAME