mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Upgrading Discourse to Zeitwerk (#8098)
Zeitwerk simplifies working with dependencies in dev and makes it easier reloading class chains. We no longer need to use Rails "require_dependency" anywhere and instead can just use standard Ruby patterns to require files. This is a far reaching change and we expect some followups here.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
module Demon; end
|
||||
|
||||
# intelligent fork based demonizer
|
||||
class Demon::Base
|
||||
class Demon::DemonBase
|
||||
|
||||
def self.demons
|
||||
@demons
|
||||
@@ -57,7 +57,7 @@ class Demon::Base
|
||||
def alive?(pid = nil)
|
||||
pid ||= @pid
|
||||
if pid
|
||||
Demon::Base.alive?(pid)
|
||||
Demon::DemonBase.alive?(pid)
|
||||
else
|
||||
false
|
||||
end
|
||||
@@ -143,7 +143,7 @@ class Demon::Base
|
||||
def already_running?
|
||||
if File.exists? pid_file
|
||||
pid = File.read(pid_file).to_i
|
||||
if Demon::Base.alive?(pid)
|
||||
if Demon::DemonBase.alive?(pid)
|
||||
return pid
|
||||
end
|
||||
end
|
||||
@@ -1,8 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "demon/base"
|
||||
require "demon/demon_base"
|
||||
|
||||
class Demon::RailsAutospec < Demon::Base
|
||||
class Demon::RailsAutospec < Demon::DemonBase
|
||||
|
||||
def self.prefix
|
||||
"rails-autospec"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "demon/base"
|
||||
require "demon/demon_base"
|
||||
|
||||
class Demon::Sidekiq < Demon::Base
|
||||
class Demon::Sidekiq < ::Demon::DemonBase
|
||||
|
||||
def self.prefix
|
||||
"sidekiq"
|
||||
|
||||
Reference in New Issue
Block a user