Skip to content

Commit

Permalink
turn Webpacker into a deprecation message wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Judahmeek committed Jul 4, 2023
1 parent a4fc332 commit 3e02e1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/shakapacker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require "active_support/core_ext/string/inquiry"
require "active_support/logger"
require "active_support/tagged_logging"
require_relative "./shakapacker/webpacker"

module Shakapacker
extend self
Expand Down Expand Up @@ -45,7 +46,4 @@ def ensure_log_goes_to_stdout
require "shakapacker/commands"
require "shakapacker/dev_server"
require "shakapacker/deprecation_helper"

require "shakapacker/railtie" if defined?(Rails)

Webpacker = Shakapacker
8 changes: 8 additions & 0 deletions lib/shakapacker/webpacker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Webpacker
def self.method_missing(method_name, *args, &block)
puts "The Webpacker constant has been superseded by the Shakapacker constant. "\
"Please change all references to the Webpacker constant, such as Webpacker.#{method_name}, "\
"to their Shakpacker equivalent, such as Shakapacker.#{method_name}"
Shakapacker.send(method_name, *args, &block)
end
end

0 comments on commit 3e02e1e

Please sign in to comment.