DEV: Add `lib` to autoload path (#605)
Why manually require files when we can autoload? Also update `discourse-rubocop` to 3.8.0.
This commit is contained in:
parent
6101ecdba5
commit
10fb723995
73
Gemfile.lock
73
Gemfile.lock
|
@ -1,80 +1,83 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
activesupport (7.1.3.3)
|
activesupport (8.0.0)
|
||||||
base64
|
base64
|
||||||
|
benchmark (>= 0.3)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
||||||
connection_pool (>= 2.2.5)
|
connection_pool (>= 2.2.5)
|
||||||
drb
|
drb
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
|
logger (>= 1.4.2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
mutex_m
|
securerandom (>= 0.3)
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0, >= 2.0.5)
|
||||||
|
uri (>= 0.13.1)
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
base64 (0.2.0)
|
base64 (0.2.0)
|
||||||
|
benchmark (0.4.0)
|
||||||
bigdecimal (3.1.8)
|
bigdecimal (3.1.8)
|
||||||
concurrent-ruby (1.2.3)
|
concurrent-ruby (1.3.4)
|
||||||
connection_pool (2.4.1)
|
connection_pool (2.4.1)
|
||||||
drb (2.2.1)
|
drb (2.2.1)
|
||||||
i18n (1.14.5)
|
i18n (1.14.6)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
json (2.7.2)
|
json (2.8.2)
|
||||||
language_server-protocol (3.17.0.3)
|
language_server-protocol (3.17.0.3)
|
||||||
minitest (5.23.1)
|
logger (1.6.1)
|
||||||
mutex_m (0.2.0)
|
minitest (5.25.1)
|
||||||
parallel (1.24.0)
|
parallel (1.26.3)
|
||||||
parser (3.3.1.0)
|
parser (3.3.6.0)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
racc
|
racc
|
||||||
prettier_print (1.2.1)
|
prettier_print (1.2.1)
|
||||||
racc (1.8.0)
|
racc (1.8.1)
|
||||||
rack (3.0.11)
|
rack (3.1.8)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
regexp_parser (2.9.2)
|
regexp_parser (2.9.2)
|
||||||
rexml (3.3.9)
|
rubocop (1.68.0)
|
||||||
rubocop (1.64.0)
|
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
language_server-protocol (>= 3.17.0)
|
language_server-protocol (>= 3.17.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 3.3.0.2)
|
parser (>= 3.3.0.2)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 1.8, < 3.0)
|
regexp_parser (>= 2.4, < 3.0)
|
||||||
rexml (>= 3.2.5, < 4.0)
|
rubocop-ast (>= 1.32.2, < 2.0)
|
||||||
rubocop-ast (>= 1.31.1, < 2.0)
|
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 2.4.0, < 3.0)
|
unicode-display_width (>= 2.4.0, < 3.0)
|
||||||
rubocop-ast (1.31.3)
|
rubocop-ast (1.36.1)
|
||||||
parser (>= 3.3.1.0)
|
parser (>= 3.3.1.0)
|
||||||
rubocop-capybara (2.20.0)
|
rubocop-capybara (2.21.0)
|
||||||
rubocop (~> 1.41)
|
rubocop (~> 1.41)
|
||||||
rubocop-discourse (3.8.0)
|
rubocop-discourse (3.8.6)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 6.1)
|
||||||
rubocop (>= 1.59.0)
|
rubocop (>= 1.59.0)
|
||||||
rubocop-capybara (>= 2.0.0)
|
rubocop-capybara (>= 2.0.0)
|
||||||
rubocop-factory_bot (>= 2.0.0)
|
rubocop-factory_bot (>= 2.0.0)
|
||||||
rubocop-rails (>= 2.25.0)
|
rubocop-rails (>= 2.25.0)
|
||||||
rubocop-rspec (>= 2.25.0)
|
rubocop-rspec (>= 3.0.1)
|
||||||
rubocop-factory_bot (2.25.1)
|
rubocop-rspec_rails (>= 2.30.0)
|
||||||
rubocop (~> 1.41)
|
rubocop-factory_bot (2.26.1)
|
||||||
rubocop-rails (2.25.0)
|
rubocop (~> 1.61)
|
||||||
|
rubocop-rails (2.27.0)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rubocop (>= 1.33.0, < 2.0)
|
rubocop (>= 1.52.0, < 2.0)
|
||||||
rubocop-ast (>= 1.31.1, < 2.0)
|
rubocop-ast (>= 1.31.1, < 2.0)
|
||||||
rubocop-rspec (2.29.2)
|
rubocop-rspec (3.2.0)
|
||||||
rubocop (~> 1.40)
|
rubocop (~> 1.61)
|
||||||
rubocop-capybara (~> 2.17)
|
rubocop-rspec_rails (2.30.0)
|
||||||
rubocop-factory_bot (~> 2.22)
|
rubocop (~> 1.61)
|
||||||
rubocop-rspec_rails (~> 2.28)
|
rubocop-rspec (~> 3, >= 3.0.1)
|
||||||
rubocop-rspec_rails (2.28.3)
|
|
||||||
rubocop (~> 1.40)
|
|
||||||
ruby-progressbar (1.13.0)
|
ruby-progressbar (1.13.0)
|
||||||
|
securerandom (0.3.2)
|
||||||
syntax_tree (6.2.0)
|
syntax_tree (6.2.0)
|
||||||
prettier_print (>= 1.2.0)
|
prettier_print (>= 1.2.0)
|
||||||
tzinfo (2.0.6)
|
tzinfo (2.0.6)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
unicode-display_width (2.5.0)
|
unicode-display_width (2.6.0)
|
||||||
|
uri (1.0.2)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
@ -84,4 +87,4 @@ DEPENDENCIES
|
||||||
syntax_tree
|
syntax_tree
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.5.10
|
2.5.18
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
module Jobs
|
module Jobs
|
||||||
class EnqueueReminders < ::Jobs::Scheduled
|
class EnqueueReminders < ::Jobs::Scheduled
|
||||||
REMINDER_BUFFER_MINUTES ||= 120
|
REMINDER_BUFFER_MINUTES = 120
|
||||||
|
|
||||||
every 1.day
|
every 1.day
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
module DiscourseAssign
|
module DiscourseAssign
|
||||||
module DiscourseCalendar
|
module DiscourseCalendar
|
||||||
HOLIDAY_CUSTOM_FIELD ||= "on_holiday"
|
HOLIDAY_CUSTOM_FIELD = "on_holiday"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,5 +4,6 @@ module ::DiscourseAssign
|
||||||
class Engine < ::Rails::Engine
|
class Engine < ::Rails::Engine
|
||||||
engine_name PLUGIN_NAME
|
engine_name PLUGIN_NAME
|
||||||
isolate_namespace DiscourseAssign
|
isolate_namespace DiscourseAssign
|
||||||
|
config.autoload_paths << File.join(config.root, "lib")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
18
plugin.rb
18
plugin.rb
|
@ -22,24 +22,6 @@ require_relative "lib/discourse_assign/engine"
|
||||||
require_relative "lib/validators/assign_statuses_validator"
|
require_relative "lib/validators/assign_statuses_validator"
|
||||||
|
|
||||||
after_initialize do
|
after_initialize do
|
||||||
require_relative "app/jobs/regular/assign_notification"
|
|
||||||
require_relative "app/jobs/regular/remind_user"
|
|
||||||
require_relative "app/jobs/regular/unassign_notification"
|
|
||||||
require_relative "app/jobs/scheduled/enqueue_reminders"
|
|
||||||
require_relative "lib/assigner"
|
|
||||||
require_relative "lib/discourse_assign/create_notification"
|
|
||||||
require_relative "lib/discourse_assign/discourse_calendar"
|
|
||||||
require_relative "lib/discourse_assign/group_extension"
|
|
||||||
require_relative "lib/discourse_assign/helpers"
|
|
||||||
require_relative "lib/discourse_assign/list_controller_extension"
|
|
||||||
require_relative "lib/discourse_assign/notification_extension"
|
|
||||||
require_relative "lib/discourse_assign/post_extension"
|
|
||||||
require_relative "lib/discourse_assign/topic_extension"
|
|
||||||
require_relative "lib/discourse_assign/web_hook_extension"
|
|
||||||
require_relative "lib/pending_assigns_reminder"
|
|
||||||
require_relative "lib/random_assign_utils"
|
|
||||||
require_relative "lib/topic_assigner"
|
|
||||||
|
|
||||||
reloadable_patch do |plugin|
|
reloadable_patch do |plugin|
|
||||||
Group.prepend(DiscourseAssign::GroupExtension)
|
Group.prepend(DiscourseAssign::GroupExtension)
|
||||||
ListController.prepend(DiscourseAssign::ListControllerExtension)
|
ListController.prepend(DiscourseAssign::ListControllerExtension)
|
||||||
|
|
Loading…
Reference in New Issue