discourse/lib/generators/plugin/templates/plugin.rb.erb
Joffrey JAFFEUX d40d241e72
DEV: adds --help --no-help options to plugin generator (#6338)
help will add helpful comments in the various generated files
2018-08-30 12:16:37 +02:00

31 lines
769 B
Plaintext

# name: <%= name %>
# about:
# version: 0.1
# authors: <%= @github_username %>
# url: https://github.com/<%= @github_username %>
<% if @options["stylesheet"] %>
register_asset "stylesheets/common/<%= dasherized_name %>.scss"
<% end %>
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
isolate_namespace <%= classified_name %>
end
end
<% if @options["scheduled_job"] %>
require File.expand_path("../jobs/scheduled/check_<%= underscored_name %>.rb", __FILE__)
<% end %>
end