Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 10fb723

Browse files
authored
DEV: Add lib to autoload path (#605)
Why manually require files when we can autoload? Also update `discourse-rubocop` to 3.8.0.
1 parent 6101ecd commit 10fb723

File tree

5 files changed

+41
-55
lines changed

5 files changed

+41
-55
lines changed

Gemfile.lock

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,83 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.1.3.3)
4+
activesupport (8.0.0)
55
base64
6+
benchmark (>= 0.3)
67
bigdecimal
7-
concurrent-ruby (~> 1.0, >= 1.0.2)
8+
concurrent-ruby (~> 1.0, >= 1.3.1)
89
connection_pool (>= 2.2.5)
910
drb
1011
i18n (>= 1.6, < 2)
12+
logger (>= 1.4.2)
1113
minitest (>= 5.1)
12-
mutex_m
13-
tzinfo (~> 2.0)
14+
securerandom (>= 0.3)
15+
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
1417
ast (2.4.2)
1518
base64 (0.2.0)
19+
benchmark (0.4.0)
1620
bigdecimal (3.1.8)
17-
concurrent-ruby (1.2.3)
21+
concurrent-ruby (1.3.4)
1822
connection_pool (2.4.1)
1923
drb (2.2.1)
20-
i18n (1.14.5)
24+
i18n (1.14.6)
2125
concurrent-ruby (~> 1.0)
22-
json (2.7.2)
26+
json (2.8.2)
2327
language_server-protocol (3.17.0.3)
24-
minitest (5.23.1)
25-
mutex_m (0.2.0)
26-
parallel (1.24.0)
27-
parser (3.3.1.0)
28+
logger (1.6.1)
29+
minitest (5.25.1)
30+
parallel (1.26.3)
31+
parser (3.3.6.0)
2832
ast (~> 2.4.1)
2933
racc
3034
prettier_print (1.2.1)
31-
racc (1.8.0)
32-
rack (3.0.11)
35+
racc (1.8.1)
36+
rack (3.1.8)
3337
rainbow (3.1.1)
3438
regexp_parser (2.9.2)
35-
rexml (3.3.9)
36-
rubocop (1.64.0)
39+
rubocop (1.68.0)
3740
json (~> 2.3)
3841
language_server-protocol (>= 3.17.0)
3942
parallel (~> 1.10)
4043
parser (>= 3.3.0.2)
4144
rainbow (>= 2.2.2, < 4.0)
42-
regexp_parser (>= 1.8, < 3.0)
43-
rexml (>= 3.2.5, < 4.0)
44-
rubocop-ast (>= 1.31.1, < 2.0)
45+
regexp_parser (>= 2.4, < 3.0)
46+
rubocop-ast (>= 1.32.2, < 2.0)
4547
ruby-progressbar (~> 1.7)
4648
unicode-display_width (>= 2.4.0, < 3.0)
47-
rubocop-ast (1.31.3)
49+
rubocop-ast (1.36.1)
4850
parser (>= 3.3.1.0)
49-
rubocop-capybara (2.20.0)
51+
rubocop-capybara (2.21.0)
5052
rubocop (~> 1.41)
51-
rubocop-discourse (3.8.0)
53+
rubocop-discourse (3.8.6)
5254
activesupport (>= 6.1)
5355
rubocop (>= 1.59.0)
5456
rubocop-capybara (>= 2.0.0)
5557
rubocop-factory_bot (>= 2.0.0)
5658
rubocop-rails (>= 2.25.0)
57-
rubocop-rspec (>= 2.25.0)
58-
rubocop-factory_bot (2.25.1)
59-
rubocop (~> 1.41)
60-
rubocop-rails (2.25.0)
59+
rubocop-rspec (>= 3.0.1)
60+
rubocop-rspec_rails (>= 2.30.0)
61+
rubocop-factory_bot (2.26.1)
62+
rubocop (~> 1.61)
63+
rubocop-rails (2.27.0)
6164
activesupport (>= 4.2.0)
6265
rack (>= 1.1)
63-
rubocop (>= 1.33.0, < 2.0)
66+
rubocop (>= 1.52.0, < 2.0)
6467
rubocop-ast (>= 1.31.1, < 2.0)
65-
rubocop-rspec (2.29.2)
66-
rubocop (~> 1.40)
67-
rubocop-capybara (~> 2.17)
68-
rubocop-factory_bot (~> 2.22)
69-
rubocop-rspec_rails (~> 2.28)
70-
rubocop-rspec_rails (2.28.3)
71-
rubocop (~> 1.40)
68+
rubocop-rspec (3.2.0)
69+
rubocop (~> 1.61)
70+
rubocop-rspec_rails (2.30.0)
71+
rubocop (~> 1.61)
72+
rubocop-rspec (~> 3, >= 3.0.1)
7273
ruby-progressbar (1.13.0)
74+
securerandom (0.3.2)
7375
syntax_tree (6.2.0)
7476
prettier_print (>= 1.2.0)
7577
tzinfo (2.0.6)
7678
concurrent-ruby (~> 1.0)
77-
unicode-display_width (2.5.0)
79+
unicode-display_width (2.6.0)
80+
uri (1.0.2)
7881

7982
PLATFORMS
8083
ruby
@@ -84,4 +87,4 @@ DEPENDENCIES
8487
syntax_tree
8588

8689
BUNDLED WITH
87-
2.5.10
90+
2.5.18

app/jobs/scheduled/enqueue_reminders.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Jobs
44
class EnqueueReminders < ::Jobs::Scheduled
5-
REMINDER_BUFFER_MINUTES ||= 120
5+
REMINDER_BUFFER_MINUTES = 120
66

77
every 1.day
88

lib/discourse_assign/discourse_calendar.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module DiscourseAssign
44
module DiscourseCalendar
5-
HOLIDAY_CUSTOM_FIELD ||= "on_holiday"
5+
HOLIDAY_CUSTOM_FIELD = "on_holiday"
66
end
77
end

lib/discourse_assign/engine.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ module ::DiscourseAssign
44
class Engine < ::Rails::Engine
55
engine_name PLUGIN_NAME
66
isolate_namespace DiscourseAssign
7+
config.autoload_paths << File.join(config.root, "lib")
78
end
89
end

plugin.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,6 @@ module ::DiscourseAssign
2222
require_relative "lib/validators/assign_statuses_validator"
2323

2424
after_initialize do
25-
require_relative "app/jobs/regular/assign_notification"
26-
require_relative "app/jobs/regular/remind_user"
27-
require_relative "app/jobs/regular/unassign_notification"
28-
require_relative "app/jobs/scheduled/enqueue_reminders"
29-
require_relative "lib/assigner"
30-
require_relative "lib/discourse_assign/create_notification"
31-
require_relative "lib/discourse_assign/discourse_calendar"
32-
require_relative "lib/discourse_assign/group_extension"
33-
require_relative "lib/discourse_assign/helpers"
34-
require_relative "lib/discourse_assign/list_controller_extension"
35-
require_relative "lib/discourse_assign/notification_extension"
36-
require_relative "lib/discourse_assign/post_extension"
37-
require_relative "lib/discourse_assign/topic_extension"
38-
require_relative "lib/discourse_assign/web_hook_extension"
39-
require_relative "lib/pending_assigns_reminder"
40-
require_relative "lib/random_assign_utils"
41-
require_relative "lib/topic_assigner"
42-
4325
reloadable_patch do |plugin|
4426
Group.prepend(DiscourseAssign::GroupExtension)
4527
ListController.prepend(DiscourseAssign::ListControllerExtension)

0 commit comments

Comments
 (0)