From 43f3d34c4636cc46097826c3175af78928494960 Mon Sep 17 00:00:00 2001 From: Peter Bouda Date: Wed, 9 Oct 2024 12:26:05 +0100 Subject: [PATCH] DEV: Clean up of code --- config/routes.rb | 14 -------------- .../engine.rb | 4 ++-- plugin.rb | 8 ++++---- 3 files changed, 6 insertions(+), 20 deletions(-) rename lib/{discourse_scim_plugin => discourse_scim}/engine.rb (59%) diff --git a/config/routes.rb b/config/routes.rb index c4209e1..6e1dc58 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,22 +2,8 @@ require "scimitar" -# DiscourseScimPlugin::Engine.routes.draw do -# get "/list" => "scim#index" -# end - -# Discourse::Application.routes.draw { mount ::DiscourseScimPlugin::Engine, at: "/scim" } Discourse::Application.routes.draw { namespace :scim_v2 do - # DiscourseScimPlugin::Engine.routes.draw do - # get 'Users', to: 'users#index' - # get 'Users/:id', to: 'users#show' - # post 'Users', to: 'users#create' - # put 'Users/:id', to: 'users#replace' - # patch 'Users/:id', to: 'users#update' - # delete 'Users/:id', to: 'users#destroy' - # end - mount Scimitar::Engine, at: '/' get 'Users', to: 'users#index' diff --git a/lib/discourse_scim_plugin/engine.rb b/lib/discourse_scim/engine.rb similarity index 59% rename from lib/discourse_scim_plugin/engine.rb rename to lib/discourse_scim/engine.rb index d9b805e..69f953a 100644 --- a/lib/discourse_scim_plugin/engine.rb +++ b/lib/discourse_scim/engine.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -module DiscourseScimPlugin +module DiscourseScim class Engine < ::Rails::Engine engine_name PLUGIN_NAME - isolate_namespace DiscourseScimPlugin + isolate_namespace DiscourseScim end end \ No newline at end of file diff --git a/plugin.rb b/plugin.rb index 32352b4..6e84bb4 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true -# name: discourse-scim-plugin +# name: discourse-scim # about: A plugin to add SCIM endpoints to discourse # version: 0.0.1 # authors: Peter Bouda -# url: https://github.com/pbouda/discourse-scim-plugin +# url: https://forge.libre.sh/libre.sh/discourse-scim gem 'marcel', '1.0.0', {require: false } gem 'activestorage', '7.1.4', {require: false } @@ -32,10 +32,10 @@ add_api_key_scope( }, ) -module ::DiscourseScimPlugin +module ::DiscourseScim PLUGIN_NAME = "scim" - require_relative "lib/discourse_scim_plugin/engine" + require_relative "lib/discourse_scim/engine" end after_initialize do