mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:11:38 +08:00
FIX: stop including GlobalPath in default context (#11323)
We do not want these method names to clash, instead encapsulate the helpers so we do not add methods to Kernel Correct a but exposed by Ruby 2.7
This commit is contained in:
parent
855026eea1
commit
a118ec13bc
|
@ -36,11 +36,6 @@ task 'assets:precompile:before' do
|
|||
|
||||
require 'sprockets'
|
||||
require 'digest/sha1'
|
||||
|
||||
# Needed for proper source maps with a CDN
|
||||
load "#{Rails.root}/lib/global_path.rb"
|
||||
include GlobalPath
|
||||
|
||||
end
|
||||
|
||||
task 'assets:precompile:css' => 'environment' do
|
||||
|
@ -80,6 +75,20 @@ def assets_path
|
|||
"#{Rails.root}/public/assets"
|
||||
end
|
||||
|
||||
def global_path_klass
|
||||
@global_path_klass ||= Class.new do
|
||||
extend GlobalPath
|
||||
end
|
||||
end
|
||||
|
||||
def cdn_path(p)
|
||||
global_path_klass.cdn_relative_path(p)
|
||||
end
|
||||
|
||||
def cdn_relative_path(p)
|
||||
global_path_klass.cdn_relative_path(p)
|
||||
end
|
||||
|
||||
def compress_node(from, to)
|
||||
to_path = "#{assets_path}/#{to}"
|
||||
assets = cdn_relative_path("/assets")
|
||||
|
|
Loading…
Reference in New Issue
Block a user