diff --git a/README.md b/README.md index b0dc1c0..cf677ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# **Plugin Name** Plugin +# **Hledger** Plugin **Plugin Summary** diff --git a/app/controllers/my_plugin_module/examples_controller.rb b/app/controllers/hledger/examples_controller.rb similarity index 88% rename from app/controllers/my_plugin_module/examples_controller.rb rename to app/controllers/hledger/examples_controller.rb index 9ca421b..4a00d88 100644 --- a/app/controllers/my_plugin_module/examples_controller.rb +++ b/app/controllers/hledger/examples_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module ::MyPluginModule +module ::Hledger class ExamplesController < ::ApplicationController requires_plugin PLUGIN_NAME diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index e68cda5..b70743a 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -3,7 +3,7 @@ en: admin: site_settings: categories: - TODO_plugin_name: "Plugin Name" + hledger: "Hledger" js: - discourse_plugin_name: + hledger: placeholder: placeholder diff --git a/config/routes.rb b/config/routes.rb index 25a67c9..5209339 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -MyPluginModule::Engine.routes.draw do +Hledger::Engine.routes.draw do get "/examples" => "examples#index" # define routes here end -Discourse::Application.routes.draw { mount ::MyPluginModule::Engine, at: "my-plugin" } +Discourse::Application.routes.draw { mount ::Hledger::Engine, at: "hledger" } diff --git a/config/settings.yml b/config/settings.yml index b9bac20..7e7d9dc 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -1,4 +1,4 @@ -TODO_plugin_name: - plugin_name_enabled: +hledger: + hledger_enabled: default: false client: true diff --git a/lib/my_plugin_module/engine.rb b/lib/hledger/engine.rb similarity index 85% rename from lib/my_plugin_module/engine.rb rename to lib/hledger/engine.rb index 9b5710c..814edea 100644 --- a/lib/my_plugin_module/engine.rb +++ b/lib/hledger/engine.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -module ::MyPluginModule +module ::Hledger class Engine < ::Rails::Engine engine_name PLUGIN_NAME - isolate_namespace MyPluginModule + isolate_namespace Hledger config.autoload_paths << File.join(config.root, "lib") scheduled_job_dir = "#{config.root}/app/jobs/scheduled" config.to_prepare do diff --git a/plugin.rb b/plugin.rb index fc57c6f..d5bd998 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# name: discourse-plugin-name +# name: hledger # about: TODO # meta_topic_id: TODO # version: 0.0.1 @@ -8,13 +8,13 @@ # url: TODO # required_version: 2.7.0 -enabled_site_setting :plugin_name_enabled +enabled_site_setting :hledger_enabled -module ::MyPluginModule - PLUGIN_NAME = "discourse-plugin-name" +module ::Hledger + PLUGIN_NAME = "hledger" end -require_relative "lib/my_plugin_module/engine" +require_relative "lib/hledger/engine" after_initialize do # Code which should run after Rails has finished booting